diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-17 01:08:54 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-20 15:08:43 +0000 |
commit | a6e28fe377b41500d6ce3e0a9a4d6e6288d97f61 (patch) | |
tree | 7a77359865cb1359071d91ded0f0c574f57215bb /game/network/rail.h | |
parent | Add mail rail network to render test, include curves (diff) | |
download | ilt-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.h | 26 |
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(); |