Merge pull request #1914 from FunkinCrew/fix/smoothlerp-mismatch

Fix type mismatch in smooth lerp functions
This commit is contained in:
Eric
2025-10-27 15:43:35 -04:00
committed by GitHub
+5 -5
View File
@@ -65,13 +65,13 @@ class MathUtil
/**
* Performs a modulo operation to calculate the remainder of `a` divided by `b`.
*
*
* The definition of "remainder" varies by implementation;
* this one is similar to GLSL or Python in that it uses Euclidean division, which always returns positive,
* while Haxe's `%` operator uses signed truncated division.
*
*
* For example, `-5 % 3` returns `-2` while `FlxMath.mod(-5, 3)` returns `1`.
*
*
* @param a The dividend.
* @param b The divisor.
* @return `a mod b`.
@@ -129,7 +129,7 @@ class MathUtil
{
if (deltaTime == 0) return base;
if (base == target) return target;
return lerp(target, base, exp2(-deltaTime / halfLife));
return lerp(base, target, exp2(-deltaTime / halfLife));
}
/**
@@ -154,7 +154,7 @@ class MathUtil
{
if (deltaTime == 0) return base;
if (base == target) return target;
return lerp(target, base, Math.pow(precision, deltaTime / duration));
return lerp(base, target, Math.pow(precision, deltaTime / duration));
}
/**