diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-22 14:31:13 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-22 14:31:13 +0200 |
commit | 89af4c9fe007e0c4d8ed8edae541b9377e12d8d0 (patch) | |
tree | bd8507b25fbcda577fa54596db10ff9878994570 /src/main/java/cc/polyfrost/oneconfig/utils | |
parent | 54c3c18d1ac4347a35f449f77995e16b0740ec16 (diff) | |
download | OneConfig-89af4c9fe007e0c4d8ed8edae541b9377e12d8d0.tar.gz OneConfig-89af4c9fe007e0c4d8ed8edae541b9377e12d8d0.tar.bz2 OneConfig-89af4c9fe007e0c4d8ed8edae541b9377e12d8d0.zip |
OC-19 semi-working shadow
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/utils')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java index a09b398..fcfca02 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java @@ -28,12 +28,20 @@ public class MathUtils { * taken from <a href="https://github.com/jesusgollonet/processing-penner-easing">https://github.com/jesusgollonet/processing-penner-easing</a> */ public static float easeInOutCirc(float t, float b, float c, float d) { - float deltaTime = OneConfigGui.INSTANCE == null ? 16 : OneConfigGui.INSTANCE.getDeltaTime(); - c *= deltaTime; + c *= OneConfigGui.INSTANCE == null ? 16 : OneConfigGui.INSTANCE.getDeltaTime(); if ((t /= d / 2) < 1) return -c / 2 * ((float) Math.sqrt(1 - t * t) - 1) + b; return c / 2 * ((float) Math.sqrt(1 - (t -= 2) * t) + 1) + b; } + /** + * taken from <a href="https://github.com/jesusgollonet/processing-penner-easing">https://github.com/jesusgollonet/processing-penner-easing</a> + */ + public static float easeInOutQuad(float t,float b , float c, float d) { + c *= OneConfigGui.INSTANCE == null ? 16 : OneConfigGui.INSTANCE.getDeltaTime(); + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + } + public static float map(float value, float start1, float stop1, float start2, float stop2) { return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1)); } |