From 25c7bec4acd63ebe01b3d1d21fa01ddf382df829 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 7 Jan 2024 13:18:56 +0000 Subject: Remove Position3D from RailVehicle --- game/vehicles/railVehicle.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'game/vehicles/railVehicle.cpp') diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp index 985e9f2..4a1fdab 100644 --- a/game/vehicles/railVehicle.cpp +++ b/game/vehicles/railVehicle.cpp @@ -22,12 +22,12 @@ RailVehicle::RailVehicle(RailVehicleClassPtr rvc) : this->get()->front = l->getRotationTransform(); this->get()->frontPos = l->position(); }, - Position3D {0, rvClass->wheelBase / 2.F, 0}}, + GlobalPosition3D {0, rvClass->wheelBase / 2.F, 0}}, {[this](const BufferedLocation * l) { this->get()->back = l->getRotationTransform(); this->get()->backPos = l->position(); }, - Position3D {0, -rvClass->wheelBase / 2.F, 0}}, + GlobalPosition3D {0, -rvClass->wheelBase / 2.F, 0}}, }} { } @@ -50,8 +50,7 @@ RailVehicle::intersectRay(const Ray & ray, BaryPosition & bary const auto Y = this->rvClass->length / 2.F; constexpr const auto Z = 3900.F; const glm::mat3 moveBy = location.getRotationTransform(); - const auto cornerVertices - = cuboidCorners(-X, X, -Y, Y, 0.F, Z) * [&moveBy, this](const auto & corner) -> Position3D { + const auto cornerVertices = cuboidCorners(-X, X, -Y, Y, 0.F, Z) * [&moveBy, this](const auto & corner) { return location.position() + GlobalPosition3D(moveBy * corner); }; static constexpr const std::array, 10> triangles {{ -- cgit v1.2.3