public static Vector3 GetPointOnCubic (Vector3 a, Vector3 b, Vector3 tan1, Vector3 tan2, float t) {
float t2 = t*t, t3 = t2*t;
//float s = (float)t / (float)steps; // scale s to go from 0 to 1
float h1 = 2*t3 - 3*t2 + 1; // calculate basis function 1
float h2 = -2*t3 + 3*t2; // calculate basis function 2
float h3 = t3 - 2*t2 + t; // calculate basis function 3
float h4 = t3 - t2; // calculate basis function 4
return h1*a + // multiply and sum all funtions
h2*b + // together to build the interpolated
h3*tan1 + // point along the curve.
h4*tan2;
//return //(b*(3*t*t-2*t*t*t)+c*(t-2*t*t+t*t*t)+d*(-t*t+t*t*t)+a*(1-3*t*t+2*t*t*t));
//float mt = 1-t;
//return start*mt*mt*mt + (start+startVel)*3*t*mt*mt + 3*mt*t*t*(end-endVel) + t*t*t*end;
//return start*t*t*t + (start+startVel)*t*t + (end-endVel)*t + end;
//return start*t*t*t + start*t*t + startVel*t*t + end*t + endVel*t + end;
}