Class InterpolationConstants
Utility methods for interpolating between values.
Namespace: AS2.Visuals.Library
Assembly: .dll
Syntax
public static class InterpolationConstants
Methods
EaseIn(float)
Returns a value from a smooth curve between 0 and 1 that also starts at 0 and ends at 1. If visualized, this movement will appear to accelerate smoothly and end abruptly at its maximum speed.
Declaration
public static float EaseIn(float percentage)
Parameters
| Type | Name | Description |
|---|---|---|
| float | percentage | The percentage of the movement. Should be between 0 and 1. |
Returns
| Type | Description |
|---|---|
| float | The smooth curve value at
|
EaseOut(float)
Returns a value from a smooth curve between 0 and 1 that also starts at 0 and ends at 1. If visualized, this movement will appear to start at its maximum speed and then decelerate smoothly until it comes to a halt at 1.
Declaration
public static float EaseOut(float percentage)
Parameters
| Type | Name | Description |
|---|---|---|
| float | percentage | The percentage of the movement. Should be between 0 and 1. |
Returns
| Type | Description |
|---|---|
| float | The smooth curve value at
|
Lerp(float, float, float)
Linear interpolation between two floats.
Declaration
public static float Lerp(float s1, float s2, float percentage)
Parameters
| Type | Name | Description |
|---|---|---|
| float | s1 | The start value. |
| float | s2 | The end value. |
| float | percentage | The percentage of
the way between |
Returns
| Type | Description |
|---|---|
| float | The float value at |
OneMinus(float)
Returns 1 - percentage.
Declaration
public static float OneMinus(float percentage)
Parameters
| Type | Name | Description |
|---|---|---|
| float | percentage | A float value (usually representing a percentage). |
Returns
| Type | Description |
|---|---|
| float |
|
SmoothLerp(float)
Smoothed interpolation between 0 and 1. If visualized, the movement would appear to start and end in resting positions, accelerating in the first half and decelerating in the second half of the movement.
Declaration
public static float SmoothLerp(float percentage)
Parameters
| Type | Name | Description |
|---|---|---|
| float | percentage | The percentage of the way between 0 and 1. |
Returns
| Type | Description |
|---|---|
| float | A smoothly interpolated value at position
|