summaryrefslogtreecommitdiff
path: root/game/network/rail.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-17 01:08:54 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-20 15:08:43 +0000
commita6e28fe377b41500d6ce3e0a9a4d6e6288d97f61 (patch)
tree7a77359865cb1359071d91ded0f0c574f57215bb /game/network/rail.h
parentAdd mail rail network to render test, include curves (diff)
downloadilt-a6e28fe377b41500d6ce3e0a9a4d6e6288d97f61.tar.bz2
ilt-a6e28fe377b41500d6ce3e0a9a4d6e6288d97f61.tar.xz
ilt-a6e28fe377b41500d6ce3e0a9a4d6e6288d97f61.zip
Copy render vital link data to vertex buffer
Diffstat (limited to 'game/network/rail.h')
-rw-r--r--game/network/rail.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/game/network/rail.h b/game/network/rail.h
index 986b0aa..e06568f 100644
--- a/game/network/rail.h
+++ b/game/network/rail.h
@@ -40,23 +40,39 @@ protected:
RailLink::~RailLink() = default;
+class RailLinks;
+
class RailLinkStraight : public RailLink, public LinkStraight {
public:
- RailLinkStraight(const Node::Ptr &, const Node::Ptr &);
+ RailLinkStraight(NetworkLinkHolder<RailLinkStraight> &, const Node::Ptr &, const Node::Ptr &);
+
+ struct Vertex {
+ GlobalPosition3D a, b;
+ glm::mat2 rotation;
+ float textureRepeats;
+ };
private:
- RailLinkStraight(Node::Ptr, Node::Ptr, const RelativePosition3D & diff);
+ RailLinkStraight(NetworkLinkHolder<RailLinkStraight> &, Node::Ptr, Node::Ptr, const RelativePosition3D & diff);
+ InstanceVertices<Vertex>::InstanceProxy instance;
};
class RailLinkCurve : public RailLink, public LinkCurve {
public:
- RailLinkCurve(const Node::Ptr &, const Node::Ptr &, GlobalPosition2D);
+ RailLinkCurve(NetworkLinkHolder<RailLinkCurve> &, const Node::Ptr &, const Node::Ptr &, GlobalPosition2D);
+
+ struct Vertex {
+ GlobalPosition3D a, b, c;
+ float textureRepeats;
+ };
private:
- RailLinkCurve(const Node::Ptr &, const Node::Ptr &, GlobalPosition3D, const Arc);
+ RailLinkCurve(
+ NetworkLinkHolder<RailLinkCurve> &, const Node::Ptr &, const Node::Ptr &, GlobalPosition3D, const Arc);
+ InstanceVertices<Vertex>::InstanceProxy instance;
};
-class RailLinks : public NetworkOf<RailLink>, public WorldObject {
+class RailLinks : public NetworkOf<RailLink, RailLinkStraight, RailLinkCurve>, public WorldObject {
public:
RailLinks();