diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-03-21 20:23:44 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-03-21 20:23:44 +0000 |
commit | 4571ce1b4cac2ab9bf2454ed06d0d787604d62fa (patch) | |
tree | 5120afcca84de35d0097cecae62d0b211518ed60 /game/network/rail.cpp | |
parent | Make arc_length a member function (diff) | |
download | ilt-4571ce1b4cac2ab9bf2454ed06d0d787604d62fa.tar.bz2 ilt-4571ce1b4cac2ab9bf2454ed06d0d787604d62fa.tar.xz ilt-4571ce1b4cac2ab9bf2454ed06d0d787604d62fa.zip |
Add helper constructors to Arc
* Two angles, wraps logic ensuring b after a
* Two vector directions
* Centre and two endpoints, in at least 2 dimensions, uses .xy()
Diffstat (limited to 'game/network/rail.cpp')
-rw-r--r-- | game/network/rail.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/game/network/rail.cpp b/game/network/rail.cpp index e342224..fd07ace 100644 --- a/game/network/rail.cpp +++ b/game/network/rail.cpp @@ -95,9 +95,8 @@ round_sleepers(const float v) return round_frac(v, sleepers); } -RailLinkStraight::RailLinkStraight( - NetworkLinkHolder<RailLinkStraight> & instances, const Node::Ptr & a, const Node::Ptr & b) : - RailLinkStraight(instances, a, b, b->pos - a->pos) +RailLinkStraight::RailLinkStraight(NetworkLinkHolder<RailLinkStraight> & instances, const Node::Ptr & a, + const Node::Ptr & b) : RailLinkStraight(instances, a, b, b->pos - a->pos) { } @@ -109,9 +108,8 @@ RailLinkStraight::RailLinkStraight( { } -RailLinkCurve::RailLinkCurve( - NetworkLinkHolder<RailLinkCurve> & instances, const Node::Ptr & a, const Node::Ptr & b, GlobalPosition2D c) : - RailLinkCurve(instances, a, b, c || a->pos.z, {c || 0, a->pos, b->pos}) +RailLinkCurve::RailLinkCurve(NetworkLinkHolder<RailLinkCurve> & instances, const Node::Ptr & a, const Node::Ptr & b, + GlobalPosition2D c) : RailLinkCurve(instances, a, b, c || a->pos.z, {c, a->pos, b->pos}) { } |