I'm creating a system in which a player character travels along a defined spline path. Here is what I need to do:
- Input an array of Vector3 (XYZ) coordinates.
- Generate spline data from those Vector3s.
- Return a Vector3 for a given relative distance along the spline (0.0 - 1.0)
I'm using a provided library from here which sort of does what I need, but it the resulting spline has a tendency to "slingshot" around control points by slowing down around curves and speeding up in straightaways. It seems like a natural side-effect of spline interpolation.
Unfortunately, my character needs to travel at a constant speed, and I need a way to derive this.
Is there a good library in C# (or C++ which I can convert) that I can use?
Failing that, is there a decent reference on how spline math works from which I can learn?
Thanks!