From 945a951aec17a7fbc6d69e4492a3a4a75f480ae8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 29 Aug 2022 21:51:11 +0100 Subject: Link functions for testing if a ray clicks them --- game/network/link.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'game/network/link.h') diff --git a/game/network/link.h b/game/network/link.h index 51c29ff..d9629de 100644 --- a/game/network/link.h +++ b/game/network/link.h @@ -9,6 +9,8 @@ #include #include +class Ray; + // Generic network node // something that can be travelled to // it has location @@ -47,6 +49,7 @@ public: NO_MOVE(Link); [[nodiscard]] virtual Location positionAt(float dist, unsigned char start) const = 0; + [[nodiscard]] virtual bool intersectRay(const Ray &) const = 0; std::array ends; float length; @@ -70,6 +73,7 @@ public: NO_MOVE(LinkStraight); [[nodiscard]] Location positionAt(float dist, unsigned char start) const override; + [[nodiscard]] bool intersectRay(const Ray &) const override; }; LinkStraight::~LinkStraight() = default; @@ -81,6 +85,7 @@ public: NO_MOVE(LinkCurve); [[nodiscard]] Location positionAt(float dist, unsigned char start) const override; + [[nodiscard]] bool intersectRay(const Ray &) const override; glm::vec3 centreBase; float radius; -- cgit v1.2.3