1
0
Fork 0

Consistent ordering of Easing functions in C#

This commit is contained in:
ivan tkachenko 2025-12-06 23:25:55 +02:00
parent a74bbfaee2
commit 8a24448cb6
1 changed files with 1 additions and 1 deletions

View File

@ -992,8 +992,8 @@ namespace MuzikaGromche
public readonly record struct Easing(string Name, Func<float, float> Eval) public readonly record struct Easing(string Name, Func<float, float> Eval)
{ {
public static Easing Linear = new("Linear", static x => x); public static Easing Linear = new("Linear", static x => x);
public static Easing OutCubic = new("OutCubic", static x => 1 - Mathf.Pow(1f - x, 3f));
public static Easing InCubic = new("InCubic", static x => x * x * x); public static Easing InCubic = new("InCubic", static x => x * x * x);
public static Easing OutCubic = new("OutCubic", static x => 1 - Mathf.Pow(1f - x, 3f));
public static Easing InOutCubic = new("InOutCubic", static x => x < 0.5f ? 4f * x * x * x : 1 - Mathf.Pow(-2f * x + 2f, 3f) / 2f); public static Easing InOutCubic = new("InOutCubic", static x => x < 0.5f ? 4f * x * x * x : 1 - Mathf.Pow(-2f * x + 2f, 3f) / 2f);
public static Easing InExpo = new("InExpo", static x => x == 0f ? 0f : Mathf.Pow(2f, 10f * x - 10f)); public static Easing InExpo = new("InExpo", static x => x == 0f ? 0f : Mathf.Pow(2f, 10f * x - 10f));
public static Easing OutExpo = new("OutExpo", static x => x == 1f ? 1f : 1f - Mathf.Pow(2f, -10f * x)); public static Easing OutExpo = new("OutExpo", static x => x == 1f ? 1f : 1f - Mathf.Pow(2f, -10f * x));