1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-08-19 15:05:06 +00:00

Merge pull request #332 from FunkinCrew/bugfix/smoothLerp-typo

Fix variable name in `MathUtils.smoothLerp`
This commit is contained in:
Cameron Taylor 2024-02-17 03:42:44 -05:00 committed by GitHub
commit efd4ae4592

View file

@ -5,13 +5,11 @@ package funkin.util;
*/ */
class MathUtil class MathUtil
{ {
public static var E(get, never):Float; /**
* Euler's constant and the base of the natural logarithm.
static function get_E():Float * Math.E is not a constant in Haxe, so we'll just define it ourselves.
{ */
// Math.E is not a constant in Haxe, so we'll just define it ourselves. public static final E:Float = 2.71828182845904523536;
return 2.71828182845904523536; // Approximation.
}
/** /**
* Perform linear interpolation between the base and the target, based on the current framerate. * Perform linear interpolation between the base and the target, based on the current framerate.
@ -70,6 +68,6 @@ class MathUtil
// var halfLife:Float = -duration / logBase(2, precision); // var halfLife:Float = -duration / logBase(2, precision);
// lerp(current, target, 1 - exp2(-elapsed / halfLife)); // lerp(current, target, 1 - exp2(-elapsed / halfLife));
return lerp(current, target, 1 - Math.pow(p, elapsed / duration)); return lerp(current, target, 1 - Math.pow(precision, elapsed / duration));
} }
} }