|
Gama C Library
Gama C API Documentation
|
Provides utility functions for animating numerical values using various easing effects. More...
Go to the source code of this file.
Functions | |
| void | gm_anim_spring (double *value, double target, double t) |
| Animates a value towards a target with a smooth, ease-out effect. | |
| void | gm_anim_ease_out_quad (double *value, const double target, double t) |
| Animates a value towards a target with a quadratic ease-out effect. | |
| void | gm_anim_ease_out_cubic (double *value, double target, double t) |
| Animates a value towards a target with a cubic ease-out effect. | |
| void | gm_anim_ease_in_quad (double *value, double target, double t) |
| Animates a value towards a target with a quadratic ease-in effect. | |
Provides utility functions for animating numerical values using various easing effects.
This file contains a collection of inline functions designed to smoothly transition a double value towards a target value over time, using different animation curves (easing functions). These are commonly used for UI transitions, movement, and other visual effects.
General notes on animation functions:
| void gm_anim_ease_in_quad | ( | double * | value, |
| double | target, | ||
| double | t ) |
Animates a value towards a target with a quadratic ease-in effect.
The animation starts slow and accelerates quadratically as it approaches the target.
| value | A pointer to the double value to animate. |
| target | The target value to animate towards. |
| t | The animation's approximate duration (time constant). |
| void gm_anim_ease_out_cubic | ( | double * | value, |
| double | target, | ||
| double | t ) |
Animates a value towards a target with a cubic ease-out effect.
The animation starts very fast and decelerates cubically as it approaches the target, providing a more pronounced ease-out than gm_anim_ease_out_quad.
| value | A pointer to the double value to animate. |
| target | The target value to animate towards. |
| t | The animation's approximate duration (time constant). |
| void gm_anim_ease_out_quad | ( | double * | value, |
| const double | target, | ||
| double | t ) |
Animates a value towards a target with a quadratic ease-out effect.
The animation starts fast and decelerates quadratically as it approaches the target.
| value | A pointer to the double value to animate. |
| target | The target value to animate towards. |
| t | The animation's approximate duration (time constant). |
| void gm_anim_spring | ( | double * | value, |
| double | target, | ||
| double | t ) |
Animates a value towards a target with a smooth, ease-out effect.
This function creates a spring-like motion that quickly moves towards the target and then gradually settles. The t parameter controls the speed and "stiffness" of the spring.
| value | A pointer to the double value to animate. This value is updated in place. |
| target | The target value to animate towards. |
| t | The animation's approximate duration (time constant). A smaller 't' results in a faster, more immediate animation. |