diff options
Diffstat (limited to 'game/network/network.cpp')
-rw-r--r-- | game/network/network.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/game/network/network.cpp b/game/network/network.cpp index 65b2a62..6ba3ed6 100644 --- a/game/network/network.cpp +++ b/game/network/network.cpp @@ -95,7 +95,7 @@ Network::routeFromTo(const Link::End & end, const Node::Ptr & dest) const GenCurveDef Network::genCurveDef(const GlobalPosition3D & start, const GlobalPosition3D & end, float startDir) { - const auto diff {end - start}; + const auto diff = difference(end, start); const auto vy {vector_yaw(diff)}; const auto dir = pi + startDir; const auto flatStart {start.xy()}, flatEnd {end.xy()}; @@ -121,16 +121,16 @@ Network::genCurveDef(const GlobalPosition3D & start, const GlobalPosition3D & en }; if (const auto radii = find_arcs_radius(flatStart, startDir, flatEnd, endDir); radii.first < radii.second) { const auto radius {radii.first}; - const auto c1 = flatStart + (sincosf(startDir + half_pi) * radius); - const auto c2 = flatEnd + (sincosf(endDir + half_pi) * radius); + const auto c1 = flatStart + (sincos(startDir + half_pi) * radius); + const auto c2 = flatEnd + (sincos(endDir + half_pi) * radius); const auto mid = (c1 + c2) / 2; const auto midh = mid || midheight(mid); return {{start, midh, c1}, {end, midh, c2}}; } else { const auto radius {radii.second}; - const auto c1 = flatStart + (sincosf(startDir - half_pi) * radius); - const auto c2 = flatEnd + (sincosf(endDir - half_pi) * radius); + const auto c1 = flatStart + (sincos(startDir - half_pi) * radius); + const auto c2 = flatEnd + (sincos(endDir - half_pi) * radius); const auto mid = (c1 + c2) / 2; const auto midh = mid || midheight(mid); return {{midh, start, c1}, {midh, end, c2}}; |