public static void GizmoDraw(Vector3[] pts, float t, EasingType ease, bool easeIn, bool easeOut) { Gizmos.color = Color.white; Vector3 to = Spline.Interp(pts, 0f); for (int i = 1; i <= 20; i++) { float t2 = (float)i / 20f; Vector3 vector = Spline.Interp(pts, t2, ease, easeIn, easeOut); Gizmos.DrawLine(vector, to); to = vector; } Gizmos.color = Color.blue; Vector3 vector2 = Spline.Interp(pts, t, ease, easeIn, easeOut); Gizmos.DrawLine(vector2, vector2 + Spline.Velocity(pts, t, ease, easeIn, easeOut)); }
public static Vector3 Interp(Spline.Path pts, float t) { return(Spline.Interp(pts, t, EasingType.Linear)); }
public static Quaternion RotationBetween(Spline.Path pts, float t1, float t2, EasingType ease, bool easeIn, bool easeOut) { return(Quaternion.LookRotation(Spline.Interp(pts, t2, ease, easeIn, easeOut) - Spline.Interp(pts, t1, ease, easeIn, easeOut))); }
public static Vector3 Interp(Spline.Path pts, float t, EasingType ease, bool easeIn) { return(Spline.Interp(pts, t, ease, easeIn, true)); }