From 43476681748a14797409dbaf8e950613385a233f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 14 Feb 2021 14:04:16 +0000 Subject: Fix vertical offset of curved rails --- game/network/rail.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/network/rail.cpp b/game/network/rail.cpp index 7c045ad..3b31204 100644 --- a/game/network/rail.cpp +++ b/game/network/rail.cpp @@ -125,7 +125,7 @@ RailLinkCurve::RailLinkCurve(const NodePtr & a, const NodePtr & b, glm::vec3 c, int segCount = segs; vertices.reserve((segCount + 1) * railCrossSection.size()); indices.reserve(segCount * 2 * railCrossSection.size()); - for (glm::vec3 swing = {arc.second, -e1p.y, 0.F}; segCount >= 0; swing += step, --segCount) { + for (glm::vec3 swing = {arc.second, e1p.y - centreBase.y, 0.F}; segCount >= 0; swing += step, --segCount) { const auto t {trans * glm::rotate(half_pi - swing.x, up) * glm::translate(glm::vec3 {radius, swing.y, 0.F})}; for (const auto & rcs : railCrossSection) { const glm::vec3 m {(t * glm::vec4 {rcs.first, 1})}; -- cgit v1.2.3