I'm trying to create a class which takes in any number of points (position and control) and creates a catmull-rom spline based on the information given.
What I'm doing - and I'm really unsure if this is the right way to do it - is storing each individual point in a class like so:
class Point
{
public:
Vector3 position;
Vector3 control;
}
Where obviously position is the position of the point and control is the control point.
My issue is connecting up the splines - obviously given the above class holding a point in the spline array indicates that any given position can only have one control point. So when having three or more points in a catmull rom spline the various individual catmull-rom splines which are being connected share one position and one control with another such spline.
Now with position being the same is required - since I want to create splines which are continuous between themselves. However I really wonder, should the control points also be the same between the two splines? With a bit of fiddling of the control points I can make it appear to be transitioning smoothly from one spline to another however I must emphasize that I'm not sure if the way they are transitioning is consistent with how catmull-rom splines form their shape. I'd much rather do it correctly than sit on my hands and rationalize that it's good enough.
Obviously the second part of my question is self explanatory: Given two control and position points how do I calculate the length of a catmull-rom spline?