FlatRedBall_Spriter.SpriterObject.GetPercentageIntoFrame C# (CSharp) Method

GetPercentageIntoFrame() public static method

public static GetPercentageIntoFrame ( float secondsIntoAnimation, float currentKeyFrameTime, float nextKeyFrameTime ) : float
secondsIntoAnimation float
currentKeyFrameTime float
nextKeyFrameTime float
return float
        public static float GetPercentageIntoFrame(float secondsIntoAnimation, float currentKeyFrameTime, float nextKeyFrameTime)
        {
            float retVal = (secondsIntoAnimation - currentKeyFrameTime) / (nextKeyFrameTime - currentKeyFrameTime);
            if (float.IsInfinity(retVal) || float.IsNaN(retVal))
            {
                return 0.0f;
            }
            else
            {
                return retVal;
            }
        }