Example #1
0
 public static Vector3 InterpConstantSpeed(Spline.Path pts, float t, EasingType ease, bool easeIn, bool easeOut)
 {
     t = Spline.Ease(t, ease, easeIn, easeOut);
     if (pts.Length == 0)
     {
         return(Vector3.zero);
     }
     if (pts.Length == 1)
     {
         return(pts[0]);
     }
     if (pts.Length == 2)
     {
         return(Vector3.Lerp(pts[0], pts[1], t));
     }
     if (pts.Length == 3)
     {
         return(QuadBez.Interp(pts[0], pts[2], pts[1], t));
     }
     if (pts.Length == 4)
     {
         return(CubicBez.Interp(pts[0], pts[3], pts[1], pts[2], t));
     }
     return(CRSpline.InterpConstantSpeed(Spline.Wrap(pts), t));
 }
Example #2
0
 private static float Ease(float t, EasingType ease, bool easeIn)
 {
     return(Spline.Ease(t, ease, easeIn, true));
 }
Example #3
0
 private static float Ease(float t)
 {
     return(Spline.Ease(t, EasingType.Linear));
 }