Table of Contents

Class EasingFunctionExtensions

Namespace
Stride.CommunityToolkit.Mathematics
Assembly
Stride.CommunityToolkit.dll

The fluent face of Easing: evaluate or interpolate straight from an EasingFunction value, so a curve held in a field or a setting reads as curve.Interpolate(from, to, t).

public static class EasingFunctionExtensions
Inheritance
EasingFunctionExtensions

Remarks

Every method forwards to Ease<T>(T, EasingFunction) or to the matching MathUtilEx overload, so the time is clamped to [0, 1] the same way there.

Methods

Ease<T>(EasingFunction, T)

Evaluates the curve at a normalised time, clamped to [0, 1].

public static T Ease<T>(this EasingFunction function, T amount) where T : IFloatingPointIeee754<T>

Parameters

function EasingFunction

The curve.

amount T

The normalised time.

Returns

T

The eased progress.

Type Parameters

T

A floating-point type.

Interpolate(EasingFunction, Color, Color, float)

Interpolates between two colours along the curve, channel by channel.

public static Color Interpolate(this EasingFunction function, Color start, Color end, float amount)

Parameters

function EasingFunction

The curve.

start Color

The colour at time 0.

end Color

The colour at time 1.

amount float

The normalised time, clamped to [0, 1].

Returns

Color

The interpolated colour.

Interpolate(EasingFunction, Vector2, Vector2, float)

Interpolates between two points along the curve.

public static Vector2 Interpolate(this EasingFunction function, Vector2 start, Vector2 end, float amount)

Parameters

function EasingFunction

The curve.

start Vector2

The point at time 0.

end Vector2

The point at time 1.

amount float

The normalised time, clamped to [0, 1].

Returns

Vector2

The interpolated point.

Interpolate(EasingFunction, Vector3, Vector3, float)

Interpolates between two points along the curve.

public static Vector3 Interpolate(this EasingFunction function, Vector3 start, Vector3 end, float amount)

Parameters

function EasingFunction

The curve.

start Vector3

The point at time 0.

end Vector3

The point at time 1.

amount float

The normalised time, clamped to [0, 1].

Returns

Vector3

The interpolated point.

Interpolate(EasingFunction, Vector4, Vector4, float)

Interpolates between two vectors along the curve.

public static Vector4 Interpolate(this EasingFunction function, Vector4 start, Vector4 end, float amount)

Parameters

function EasingFunction

The curve.

start Vector4

The vector at time 0.

end Vector4

The vector at time 1.

amount float

The normalised time, clamped to [0, 1].

Returns

Vector4

The interpolated vector.

Interpolate(EasingFunction, float, float, float)

Interpolates between two values along the curve.

public static float Interpolate(this EasingFunction function, float start, float end, float amount)

Parameters

function EasingFunction

The curve.

start float

The value at time 0.

end float

The value at time 1.

amount float

The normalised time, clamped to [0, 1].

Returns

float

The interpolated value.