From 3965ae477c72e79fb0021aa8a2f5a70cf7b5c099 Mon Sep 17 00:00:00 2001 From: Vortex2Oblivion <73261680+Vortex2Oblivion@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:48:21 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Vortex2O?= =?UTF-8?q?blivion/LeatherEngine@ddb8e9da44940c13b73d849ff2e222773502f600?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utilities/MathUtil.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/MathUtil.html b/utilities/MathUtil.html index 0ec5eb2c76..6a003c1cf6 100644 --- a/utilities/MathUtil.html +++ b/utilities/MathUtil.html @@ -7,5 +7,5 @@ float: none; text-shadow: 0 0 0 transparent; } -

Utilities for performing mathematical operations.

Static variables

@:value(2.71828182845904523536)staticfinalread onlyE:Float = 2.71828182845904523536

Euler's constant and the base of the natural logarithm. -Math.E is not a constant in Haxe, so we'll just define it ourselves.

Static methods

staticinlinecameraLerp(lerp:Float):Float

Deprecated: "Use smoothLerp instead"

Perform linear interpolation based on the current framerate.

Parameters:

lerp

Value used to interpolate between base and target.

Returns:

The interpolated value.

staticinlinecoolLerp(base:Float, target:Float, ratio:Float):Float

Deprecated: "Use smoothLerp instead"

Perform linear interpolation between the base and the target, based on the current framerate.

Parameters:

base

The starting value, when progress <= 0.

target

The ending value, when progress >= 1.

ratio

Value used to interpolate between base and target.

Returns:

The interpolated value.

@:value({ c : 1.70158 })staticeaseInBack(x:Float, c:Float = 1.70158):Float

@:value({ c : 1.70158 })staticeaseInOutBack(x:Float, c:Float = 1.70158):Float

@:value({ c : 1.70158 })staticeaseOutBack(x:Float, c:Float = 1.70158):Float

staticinlineexp2(x:Float):Float

Get the base-2 logarithm of a value.

Parameters:

x

value

Returns:

2^x

staticinlinelerp(base:Float, target:Float, progress:Float):Float

Linearly interpolate between two values.

Parameters:

base

The starting value, when progress <= 0.

target

The ending value, when progress >= 1.

progress

Value used to interpolate between base and target.

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)

@:value({ precision : 1 / 100 })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.

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:

\ No newline at end of file +

Utilities for performing mathematical operations.

Static variables

@:value(2.71828182845904523536)staticfinalread onlyE:Float = 2.71828182845904523536

Euler's constant and the base of the natural logarithm. +Math.E is not a constant in Haxe, so we'll just define it ourselves.

Static methods

staticinlinecameraLerp(lerp:Float):Float

Deprecated: "Use smoothLerp instead"

Perform linear interpolation based on the current framerate.

Parameters:

lerp

Value used to interpolate between base and target.

Returns:

The interpolated value.

staticinlinecoolLerp(base:Float, target:Float, ratio:Float):Float

Deprecated: "Use smoothLerp instead"

Perform linear interpolation between the base and the target, based on the current framerate.

Parameters:

base

The starting value, when progress <= 0.

target

The ending value, when progress >= 1.

ratio

Value used to interpolate between base and target.

Returns:

The interpolated value.

@:value({ c : 1.70158 })staticeaseInBack(x:Float, c:Float = 1.70158):Float

@:value({ c : 1.70158 })staticeaseInOutBack(x:Float, c:Float = 1.70158):Float

@:value({ c : 1.70158 })staticeaseOutBack(x:Float, c:Float = 1.70158):Float

staticinlineexp2(x:Float):Float

Get the base-2 logarithm of a value.

Parameters:

x

value

Returns:

2^x

staticinlinelerp(base:Float, target:Float, progress:Float):Float

Linearly interpolate between two values.

Parameters:

base

The starting value, when progress <= 0.

target

The ending value, when progress >= 1.

progress

Value used to interpolate between base and target.

Returns:

The interpolated value.

@:value({ minValue : 0.001 })staticlinearToLog(x:Float, minValue:Float = 0.001):Float

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)

@:value({ minValue : 0.001 })staticlogToLinear(x:Float, minValue:Float = 0.001):Float

@:value({ precision : 1 / 100 })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.

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:

\ No newline at end of file