summaryrefslogtreecommitdiff
path: root/game/network/link.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-10-22 01:01:02 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-10-22 01:01:02 +0100
commit9edf8711471db08427c5441ed37b6dfe3dd7f3b4 (patch)
tree4356058e9fd85e44c4404c5db8d5d3322a64aa29 /game/network/link.cpp
parentBump to CTRE to v3.9.0-1-gacb2f4d to fix compilation with clang 19 (diff)
parentFurther template maths functions (diff)
downloadilt-9edf8711471db08427c5441ed37b6dfe3dd7f3b4.tar.bz2
ilt-9edf8711471db08427c5441ed37b6dfe3dd7f3b4.tar.xz
ilt-9edf8711471db08427c5441ed37b6dfe3dd7f3b4.zip
Merge branch 'billboard-shadows'
Diffstat (limited to 'game/network/link.cpp')
-rw-r--r--game/network/link.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/game/network/link.cpp b/game/network/link.cpp
index 248fe7d..79af92a 100644
--- a/game/network/link.cpp
+++ b/game/network/link.cpp
@@ -46,12 +46,12 @@ 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) || 0.F) * radius};
+ const auto relPos {(sincos(ang) || 0.F) * radius};
const auto relClimb {vehiclePositionOffset()
+ RelativePosition3D {0, 0,
static_cast<RelativeDistance>(es.first->pos.z - centreBase.z)
+ (static_cast<RelativeDistance>(es.second->pos.z - es.first->pos.z) * frac)}};
- const auto pitch {vector_pitch({0, 0, static_cast<RelativeDistance>(es.second->pos.z - es.first->pos.z) / length})};
+ const auto pitch {vector_pitch(difference(es.second->pos, es.first->pos) / length)};
return Location {GlobalPosition3D(relPos + relClimb) + centreBase, {pitch, normalize(ang + dirOffset[start]), 0}};
}
@@ -69,7 +69,7 @@ LinkCurve::intersectRay(const Ray<GlobalPosition3D> & ray) const
points.reserve(segCount);
for (std::remove_const_t<decltype(step)> swing = {arc.first, centreBase.z - e0p.z}; segCount;
swing += step, --segCount) {
- points.emplace_back(centreBase + ((sincosf(swing.x) * radius) || swing.y));
+ points.emplace_back(centreBase + ((sincos(swing.x) * radius) || swing.y));
}
return ray.passesCloseToEdges(points, 1.F);
}