summaryrefslogtreecommitdiff
path: root/game/vehicles/railVehicle.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-06 12:06:26 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-06 12:06:26 +0000
commite3b587143dfc4e8b97d8916ef1d4bcd1dd43734c (patch)
tree30ebcb1b3340456c1a82e6d45c983ae9f73f0a43 /game/vehicles/railVehicle.cpp
parentTemplate GeometicPlane on Position type (diff)
downloadilt-e3b587143dfc4e8b97d8916ef1d4bcd1dd43734c.tar.bz2
ilt-e3b587143dfc4e8b97d8916ef1d4bcd1dd43734c.tar.xz
ilt-e3b587143dfc4e8b97d8916ef1d4bcd1dd43734c.zip
Simplified RailVehicle::intersectRay
Diffstat (limited to 'game/vehicles/railVehicle.cpp')
-rw-r--r--game/vehicles/railVehicle.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp
index 6653333..94f72e4 100644
--- a/game/vehicles/railVehicle.cpp
+++ b/game/vehicles/railVehicle.cpp
@@ -49,16 +49,16 @@ RailVehicle::intersectRay(const Ray & ray, BaryPosition & baryPos, RelativeDista
constexpr const auto X = 1350.F;
const auto Y = this->rvClass->length / 2.F;
constexpr const auto Z = 3900.F;
- const auto moveBy = location.getRotationTransform();
+ const glm::mat3 moveBy = location.getRotationTransform();
const std::array<Position3D, 8> cornerVertices {{
- location.position() + GlobalPosition3D(moveBy * glm::vec4 {-X, Y, 0, 1}).xyz(), // LFB
- location.position() + GlobalPosition3D(moveBy * glm::vec4 {X, Y, 0, 1}).xyz(), // RFB
- location.position() + GlobalPosition3D(moveBy * glm::vec4 {-X, Y, Z, 1}).xyz(), // LFT
- location.position() + GlobalPosition3D(moveBy * glm::vec4 {X, Y, Z, 1}).xyz(), // RFT
- location.position() + GlobalPosition3D(moveBy * glm::vec4 {-X, -Y, 0, 1}).xyz(), // LBB
- location.position() + GlobalPosition3D(moveBy * glm::vec4 {X, -Y, 0, 1}).xyz(), // RBB
- location.position() + GlobalPosition3D(moveBy * glm::vec4 {-X, -Y, Z, 1}).xyz(), // LBT
- location.position() + GlobalPosition3D(moveBy * glm::vec4 {X, -Y, Z, 1}).xyz(), // RBT
+ location.position() + GlobalPosition3D(moveBy * glm::vec3 {-X, Y, 0}), // LFB
+ location.position() + GlobalPosition3D(moveBy * glm::vec3 {X, Y, 0}), // RFB
+ location.position() + GlobalPosition3D(moveBy * glm::vec3 {-X, Y, Z}), // LFT
+ location.position() + GlobalPosition3D(moveBy * glm::vec3 {X, Y, Z}), // RFT
+ location.position() + GlobalPosition3D(moveBy * glm::vec3 {-X, -Y, 0}), // LBB
+ location.position() + GlobalPosition3D(moveBy * glm::vec3 {X, -Y, 0}), // RBB
+ location.position() + GlobalPosition3D(moveBy * glm::vec3 {-X, -Y, Z}), // LBT
+ location.position() + GlobalPosition3D(moveBy * glm::vec3 {X, -Y, Z}), // RBT
}};
static constexpr const std::array<glm::vec<3, uint8_t>, 10> triangles {{
// Front