From 6984a7e154af32c62a6ea8c2ec47b4464edc2a7f Mon Sep 17 00:00:00 2001 From: topchetoeu <36534413+TopchetoEU@users.noreply.github.com> Date: Sun, 16 Apr 2023 03:51:27 +0300 Subject: [PATCH] fix: update dependencies --- .../keystrokes/engine/Fadeout.java.old | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/main/java/me/topchetoeu/keystrokes/engine/Fadeout.java.old diff --git a/src/main/java/me/topchetoeu/keystrokes/engine/Fadeout.java.old b/src/main/java/me/topchetoeu/keystrokes/engine/Fadeout.java.old deleted file mode 100644 index ea1b477..0000000 --- a/src/main/java/me/topchetoeu/keystrokes/engine/Fadeout.java.old +++ /dev/null @@ -1,39 +0,0 @@ -package me.topchetoeu.keystrokes.engine; - -public class Fadeout { - public float slope; - public float duration; - - private boolean near(float f) { - return near(slope, f); - } - private boolean near(float a, float b) { - return Math.abs(a - b) < 0.001f; - } - - public float calculate(float delta) { - if (delta > duration) return 0; - - if (near(0)) return 1; - if (near(1)) return 1 - delta / duration; - if (near(2)) return 1 - (float)Math.sqrt(delta / duration); - - float pow = 1 / slope; - - if (near(pow, Math.round(pow))) { - float a = delta / duration; - float b = 1; - - for (int i = 0; i < pow; i++) b *= a; - - return 1 - b; - } - - return 1 - (float)Math.pow(delta / duration, pow); - } - - public Fadeout(float slope, float duration) { - this.slope = slope; - this.duration = duration; - } -}