diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-04-04 20:06:36 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-04-04 20:06:36 +0100 |
commit | 30b027f84772d4b1d18eebd03b83ce3a5966d5fe (patch) | |
tree | bf1f424ee3c92516d652934cf502ee06f60c57e5 /game/network/rail.cpp | |
parent | Simplify vector addition/subtraction with differnt types (diff) | |
parent | Remove wireframe mode from test renders (diff) | |
download | ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.bz2 ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.xz ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.zip |
Merge remote-tracking branch 'origin/deform-terrain'
Two related issues remain:
* Terrain self shadowing is common and handled poorly
* Odd, but mathematically correct patterns/stripes in feature boundaries
Neither of these relate directly to deformation.
Diffstat (limited to 'game/network/rail.cpp')
-rw-r--r-- | game/network/rail.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/game/network/rail.cpp b/game/network/rail.cpp index 34cbceb..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,16 +108,15 @@ 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}) { } RailLinkCurve::RailLinkCurve(NetworkLinkHolder<RailLinkCurve> & instances, const Node::Ptr & a, const Node::Ptr & b, GlobalPosition3D c, const Arc arc) : Link({a, normalize(arc.first + half_pi)}, {b, normalize(arc.second - half_pi)}, - glm::length(RelativePosition3D(a->pos - c)) * arc_length(arc)), + glm::length(RelativePosition3D(a->pos - c)) * arc.length()), LinkCurve {c, glm::length(RelativePosition3D(ends[0].node->pos - c)), arc}, instance {instances.vertices.acquire(ends[0].node->pos, ends[1].node->pos, c, round_sleepers(length / 2000.F), half_pi - arc.first, half_pi - arc.second, radius)} |