From b72b3dca39631a995b422e0b3495e8d3618e91d8 Mon Sep 17 00:00:00 2001
From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>
Date: Wed, 1 Jun 2022 18:40:47 +0200
Subject: temp
---
.../java/cc/polyfrost/oneconfig/utils/MathUtils.java | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
(limited to 'src/main/java/cc/polyfrost/oneconfig/utils')
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java
index 79634da..c4beb82 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java
@@ -25,21 +25,11 @@ public final class MathUtils {
}
/**
- * taken from https://github.com/jesusgollonet/processing-penner-easing
+ * Adapted from https://github.com/jesusgollonet/processing-penner-easing
*/
- public static float easeInOutCirc(float t, float b, float c, float d) {
- 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 easeInOutCirc(float time, float beginning, float change, float duration) {
+ if ((time /= duration / 2) < 1) return -change / 2 * ((float) Math.sqrt(1 - time * time) - 1) + beginning;
+ return change / 2 * ((float) Math.sqrt(1 - (time -= 2) * time) + 1) + beginning;
}
public static float map(float value, float start1, float stop1, float start2, float stop2) {
--
cgit