This commit is contained in:
Moulberry committed 2024-10-05 10:06:06 +08:00
1 parent 63535e6b3d
commit aadd309397
20 files changed
+228 -101

No files matched your search

@@ -7,7 +7,7 @@ import org.joml.Vector3d;
public class Interpolation {
public static double linear(double from, double to, float amount) {
public static double linear(double from, double to, double amount) {
return from + (to - from) * amount;
}
@@ -15,10 +15,14 @@ public class Interpolation {
return from + (to - from) * amount;
}
public static float linearAngle(float from, float to, float amount) {
float delta = Mth.wrapDegrees(to - from);
return from + Math.max(-180, Math.min(180, delta * amount));
}
public static double linearAngle(double from, double to, double amount) {
double delta = Mth.wrapDegrees(to - from);
return from + Math.max(-180, Math.min(180, delta * amount));
}
}