diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 13:23:27 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 13:23:27 +0000 |
commit | 108bf5b2424da06aa2e1735ffd10a2b713834db8 (patch) | |
tree | af0918a6a266aa7e6ee1d8129df6d5ef9fc4f8ab /game/network/network.cpp | |
parent | Remove more use of legacy types and unnecessary pointers from selectable inte... (diff) | |
parent | Remove Position3D from RailVehicle (diff) | |
download | ilt-108bf5b2424da06aa2e1735ffd10a2b713834db8.tar.bz2 ilt-108bf5b2424da06aa2e1735ffd10a2b713834db8.tar.xz ilt-108bf5b2424da06aa2e1735ffd10a2b713834db8.zip |
Merge branch 'template-types'
Diffstat (limited to 'game/network/network.cpp')
-rw-r--r-- | game/network/network.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/game/network/network.cpp b/game/network/network.cpp index 1ff5b26..d52e804 100644 --- a/game/network/network.cpp +++ b/game/network/network.cpp @@ -49,13 +49,14 @@ Network::candidateNodeAt(Position3D pos) const } Node::Ptr -Network::intersectRayNodes(const Ray & ray) const +Network::intersectRayNodes(const Ray<GlobalPosition3D> & ray) const { // Click within 2m of a node if (const auto node = std::find_if(nodes.begin(), nodes.end(), [&ray](const Node::Ptr & node) { - Position3D ipos, inorm; - return glm::intersectRaySphere(ray.start, ray.direction, node->pos, 2.F, ipos, inorm); + GlobalPosition3D ipos; + Normal3D inorm; + return ray.intersectSphere(node->pos, 2000, ipos, inorm); }); node != nodes.end()) { return *node; |