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; } }