From 89af4c9fe007e0c4d8ed8edae541b9377e12d8d0 Mon Sep 17 00:00:00 2001
From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>
Date: Sun, 22 May 2022 14:31:13 +0200
Subject: OC-19 semi-working shadow
---
src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
(limited to 'src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java')
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 https://github.com/jesusgollonet/processing-penner-easing
*/
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 https://github.com/jesusgollonet/processing-penner-easing
+ */
+ 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));
}
--
cgit