summaryrefslogtreecommitdiff
path: root/game/vehicles/train.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-01-02 21:07:37 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-01-02 21:07:37 +0000
commit7c8b8a39fd36e190578587d8d92f28f460a1fc4b (patch)
tree03c0943bcec657992aa92afb91a3613eb1c8423b /game/vehicles/train.cpp
parentNo need to pass GameState around, it has a global pointer (diff)
downloadilt-7c8b8a39fd36e190578587d8d92f28f460a1fc4b.tar.bz2
ilt-7c8b8a39fd36e190578587d8d92f28f460a1fc4b.tar.xz
ilt-7c8b8a39fd36e190578587d8d92f28f460a1fc4b.zip
Encapsulate Ray
Diffstat (limited to 'game/vehicles/train.cpp')
-rw-r--r--game/vehicles/train.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/game/vehicles/train.cpp b/game/vehicles/train.cpp
index 4f19bed..05915c4 100644
--- a/game/vehicles/train.cpp
+++ b/game/vehicles/train.cpp
@@ -9,6 +9,8 @@
#include <optional>
#include <utility>
+class Ray;
+
void
Train::render(const Shader & shader) const
{
@@ -24,9 +26,9 @@ Train::getBogiePosition(float linkDist, float dist) const
}
bool
-Train::intersectRay(const glm::vec3 & pos, const glm::vec3 & dir, glm::vec2 * baryPos, float * eh) const
+Train::intersectRay(const Ray & ray, glm::vec2 * baryPos, float * eh) const
{
- return applyOne(&RailVehicle::intersectRay, pos, dir, baryPos, eh) != end();
+ return applyOne(&RailVehicle::intersectRay, ray, baryPos, eh) != end();
}
void