From f7d77b5a2d0de31673890178c460548d4100c793 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 10 Apr 2011 21:13:20 +0100 Subject: [PATCH] Give BezierCurve::uniform a better name --- include/BezierCurve.hpp | 2 +- src/GenTrack.cpp | 4 ++-- src/Points.cpp | 4 ++-- src/SlopeTrack.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/BezierCurve.hpp b/include/BezierCurve.hpp index 9025fc1..85e98a4 100644 --- a/include/BezierCurve.hpp +++ b/include/BezierCurve.hpp @@ -83,7 +83,7 @@ struct BezierCurve { // A slower approximation to the curve function that guarantees // a linear relationship between s and the arc length - Vector uniform(T s, T *out = NULL) const + Vector linear(T s, T *out = NULL) const { Vector cur = operator()(0.0), prev; diff --git a/src/GenTrack.cpp b/src/GenTrack.cpp index 174202b..cb61673 100644 --- a/src/GenTrack.cpp +++ b/src/GenTrack.cpp @@ -167,7 +167,7 @@ void GenTrack::merge(IMeshBufferPtr buf) const float pos = (sleeper_sep / 2) + i * (sleeper_sep + delta); float u_curve_delta; - Vector v = curve.uniform(pos / curve.length, &u_curve_delta); + Vector v = curve.linear(pos / curve.length, &u_curve_delta); const Vector deriv = curve.deriv(u_curve_delta); const float angle = @@ -367,7 +367,7 @@ void GenTrack::transform(const track::TravelToken& token, (backwards ? curve.length - delta : delta) / curve.length; float u_curve_delta; - Vector curve_value = curve.uniform(curve_delta, &u_curve_delta); + Vector curve_value = curve.linear(curve_delta, &u_curve_delta); glTranslatef( static_cast(origin.x) + curve_value.x, diff --git a/src/Points.cpp b/src/Points.cpp index 189b713..812cfdb 100644 --- a/src/Points.cpp +++ b/src/Points.cpp @@ -219,7 +219,7 @@ void Points::merge(IMeshBufferPtr buf) const for (float i = 0.25f; i < 1.0f; i += 0.08f) { float u_i; const BezierCurve& c = reflected ? my_reflected_curve : my_curve; - const VectorF v = c.uniform(i, &u_i); + const VectorF v = c.linear(i, &u_i); const VectorF t = make_vector(v.x - 0.5f, 0.0f, v.z); const VectorF soff = off + rotateY(t, y_angle); @@ -357,7 +357,7 @@ void Points::transform(const track::TravelToken& a_token, float delta) const const float f_value = backwards ? 1.0f - curve_delta : curve_delta; float u_f_value; - const VectorF curve_value = my_curve.uniform(f_value, &u_f_value); + const VectorF curve_value = my_curve.linear(f_value, &u_f_value); // Calculate the angle that the tangent to the curve at this // point makes to (one of) the axis at this point diff --git a/src/SlopeTrack.cpp b/src/SlopeTrack.cpp index 3c3597c..4e66d61 100644 --- a/src/SlopeTrack.cpp +++ b/src/SlopeTrack.cpp @@ -123,7 +123,7 @@ void SlopeTrack::merge(IMeshBufferPtr buf) const // Draw the sleepers for (float t = 0.1f; t < 1.0f; t += 0.25f) { float u_curve_value; - const Vector curve_value = curve.uniform(t, &u_curve_value); + const Vector curve_value = curve.linear(t, &u_curve_value); #if 0 // Should the sleepers be at the same angle as the slope? @@ -231,7 +231,7 @@ void SlopeTrack::transform(const track::TravelToken& token, float delta) const const float curve_delta = delta / length; float u_curve_delta; - const Vector curve_value = curve.uniform(curve_delta, &u_curve_delta); + const Vector curve_value = curve.linear(curve_delta, &u_curve_delta); const float x_trans = axis == axis::X ? curve_value.x : 0.0f; const float y_trans =curve_value.y; -- 2.39.2