diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-27 21:31:59 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-27 21:31:59 +0700 |
commit | ab2dd02145d5f89455a74605dd953888761d0ddb (patch) | |
tree | d8a9e909798a9bf84e876319c1fdea758d9c5963 /src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java | |
parent | 2de9cec78992b9589c13ca24b911a1d8ce381c75 (diff) | |
download | OneConfig-ab2dd02145d5f89455a74605dd953888761d0ddb.tar.gz OneConfig-ab2dd02145d5f89455a74605dd953888761d0ddb.tar.bz2 OneConfig-ab2dd02145d5f89455a74605dd953888761d0ddb.zip |
javadoc a lot of stuff + reorganize
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java index fcfca02..19d399f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/MathUtils.java @@ -2,7 +2,7 @@ package cc.polyfrost.oneconfig.utils; import cc.polyfrost.oneconfig.gui.OneConfigGui; -public class MathUtils { +public final class MathUtils { public static float clamp(float number) { return number < 0f ? 0f : Math.min(number, 1f); } @@ -36,10 +36,10 @@ 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 easeInOutQuad(float t,float b , float c, float d) { + 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; + 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) { |