Esempio n. 1
0
        // Rotates degree to targetDegree (between 0 and 360), taking the shortest distance. Lerp argument is amount to rotate by.
        // Note: Lerp of 0.5 may be good place to start.
        public static FInt RotateTo(FInt degree, FInt targetDegree, FInt lerp)
        {
            FInt diff = targetDegree - degree + 360;

            // Return Target Degree if it's been matched.
            if (FInt.Abs(diff) <= lerp)
            {
                return(targetDegree);
            }

            // Otherwise, return next step:
            if (diff > 0)
            {
                degree += lerp;
            }
            else
            {
                degree -= lerp;
            }

            return(FPDegrees.Normalize(degree));
        }
Esempio n. 2
0
 public static FInt GetYFromRotation(FInt degrees, FInt distance)
 {
     return(FPRadians.GetYFromRotation(FPDegrees.ConvertToRadians(degrees), distance));
 }
Esempio n. 3
0
 // Reverse the angle
 public static FInt Reverse(FInt degrees)
 {
     return(FPDegrees.Normalize(degrees + 180));
 }