diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 17:29:21 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 17:29:21 +0000 |
commit | 067ecf8d6dfc9ecf002d3cc92ce7d1574d095ddc (patch) | |
tree | 8c913d4dcf006786df4888e036b3d83f84e87dc8 /game/network/link.cpp | |
parent | Global positions in network data (diff) | |
download | ilt-067ecf8d6dfc9ecf002d3cc92ce7d1574d095ddc.tar.bz2 ilt-067ecf8d6dfc9ecf002d3cc92ce7d1574d095ddc.tar.xz ilt-067ecf8d6dfc9ecf002d3cc92ce7d1574d095ddc.zip |
Remove PositionxD from Network
Diffstat (limited to 'game/network/link.cpp')
-rw-r--r-- | game/network/link.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/game/network/link.cpp b/game/network/link.cpp index dc9aecc..932fc67 100644 --- a/game/network/link.cpp +++ b/game/network/link.cpp @@ -63,12 +63,13 @@ LinkCurve::intersectRay(const Ray<GlobalPosition3D> & ray) const const auto & e1p {ends[1].node->pos}; const auto slength = round_frac(length / 2.F, 5.F); const auto segs = std::round(15.F * slength / std::pow(radius, 0.7F)); - const auto step {Position2D {arc_length(arc), e1p.z - e0p.z} / segs}; + const auto step {glm::vec<2, RelativeDistance> {arc_length(arc), e1p.z - e0p.z} / segs}; auto segCount = static_cast<std::size_t>(std::lround(segs)) + 1; std::vector<GlobalPosition3D> points; points.reserve(segCount); - for (Position2D swing = {arc.first, centreBase.z - e0p.z}; segCount; swing += step, --segCount) { + for (std::remove_const_t<decltype(step)> swing = {arc.first, centreBase.z - e0p.z}; segCount; + swing += step, --segCount) { points.emplace_back(centreBase + GlobalPosition3D((sincosf(swing.x) * radius) || swing.y)); } return ray.passesCloseToEdges(points, 1.F); |