Currently I compute the spline and then use linear interpolation along the 2nd and 3rd control points to determine t.
i.e.
vector3df v2toV3 = v3 - v2;
f32 t = v2toV3.getLength();
v2toV3.normalize();
vector3df v2topos = GetTrans().GetPosition() - v2;
t = Boundval( 0.0f, v2topos.dotProduct( v2toV3 ) / t, 1.0f );
Which I then use to determine the point along the spline and I use that to feed into a pid controller
My problem is the linear interpolation to detemine t. As this value could be slightly behind or ahead of the car's position depending on the curvature of the spline.
What I really need is a way of determining the position along the spline that intersects the shortest line from the car to the line between the two control points.
If any of that makes sense? :-)