summaryrefslogtreecommitdiff
path: root/game/network/network.impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/network/network.impl.h')
-rw-r--r--game/network/network.impl.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/game/network/network.impl.h b/game/network/network.impl.h
index d2e9ff0..afc9304 100644
--- a/game/network/network.impl.h
+++ b/game/network/network.impl.h
@@ -21,3 +21,18 @@ NetworkOf<T>::joinLinks(const LinkPtr & l) const
Network::joinLinks(l, ol);
}
}
+
+template<typename T>
+Network::IntersectRayResult
+NetworkOf<T>::intersectRayLinks(const Ray & ray) const
+{
+ // Click link
+ if (const auto link = std::find_if(links.objects.begin(), links.objects.end(),
+ [&ray](const std::shared_ptr<T> & link) {
+ return link->intersectRay(ray);
+ });
+ link != links.objects.end()) {
+ return *link;
+ }
+ return {};
+}