summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-04-03 11:54:15 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2026-04-03 11:54:15 +0100
commit4b65fcaba60a41f5ac5ce2fecf4ce636d4fe0470 (patch)
treef74d055f151472cda3fa3fc0f760eb6219dd9fad /game
parentMove spot/point light persistence wrappers to assetFactory (diff)
downloadilt-4b65fcaba60a41f5ac5ce2fecf4ce636d4fe0470.tar.bz2
ilt-4b65fcaba60a41f5ac5ce2fecf4ce636d4fe0470.tar.xz
ilt-4b65fcaba60a41f5ac5ce2fecf4ce636d4fe0470.zip
Fix direction of difference vector calculating railVehicle new position
Diffstat (limited to 'game')
-rw-r--r--game/vehicles/railVehicle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp
index 5f92066..c11d817 100644
--- a/game/vehicles/railVehicle.cpp
+++ b/game/vehicles/railVehicle.cpp
@@ -28,7 +28,7 @@ RailVehicle::move(const Train * t, float & trailBy)
const auto overhang {(rvClass->length - rvClass->wheelBase) / 2};
const auto & b1Pos = *(get()->front = t->getBogiePosition(t->linkDist, trailBy += overhang));
const auto & b2Pos = *(get()->back = t->getBogiePosition(t->linkDist, trailBy += rvClass->wheelBase));
- const auto diff = glm::normalize(difference(b2Pos.position, b1Pos.position));
+ const auto diff = glm::normalize(difference(b1Pos.position, b2Pos.position));
get()->body = Location {
.pos = midpoint(b1Pos.position, b2Pos.position), .rot = {vector_pitch(diff), vector_yaw(diff), 0}};
trailBy += 600.F + overhang;