diff options
Diffstat (limited to 'game/network')
-rw-r--r-- | game/network/link.cpp | 2 | ||||
-rw-r--r-- | game/network/network.cpp | 4 | ||||
-rw-r--r-- | game/network/rail.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/game/network/link.cpp b/game/network/link.cpp index 498afe4..d8479dd 100644 --- a/game/network/link.cpp +++ b/game/network/link.cpp @@ -46,7 +46,7 @@ LinkCurve::positionAt(float dist, unsigned char start) const const auto es {std::make_pair(ends[start].node.get(), ends[1 - start].node.get())}; const auto as {std::make_pair(arc[start], arc[1 - start])}; const auto ang {as.first + ((as.second - as.first) * frac)}; - const auto relPos {!sincosf(ang) * radius}; + const auto relPos {sincosf(ang) ^ 0.F * radius}; const auto relClimb {vehiclePositionOffset() + Position3D {0, 0, es.first->pos.z - centreBase.z + ((es.second->pos.z - es.first->pos.z) * frac)}}; const auto pitch {vector_pitch({0, 0, (es.second->pos.z - es.first->pos.z) / length})}; diff --git a/game/network/network.cpp b/game/network/network.cpp index d18345c..5de2f5d 100644 --- a/game/network/network.cpp +++ b/game/network/network.cpp @@ -100,7 +100,7 @@ Network::genCurveDef(const Position3D & start, const Position3D & end, float sta const auto diff {end - start}; const auto vy {vector_yaw(diff)}; const auto dir = pi + startDir; - const auto flatStart {!start}, flatEnd {!end}; + const auto flatStart {start.xy()}, flatEnd {end.xy()}; const auto n2ed {(vy * 2) - dir - pi}; const auto centre {find_arc_centre(flatStart, dir, flatEnd, n2ed)}; @@ -115,7 +115,7 @@ Network::genCurveDef(const Position3D & start, const Position3D & end, float sta { startDir += pi; endDir += pi; - const Position2D flatStart {!start}, flatEnd {!end}; + const Position2D flatStart {start.xy()}, flatEnd {end.xy()}; auto midheight = [&](auto mid) { const auto sm = glm::distance(flatStart, mid), em = glm::distance(flatEnd, mid); return start.z + ((end.z - start.z) * (sm / (sm + em))); diff --git a/game/network/rail.cpp b/game/network/rail.cpp index ff101d4..545a728 100644 --- a/game/network/rail.cpp +++ b/game/network/rail.cpp @@ -45,7 +45,7 @@ RailLinks::addLinksBetween(Position3D start, Position3D end) if (dir == vector_yaw(end - start)) { return addLink<RailLinkStraight>(start, end); } - const Position2D flatStart {!start}, flatEnd {!end}; + const Position2D flatStart {start.xy()}, flatEnd {end.xy()}; if (node2ins.second == NodeIs::InNetwork) { auto midheight = [&](auto mid) { const auto sm = glm::distance(flatStart, mid), em = glm::distance(flatEnd, mid); @@ -142,7 +142,7 @@ RailLinkStraight::RailLinkStraight(Node::Ptr a, Node::Ptr b, const Position3D & } RailLinkCurve::RailLinkCurve(const Node::Ptr & a, const Node::Ptr & b, Position2D c) : - RailLinkCurve(a, b, c ^ a->pos.z, {!c, a->pos, b->pos}) + RailLinkCurve(a, b, c ^ a->pos.z, {c ^ 0.F, a->pos, b->pos}) { } |