From 81e2f0082ee2c5b3584135467c94111565a776b1 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 13 Mar 2021 18:57:07 +0000 Subject: Add generic middle classes LinkStraight and LinkCurve --- game/network/link.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'game/network/link.h') diff --git a/game/network/link.h b/game/network/link.h index a174275..16ae5f7 100644 --- a/game/network/link.h +++ b/game/network/link.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -50,9 +51,42 @@ public: std::array ends; float length; + +protected: + [[nodiscard]] virtual glm::vec3 + vehiclePositionOffset() const + { + return {}; + } }; bool operator<(const glm::vec3 & a, const glm::vec3 & b); bool operator<(const Node & a, const Node & b); +class LinkStraight : public virtual Link { +public: + LinkStraight() = default; + inline ~LinkStraight() override = 0; + NO_COPY(LinkStraight); + NO_MOVE(LinkStraight); + + [[nodiscard]] Location positionAt(float dist, unsigned char start) const override; +}; +LinkStraight::~LinkStraight() = default; + +class LinkCurve : public virtual Link { +public: + inline ~LinkCurve() override = 0; + LinkCurve(glm::vec3, float, Arc); + NO_COPY(LinkCurve); + NO_MOVE(LinkCurve); + + [[nodiscard]] Location positionAt(float dist, unsigned char start) const override; + + glm::vec3 centreBase; + float radius; + Arc arc; +}; +LinkCurve::~LinkCurve() = default; + #endif -- cgit v1.2.3