From 6a1df3dfbae98a05e74c646cc216fbc19ffdb6d6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 7 Jan 2024 13:04:31 +0000 Subject: Template Ray on position type --- game/network/network.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'game/network/network.cpp') 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 & 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; -- cgit v1.2.3