CUGL 2.3
Cornell University Game Library
|
#include <CUEasingFunction.h>
Public Types | |
enum class | Type : int { LINEAR , SINE_IN , SINE_OUT , SINE_IN_OUT , QUAD_IN , QUAD_OUT , QUAD_IN_OUT , CUBIC_IN , CUBIC_OUT , CUBIC_IN_OUT , QUART_IN , QUART_OUT , QUART_IN_OUT , QUINT_IN , QUINT_OUT , QUINT_IN_OUT , EXPO_IN , EXPO_OUT , EXPO_IN_OUT , CIRC_IN , CIRC_OUT , CIRC_IN_OUT , BACK_IN , BACK_OUT , BACK_IN_OUT , BOUNCE_IN , BOUNCE_OUT , BOUNCE_IN_OUT , ELASTIC_IN , ELASTIC_OUT , ELASTIC_IN_OUT } |
Static Public Member Functions | |
static std::function< float(float)> | alloc () |
static std::function< float(float)> | alloc (Type type, float period=ELASTIC_PERIOD) |
static float | linear (float time) |
static float | sineIn (float time) |
static float | sineOut (float time) |
static float | sineInOut (float time) |
static float | quadIn (float time) |
static float | quadOut (float time) |
static float | quadInOut (float time) |
static float | cubicIn (float time) |
static float | cubicOut (float time) |
static float | cubicInOut (float time) |
static float | quartIn (float time) |
static float | quartOut (float time) |
static float | quartInOut (float time) |
static float | quintIn (float time) |
static float | quintOut (float time) |
static float | quintInOut (float time) |
static float | expoIn (float time) |
static float | expoOut (float time) |
static float | expoInOut (float time) |
static float | circIn (float time) |
static float | circOut (float time) |
static float | circInOut (float time) |
static float | backIn (float time) |
static float | backOut (float time) |
static float | backInOut (float time) |
static float | bounceIn (float time) |
static float | bounceOut (float time) |
static float | bounceInOut (float time) |
static float | elasticIn (float time, float period) |
static float | elasticOut (float time, float period) |
static float | elasticInOut (float time, float period) |
This class is a factory for returning easing functions.
An easing function is an interpolation function that (usually) maps [0,1] to [0,1] with f(0) = 0 and f(1) = 1. It is used to control the speed of a tweening operation. If f(t) = t, the result is standard linear interpolation, providing a smooth animation. Nonlinear curves allow the tweening to adjust its speed over time. An easing function can map outside of the range so long as the end points are still fixed. This allows for overshoot and correction in the tweening.
The supported easing functions are all implemented as static methods. The alloc()
method is used to return a function value that can can be used by other functions for tweening support.
|
strong |
This enum lists the easing functions supported by this factory.
|
inlinestatic |
Returns a linear easing function
|
static |
Returns an easing function of the given type.
The optional value period only applies to elastic easing functions, as their bounce factor is adjustable.
type | The easing function type |
period | The period of an elastic easing function |
|
static |
Returns an adjustment of the tweening time
This is an easing function that briefly dips below t=0 after the start.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the backIn(float)
and backOut(float)
easing functions.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is an easing function that briefly rises above t=1 before the finish.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is an easing function that bounces down to t=0 several times after the start.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the bounceIn(float)
and bounceOut(float)
easing functions.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is an easing function that bounces up to t=1 several times before the finish.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a quarter circle with an asymptotic start at t=0.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the circIn(float)
and circOut(float)
easing functions.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a quarter circle with an asymptotic finish at t=1.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a cubic polynomial with an asymptotic start at t=0.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the cubicIn(float)
and cubicOut(float)
easing functions.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a cubic polynomial with an asymptotic finish at t=1.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is an easing function that bounces back-and-forth across t=0 several times after the start.
time | The time in seconds. |
period | The period in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the elasticIn(float,float)
and elasticOut(float,float)
easing functions.
time | The time in seconds. |
period | The period in seconds. |
|
static |
Returns an adjustment of the tweening time
This is an easing function that bounces back-and-forth across t=1 several times before the finish.
time | The time in seconds. |
period | The period in seconds. |
|
static |
Returns an adjustment of the tweening time
This is an exponential function with an asymptotic start at t=0.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the expoIn(float)
and expoOut(float)
easing functions.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is an exponential function with an asymptotic finish at t=1.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a linear easing function (the default)
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a quadratic polynomial with an asymptotic start at t=0.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the quadIn(float)
and quadOut(float)
easing functions.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a quadratic polynomial with an asymptotic finish at t=1.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a fourth-degree polynomial with an asymptotic start at t=0.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the quartIn(float)
and quartOut(float)
easing functions.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a fourth-degree polynomial with an asymptotic finish at t=1.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a fifth-degree polynomial with an asymptotic start at t=0.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the quintIn(float)
and quintOut(float)
easing functions.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a fifth-degree polynomial with an asymptotic finish at t=1.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a linear easing function (the default)
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a concatenation of the sineIn(float)
and sineOut(float)
easing functions.
time | The time in seconds. |
|
static |
Returns an adjustment of the tweening time
This is a sine function with an asymptotic finish at t=1.
time | The time in seconds. |