From 1614bd8c5773567b6dcd5a9e44bce41b27c01973 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 28 Mar 2010 09:23:07 +0100 Subject: [PATCH] Correct placement of S-bend sleepers --- include/BezierCurve.hpp | 2 +- src/Points.cpp | 2 +- src/SBend.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/BezierCurve.hpp b/include/BezierCurve.hpp index 3f1ac70..4f64f67 100644 --- a/include/BezierCurve.hpp +++ b/include/BezierCurve.hpp @@ -107,7 +107,7 @@ struct BezierCurve { ); } - // Value of the function at a constant radius in the Z-plane + // Value of the function at a constant radius in the XZ-plane Vector offset(T t, T p) const { Vector v = (*this)(t); diff --git a/src/Points.cpp b/src/Points.cpp index 3623967..137ce10 100644 --- a/src/Points.cpp +++ b/src/Points.cpp @@ -210,7 +210,7 @@ void Points::render() const Vector v = (reflected ? myReflectedCurve : myCurve)(i); - glTranslatef(v.x - 0.4f, 0.0f, v.z); + glTranslatef(v.x - 0.5f, 0.0f, v.z); const Vector deriv = (reflected ? myReflectedCurve : myCurve).deriv(i); diff --git a/src/SBend.cpp b/src/SBend.cpp index f977619..c12e956 100644 --- a/src/SBend.cpp +++ b/src/SBend.cpp @@ -113,12 +113,12 @@ void SBend::render() const glPopMatrix(); - for (float i = 0.1f; i < curve.length; i += 0.25f) { + for (float i = 0.2f; i < curve.length; i += 0.25f) { glPushMatrix(); Vector v = curve(i / curve.length); - glTranslatef(v.x - 0.4f, 0.0f, v.z); + glTranslatef(v.x - 0.5f, 0.0f, v.z); const Vector deriv = curve.deriv(i / curve.length); const float angle = -- 2.39.2