class MathUtil
package utilities
Utilities for performing mathematical operations.
Static variables
Static methods
staticinlinecameraLerp(lerp:Float):Float
Perform linear interpolation based on the current framerate.
Parameters:
lerp | Value used to interpolate between |
---|
Returns:
The interpolated value.
staticinlinecoolLerp(base:Float, target:Float, ratio:Float):Float
Perform linear interpolation between the base and the target, based on the current framerate.
Parameters:
base | The starting value, when |
---|---|
target | The ending value, when |
ratio | Value used to interpolate between |
Returns:
The interpolated value.
staticinlinelerp(base:Float, target:Float, progress:Float):Float
Linearly interpolate between two values.
Parameters:
base | The starting value, when |
---|---|
target | The ending value, when |
progress | Value used to interpolate between |
Returns:
The interpolated value.
staticinlinelogBase(base:Float, value:Float):Float
Get the logarithm of a value with a given base.
Parameters:
base | The base of the logarithm. |
---|---|
value | The value to get the logarithm of. |
Returns:
log_base(value)
staticsmoothLerp(current:Float, target:Float, elapsed:Float, duration:Float, precision:Float = 1 / 100):Float
Perform a framerate-independent linear interpolation between the base value and the target.
Parameters:
current | The current value. |
---|---|
target | The target value. |
elapsed | The time elapsed since the last frame. |
duration | The total duration of the interpolation. Nominal duration until remaining distance is less than |
precision | The target precision of the interpolation. Defaults to 1% of distance remaining. |
Returns:
A value between the current value and the target value.
See also: