diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-08-29 21:51:11 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-08-29 21:51:11 +0100 |
commit | 945a951aec17a7fbc6d69e4492a3a4a75f480ae8 (patch) | |
tree | 6856421c78662de1603e9a33166f1e5b71e7d06a /game/network/link.h | |
parent | Ray function to test if it passes close to a sequence of edges defined by nod... (diff) | |
download | ilt-945a951aec17a7fbc6d69e4492a3a4a75f480ae8.tar.bz2 ilt-945a951aec17a7fbc6d69e4492a3a4a75f480ae8.tar.xz ilt-945a951aec17a7fbc6d69e4492a3a4a75f480ae8.zip |
Link functions for testing if a ray clicks them
Diffstat (limited to 'game/network/link.h')
-rw-r--r-- | game/network/link.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 <utility> #include <vector> +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<End, 2> 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; |