summaryrefslogtreecommitdiff
path: root/game/network/link.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-07 17:13:38 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-07 17:13:38 +0000
commit381caebb524a5bb8f091d1aa2ca02d384e010961 (patch)
tree1f006fe4bdcecabdb402f999a6fc9d0d52c8f34d /game/network/link.h
parentMerge branch 'template-types' (diff)
downloadilt-381caebb524a5bb8f091d1aa2ca02d384e010961.tar.bz2
ilt-381caebb524a5bb8f091d1aa2ca02d384e010961.tar.xz
ilt-381caebb524a5bb8f091d1aa2ca02d384e010961.zip
Global positions in network data
Diffstat (limited to 'game/network/link.h')
-rw-r--r--game/network/link.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/game/network/link.h b/game/network/link.h
index 95c141e..725e023 100644
--- a/game/network/link.h
+++ b/game/network/link.h
@@ -4,7 +4,6 @@
#include <glm/glm.hpp>
#include <location.h>
#include <maths.h>
-#include <memory>
#include <special_members.h>
#include <stdTypeDefs.h>
#include <utility>
@@ -17,12 +16,12 @@ template<typename> class Ray;
// it has location
class Node : public StdTypeDefs<Node> {
public:
- explicit Node(Position3D p) noexcept : pos(p) {};
+ explicit Node(GlobalPosition3D p) noexcept : pos(p) {};
virtual ~Node() noexcept = default;
NO_COPY(Node);
NO_MOVE(Node);
- Position3D pos;
+ GlobalPosition3D pos;
};
// Generic network link
@@ -44,21 +43,21 @@ public:
NO_COPY(Link);
NO_MOVE(Link);
- [[nodiscard]] virtual Location positionAt(float dist, unsigned char start) const = 0;
+ [[nodiscard]] virtual Location positionAt(RelativeDistance dist, unsigned char start) const = 0;
[[nodiscard]] virtual bool intersectRay(const Ray<GlobalPosition3D> &) const = 0;
std::array<End, 2> ends;
float length;
protected:
- [[nodiscard]] virtual Position3D
+ [[nodiscard]] virtual RelativePosition3D
vehiclePositionOffset() const
{
return {};
}
};
-bool operator<(const Position3D & a, const Position3D & b);
+bool operator<(const GlobalPosition3D & a, const GlobalPosition3D & b);
bool operator<(const Node & a, const Node & b);
class LinkStraight : public virtual Link {
@@ -68,7 +67,7 @@ public:
NO_COPY(LinkStraight);
NO_MOVE(LinkStraight);
- [[nodiscard]] Location positionAt(float dist, unsigned char start) const override;
+ [[nodiscard]] Location positionAt(RelativeDistance dist, unsigned char start) const override;
[[nodiscard]] bool intersectRay(const Ray<GlobalPosition3D> &) const override;
};
@@ -77,15 +76,15 @@ LinkStraight::~LinkStraight() = default;
class LinkCurve : public virtual Link {
public:
inline ~LinkCurve() override = 0;
- LinkCurve(Position3D, float, Arc);
+ LinkCurve(GlobalPosition3D, RelativeDistance, Arc);
NO_COPY(LinkCurve);
NO_MOVE(LinkCurve);
- [[nodiscard]] Location positionAt(float dist, unsigned char start) const override;
+ [[nodiscard]] Location positionAt(RelativeDistance dist, unsigned char start) const override;
[[nodiscard]] bool intersectRay(const Ray<GlobalPosition3D> &) const override;
- Position3D centreBase;
- float radius;
+ GlobalPosition3D centreBase;
+ RelativeDistance radius;
Arc arc;
};