summaryrefslogtreecommitdiff
path: root/game/vehicles/railVehicle.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-07 13:04:31 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-07 13:04:31 +0000
commit6a1df3dfbae98a05e74c646cc216fbc19ffdb6d6 (patch)
tree46c42bcbef1f12c4f46d53b4e0c4736bea506b51 /game/vehicles/railVehicle.cpp
parentUnified crossProduct (diff)
downloadilt-6a1df3dfbae98a05e74c646cc216fbc19ffdb6d6.tar.bz2
ilt-6a1df3dfbae98a05e74c646cc216fbc19ffdb6d6.tar.xz
ilt-6a1df3dfbae98a05e74c646cc216fbc19ffdb6d6.zip
Template Ray on position type
Diffstat (limited to 'game/vehicles/railVehicle.cpp')
-rw-r--r--game/vehicles/railVehicle.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp
index c720eb6..985e9f2 100644
--- a/game/vehicles/railVehicle.cpp
+++ b/game/vehicles/railVehicle.cpp
@@ -44,7 +44,7 @@ RailVehicle::move(const Train * t, float & trailBy)
}
bool
-RailVehicle::intersectRay(const Ray & ray, BaryPosition & baryPos, RelativeDistance & distance) const
+RailVehicle::intersectRay(const Ray<GlobalPosition3D> & ray, BaryPosition & baryPos, RelativeDistance & distance) const
{
constexpr const auto X = 1350.F;
const auto Y = this->rvClass->length / 2.F;
@@ -73,7 +73,7 @@ RailVehicle::intersectRay(const Ray & ray, BaryPosition & baryPos, RelativeDista
}};
return std::any_of(
triangles.begin(), triangles.end(), [&cornerVertices, &ray, &baryPos, &distance](const auto & idx) {
- return glm::intersectRayTriangle(ray.start, ray.direction, cornerVertices[idx[0]],
- cornerVertices[idx[1]], cornerVertices[idx[2]], baryPos, distance);
+ return ray.intersectTriangle(
+ cornerVertices[idx[0]], cornerVertices[idx[1]], cornerVertices[idx[2]], baryPos, distance);
});
}