From a929901f2dfb135cbb72036b5e49b4fdb38fe24a Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sat, 18 Jun 2022 10:13:39 +0200 Subject: some stuff --- .../cc/polyfrost/oneconfig/gui/animations/EaseInOutCubic.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutCubic.java') diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutCubic.java b/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutCubic.java index 760f369..1de3346 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutCubic.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInOutCubic.java @@ -12,12 +12,8 @@ public class EaseInOutCubic extends Animation { super(duration, start, end, reverse); } - /** - * Adapted from https://github.com/jesusgollonet/processing-penner-easing - */ @Override - protected float animate(float timePassed, float duration, float start, float change) { - if ((timePassed /= duration / 2) < 1) return change / 2 * timePassed * timePassed * timePassed + start; - return change / 2 * ((timePassed -= 2) * timePassed * timePassed + 2) + start; + protected float animate(float x) { + return x < 0.5 ? 4 * x * x * x : (float) (1 - Math.pow(-2 * x + 2, 3) / 2); } } -- cgit