easing.h file
Easing helper functions.
Public names are vm_*.
The unsuffixed names are deprecated wrappers from the 0.5 release and on and will be remove down the 0.5 line.
Functions
-
auto vm_elastic_oscillation(vm_
float_ t f, vm_ float_ t exp_mult, vm_ float_ t sin_mult, vm_ float_ t sin_offset, vm_ float_ t period) -> vm_ float_ t - Damped sine used by the elastic easing curves.
- VM_DEPRECATED("use vm_elastic_oscillation") vm_float_t elastic_oscillation(vm_float_t f
- Deprecated.
-
auto vm_poly_ease_in(vm_
float_ t f, vm_ float_ t n) -> vm_ float_ t - Polynomial ease-in:
f^n. - VM_DEPRECATED("use vm_poly_ease_in") vm_float_t poly_ease_in(vm_float_t f
- Deprecated.
-
auto vm_poly_ease_out(vm_
float_ t f, vm_ float_ t n) -> vm_ float_ t - Polynomial ease-out:
1 - (1-f)^n. - VM_DEPRECATED("use vm_poly_ease_out") vm_float_t poly_ease_out(vm_float_t f
- Deprecated.
-
auto vm_poly_ease_in_out(vm_
float_ t f, vm_ float_ t n) -> vm_ float_ t - Polynomial ease-in-out of degree
n. - VM_DEPRECATED("use vm_poly_ease_in_out") vm_float_t poly_ease_in_out(vm_float_t f
- Deprecated.
-
auto vm_quadratic_ease_out(vm_
float_ t f) -> vm_ float_ t - Quadratic ease-out.
- VM_DEPRECATED("use vm_quadratic_ease_out")
- Deprecated.
-
auto vm_quadratic_ease_in(vm_
float_ t f) -> vm_ float_ t - Quadratic ease-in.
- VM_DEPRECATED("use vm_quadratic_ease_in")
- Deprecated.
-
auto vm_quadratic_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Quadratic ease-in-out.
- VM_DEPRECATED("use vm_quadratic_ease_in_out")
- Deprecated.
-
auto vm_cubic_ease_out(vm_
float_ t f) -> vm_ float_ t - Cubic ease-out.
- VM_DEPRECATED("use vm_cubic_ease_out")
- Deprecated.
-
auto vm_cubic_ease_in(vm_
float_ t f) -> vm_ float_ t - Cubic ease-in.
- VM_DEPRECATED("use vm_cubic_ease_in")
- Deprecated.
-
auto vm_cubic_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Cubic ease-in-out.
- VM_DEPRECATED("use vm_cubic_ease_in_out")
- Deprecated.
-
auto vm_quartic_ease_out(vm_
float_ t f) -> vm_ float_ t - Quartic ease-out.
- VM_DEPRECATED("use vm_quartic_ease_out")
- Deprecated.
-
auto vm_quartic_ease_in(vm_
float_ t f) -> vm_ float_ t - Quartic ease-in.
- VM_DEPRECATED("use vm_quartic_ease_in")
- Deprecated.
-
auto vm_quartic_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Quartic ease-in-out.
- VM_DEPRECATED("use vm_quartic_ease_in_out")
- Deprecated.
-
auto vm_quintic_ease_out(vm_
float_ t f) -> vm_ float_ t - Quintic ease-out.
- VM_DEPRECATED("use vm_quintic_ease_out")
- Deprecated.
-
auto vm_quintic_ease_in(vm_
float_ t f) -> vm_ float_ t - Quintic ease-in.
- VM_DEPRECATED("use vm_quintic_ease_in")
- Deprecated.
-
auto vm_quintic_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Quintic ease-in-out.
- VM_DEPRECATED("use vm_quintic_ease_in_out")
- Deprecated.
-
auto vm_sine_ease_out(vm_
float_ t f) -> vm_ float_ t - Sinusoidal ease-out.
- VM_DEPRECATED("use vm_sine_ease_out")
- Deprecated.
-
auto vm_sine_ease_in(vm_
float_ t f) -> vm_ float_ t - Sinusoidal ease-in.
- VM_DEPRECATED("use vm_sine_ease_in")
- Deprecated.
-
auto vm_sine_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Sinusoidal ease-in-out.
- VM_DEPRECATED("use vm_sine_ease_in_out")
- Deprecated.
-
auto vm_circular_ease_out(vm_
float_ t f) -> vm_ float_ t - Circular ease-out.
- VM_DEPRECATED("use vm_circular_ease_out")
- Deprecated.
-
auto vm_circular_ease_in(vm_
float_ t f) -> vm_ float_ t - Circular ease-in.
- VM_DEPRECATED("use vm_circular_ease_in")
- Deprecated.
-
auto vm_circular_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Circular ease-in-out.
- VM_DEPRECATED("use vm_circular_ease_in_out")
- Deprecated.
-
auto vm_exponential_ease_out(vm_
float_ t f) -> vm_ float_ t - Exponential ease-out.
- VM_DEPRECATED("use vm_exponential_ease_out")
- Deprecated.
-
auto vm_exponential_ease_in(vm_
float_ t f) -> vm_ float_ t - Exponential ease-in.
- VM_DEPRECATED("use vm_exponential_ease_in")
- Deprecated.
-
auto vm_exponential_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Exponential ease-in-out.
- VM_DEPRECATED("use vm_exponential_ease_in_out")
- Deprecated.
-
auto vm_elastic_ease_out(vm_
float_ t f) -> vm_ float_ t - Elastic ease-out.
- VM_DEPRECATED("use vm_elastic_ease_out")
- Deprecated.
-
auto vm_elastic_ease_in(vm_
float_ t f) -> vm_ float_ t - Elastic ease-in.
- VM_DEPRECATED("use vm_elastic_ease_in")
- Deprecated.
-
auto vm_elastic_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Elastic ease-in-out.
- VM_DEPRECATED("use vm_elastic_ease_in_out")
- Deprecated.
-
auto vm_back_ease_out(vm_
float_ t f) -> vm_ float_ t - Overshooting "back" ease-out.
- VM_DEPRECATED("use vm_back_ease_out")
- Deprecated.
-
auto vm_back_ease_in(vm_
float_ t f) -> vm_ float_ t - Overshooting "back" ease-in.
- VM_DEPRECATED("use vm_back_ease_in")
- Deprecated.
-
auto vm_back_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Overshooting "back" ease-in-out.
- VM_DEPRECATED("use vm_back_ease_in_out")
- Deprecated.
-
auto vm_bounce_ease_out(vm_
float_ t f) -> vm_ float_ t - Bounce ease-out.
- VM_DEPRECATED("use vm_bounce_ease_out")
- Deprecated.
-
auto vm_bounce_ease_in(vm_
float_ t f) -> vm_ float_ t - Bounce ease-in.
- VM_DEPRECATED("use vm_bounce_ease_in")
- Deprecated.
-
auto vm_bounce_ease_in_out(vm_
float_ t f) -> vm_ float_ t - Bounce ease-in-out.
- VM_DEPRECATED("use vm_bounce_ease_in_out")
- Deprecated.
-
auto vm_smoothstep(vm_
float_ t edge0, vm_ float_ t edge1, vm_ float_ t x) -> vm_ float_ t - Smooth Hermite interpolation (cubic).
- VM_DEPRECATED("use vm_smoothstep") vm_float_t smoothstep(vm_float_t edge0
- Deprecated.
-
auto vm_smootherstep(vm_
float_ t edge0, vm_ float_ t edge1, vm_ float_ t x) -> vm_ float_ t - Smoother Hermite interpolation (quintic).
- VM_DEPRECATED("use vm_smootherstep") vm_float_t smootherstep(vm_float_t edge0
- Deprecated.
Variables
Function documentation
vm_ float_ t vm_elastic_oscillation(vm_ float_ t f,
vm_ float_ t exp_mult,
vm_ float_ t sin_mult,
vm_ float_ t sin_offset,
vm_ float_ t period)
Damped sine used by the elastic easing curves.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| exp_mult | |
| sin_mult | |
| sin_offset | |
| period | |
| Returns | Combined exponential-sine value. |
VM_DEPRECATED("use vm_elastic_oscillation") vm_float_t elastic_oscillation(vm_float_t f
Deprecated.
vm_ float_ t vm_poly_ease_in(vm_ float_ t f,
vm_ float_ t n)
Polynomial ease-in: f^n.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| n | |
| Returns | Eased value. |
VM_DEPRECATED("use vm_poly_ease_in") vm_float_t poly_ease_in(vm_float_t f
Deprecated.
Use vm_.
vm_ float_ t vm_poly_ease_out(vm_ float_ t f,
vm_ float_ t n)
Polynomial ease-out: 1 - (1-f)^n.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| n | |
| Returns | Eased value. |
VM_DEPRECATED("use vm_poly_ease_out") vm_float_t poly_ease_out(vm_float_t f
Deprecated.
Use vm_.
vm_ float_ t vm_poly_ease_in_out(vm_ float_ t f,
vm_ float_ t n)
Polynomial ease-in-out of degree n.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| n | |
| Returns | Eased value. |
VM_DEPRECATED("use vm_poly_ease_in_out") vm_float_t poly_ease_in_out(vm_float_t f
Deprecated.
Use vm_.
vm_ float_ t vm_quadratic_ease_out(vm_ float_ t f)
Quadratic ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_quadratic_ease_in(vm_ float_ t f)
Quadratic ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_quadratic_ease_in_out(vm_ float_ t f)
Quadratic ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_cubic_ease_out(vm_ float_ t f)
Cubic ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_cubic_ease_in(vm_ float_ t f)
Cubic ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_cubic_ease_in_out(vm_ float_ t f)
Cubic ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_quartic_ease_out(vm_ float_ t f)
Quartic ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_quartic_ease_in(vm_ float_ t f)
Quartic ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_quartic_ease_in_out(vm_ float_ t f)
Quartic ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_quintic_ease_out(vm_ float_ t f)
Quintic ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_quintic_ease_in(vm_ float_ t f)
Quintic ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_quintic_ease_in_out(vm_ float_ t f)
Quintic ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_sine_ease_out(vm_ float_ t f)
Sinusoidal ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_sine_ease_in(vm_ float_ t f)
Sinusoidal ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_sine_ease_in_out(vm_ float_ t f)
Sinusoidal ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_circular_ease_out(vm_ float_ t f)
Circular ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_circular_ease_in(vm_ float_ t f)
Circular ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_circular_ease_in_out(vm_ float_ t f)
Circular ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_exponential_ease_out(vm_ float_ t f)
Exponential ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_exponential_ease_in(vm_ float_ t f)
Exponential ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_exponential_ease_in_out(vm_ float_ t f)
Exponential ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_elastic_ease_out(vm_ float_ t f)
Elastic ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_elastic_ease_in(vm_ float_ t f)
Elastic ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_elastic_ease_in_out(vm_ float_ t f)
Elastic ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_back_ease_out(vm_ float_ t f)
Overshooting "back" ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_back_ease_in(vm_ float_ t f)
Overshooting "back" ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_back_ease_in_out(vm_ float_ t f)
Overshooting "back" ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_bounce_ease_out(vm_ float_ t f)
Bounce ease-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_bounce_ease_in(vm_ float_ t f)
Bounce ease-in.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_bounce_ease_in_out(vm_ float_ t f)
Bounce ease-in-out.
| Parameters | |
|---|---|
| f | Normalized time in [0, 1]. |
| Returns | Eased value. |
vm_ float_ t vm_smoothstep(vm_ float_ t edge0,
vm_ float_ t edge1,
vm_ float_ t x)
Smooth Hermite interpolation (cubic).
| Parameters | |
|---|---|
| edge0 | Lower edge. |
| edge1 | |
| x | |
| Returns | Interpolated value in [0, 1]. |
Returns 0 when x <= edge0, 1 when x >= edge1, and the cubic Hermite polynomial 3t^2 - 2t^3 in between, where t is the clamped normalized position. Matches GLSL / HLSL smoothstep. First derivative is zero at both edges.
Returns 0 when x <= edge0, 1 when x >= edge1, and the cubic Hermite polynomial 3t^2 - 2t^3 in between. First derivative is zero at both edges.
VM_DEPRECATED("use vm_smoothstep") vm_float_t smoothstep(vm_float_t edge0
Deprecated.
Use vm_.
vm_ float_ t vm_smootherstep(vm_ float_ t edge0,
vm_ float_ t edge1,
vm_ float_ t x)
Smoother Hermite interpolation (quintic).
| Parameters | |
|---|---|
| edge0 | Lower edge. |
| edge1 | |
| x | |
| Returns | Interpolated value in [0, 1]. |
Returns 0 when x <= edge0, 1 when x >= edge1, and the quintic Hermite polynomial 6t^5 - 15t^4 + 10t^3 in between. First and second derivatives are zero at both edges (Perlin's improved fade). Preferred for noise and bump mapping.
Returns 0 when x <= edge0, 1 when x >= edge1, and the quintic Hermite polynomial 6t^5 - 15t^4 + 10t^3 in between. First and second derivatives are zero at both edges.
VM_DEPRECATED("use vm_smootherstep") vm_float_t smootherstep(vm_float_t edge0
Deprecated.
Use vm_.