Created
September 22, 2011 19:15
-
-
Save peppy/1235731 to your computer and use it in GitHub Desktop.
osu! easing functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//used for easing = 1 | |
internal static float easeInVal(float currTime, float start, float end, float duration) | |
{ | |
return duration == 0 ? start : MathHelper.Lerp(end, start, (float) Math.Pow(1 - currTime/duration, 2)); | |
} | |
//used for easing = 2 | |
internal static float easeOutVal(float currTime, float start, float end, float duration) | |
{ | |
return duration == 0 ? start : MathHelper.Lerp(start, end, (float) Math.Pow(currTime/duration, 2)); | |
} | |
//used for easing = 0 | |
internal static float easeNoneVal(float currTime, float start, float end, int duration) | |
{ | |
return duration == 0 ? start : MathHelper.Lerp(start, end, currTime/duration); | |
} | |
// (yes i'm aware the function names are back-to-front >_>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment