Ejemplo n.º 1
0
        public static double DeltaAngle(double current, double target)
        {
            double num = Mathd.Repeat(target - current, 360d);

            if (num > 180.0d)
            {
                num -= 360d;
            }
            return(num);
        }
Ejemplo n.º 2
0
        public static double LerpAngle(double a, double b, double t)
        {
            double num = Mathd.Repeat(b - a, 360d);

            if (num > 180.0d)
            {
                num -= 360d;
            }
            return(a + num * Mathd.Clamp01(t));
        }
Ejemplo n.º 3
0
 public static double PingPong(double t, double length)
 {
     t = Mathd.Repeat(t, length * 2d);
     return(length - Mathd.Abs(t - length));
 }