From af29bd828e1a41a3fd24581cdb5fdd450b7adfbe Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Wed, 10 Jun 2009 20:42:46 +0100 Subject: [PATCH] A first attempt at moving along the curvey bit --- maps/points.xml | 2 +- src/Points.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/maps/points.xml b/maps/points.xml index be1f344..6c85879 100644 --- a/maps/points.xml +++ b/maps/points.xml @@ -2,7 +2,7 @@ No Name - + maps/points.bin diff --git a/src/Points.cpp b/src/Points.cpp index 01607e1..e779eb9 100644 --- a/src/Points.cpp +++ b/src/Points.cpp @@ -170,6 +170,21 @@ void Points::transform(const track::TravelToken& aToken, double aDelta) const if (myAxis == axis::Y || myAxis == -axis::Y) glRotated(-90.0, 0.0, 1.0, 0.0); } + else if (aToken.position == displacedEndpoint()) { + // Curving onto the straight section + debug() << "Section 3"; + + float xTrans, yTrans; + + if ((myAxis == -axis::X && aToken.direction == axis::X)) + xTrans = aDelta - 2.0f; + else + xTrans = aDelta; + + yTrans = -hypTanCurveFunc(aDelta) + 1.0f; + + glTranslatef(myX + xTrans, 0.0f, myY + yTrans); + } else assert(false); -- 2.39.2