summaryrefslogtreecommitdiff
path: root/game/network/rail.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-02-14 13:32:23 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-02-14 13:32:23 +0000
commit59ba050325f60226fa16c71378ec5671c161980b (patch)
tree7f6da0c90b1ecff1e22fd8138124d49633826143 /game/network/rail.cpp
parentTest run depends on resources (diff)
downloadilt-59ba050325f60226fa16c71378ec5671c161980b.tar.bz2
ilt-59ba050325f60226fa16c71378ec5671c161980b.tar.xz
ilt-59ba050325f60226fa16c71378ec5671c161980b.zip
Don't copy shared_ptrs
Diffstat (limited to 'game/network/rail.cpp')
-rw-r--r--game/network/rail.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/game/network/rail.cpp b/game/network/rail.cpp
index a765a4f..c926ced 100644
--- a/game/network/rail.cpp
+++ b/game/network/rail.cpp
@@ -99,7 +99,7 @@ RailLinkStraight::RailLinkStraight(NodePtr a, NodePtr b, const glm::vec3 & diff)
Transform
RailLinkStraight::positionAt(float dist, unsigned char start) const
{
- const auto es {std::make_pair(ends[start].first, ends[1 - start].first)};
+ const auto es {std::make_pair(ends[start].first.get(), ends[1 - start].first.get())};
const auto diff {es.second->pos - es.first->pos};
const auto dir {glm::normalize(diff)};
return Transform {es.first->pos + dir * dist, {0, flat_angle(diff) /*, std::atan2(diff.x, -diff.z)*/, 0}};
@@ -140,7 +140,7 @@ RailLinkCurve::positionAt(float dist, unsigned char start) const
{
static constexpr std::array<float, 2> dirOffset {half_pi, -half_pi};
const auto frac {dist / length};
- const auto es {std::make_pair(ends[start].first, ends[1 - start].first)};
+ const auto es {std::make_pair(ends[start].first.get(), ends[1 - start].first.get())};
const auto as {std::make_pair(arc[start], arc[1 - start])};
const auto ang {as.first + ((as.second - as.first) * frac)};
const auto angArc {ang - half_pi};