summaryrefslogtreecommitdiff
path: root/game/vehicles/train.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-12-28 15:42:50 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-12-28 15:42:50 +0000
commitde9909df038d1b6bb47bcc82fea5f8dc9dec2491 (patch)
treeb1f1337603c1bda68760d3f5f5147bc345e3e77f /game/vehicles/train.cpp
parentComponent position mouse click check should only match mouse button events (diff)
downloadilt-de9909df038d1b6bb47bcc82fea5f8dc9dec2491.tar.bz2
ilt-de9909df038d1b6bb47bcc82fea5f8dc9dec2491.tar.xz
ilt-de9909df038d1b6bb47bcc82fea5f8dc9dec2491.zip
Initial implementation for being able to click in the main window to select something
Diffstat (limited to 'game/vehicles/train.cpp')
-rw-r--r--game/vehicles/train.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/game/vehicles/train.cpp b/game/vehicles/train.cpp
index 14753c0..4f19bed 100644
--- a/game/vehicles/train.cpp
+++ b/game/vehicles/train.cpp
@@ -23,6 +23,12 @@ Train::getBogiePosition(float linkDist, float dist) const
return b2Link.first->positionAt(b2linkDist, b2Link.second);
}
+bool
+Train::intersectRay(const glm::vec3 & pos, const glm::vec3 & dir, glm::vec2 * baryPos, float * eh) const
+{
+ return applyOne(&RailVehicle::intersectRay, pos, dir, baryPos, eh) != end();
+}
+
void
Train::tick(TickDuration dur)
{