diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 13:18:56 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 13:18:56 +0000 |
commit | 25c7bec4acd63ebe01b3d1d21fa01ddf382df829 (patch) | |
tree | af0918a6a266aa7e6ee1d8129df6d5ef9fc4f8ab | |
parent | Template Ray on position type (diff) | |
download | ilt-25c7bec4acd63ebe01b3d1d21fa01ddf382df829.tar.bz2 ilt-25c7bec4acd63ebe01b3d1d21fa01ddf382df829.tar.xz ilt-25c7bec4acd63ebe01b3d1d21fa01ddf382df829.zip |
Remove Position3D from RailVehicle
-rw-r--r-- | game/vehicles/railVehicle.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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<GlobalPosition3D> & 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<glm::vec<3, uint8_t>, 10> triangles {{ |