Handles animation logic for a gModel instance, including switching, playback, and timing.
More...
#include <gModelAnimator.h>
|
| | gModelAnimator () |
| |
| | ~gModelAnimator () |
| |
| void | setModel (gModel *model) |
| | Associates a gModel with this animator.
|
| |
| void | addAnimation (int id, int startframe, int endframe, float speed, Mode mode, bool isDefault=false) |
| | Adds a new animation to the animator.
|
| |
| void | addTransition (TriggerType triggerType, int srcAnimation, int dstAnimation) |
| | Adds a transition to another animation.
|
| |
| void | bake () |
| | Finalizes the animator setup. Should be called before use and after the animator is fully configured.
|
| |
| void | setGeneralSpeed (float speed) |
| | Sets a global animation speed multiplier.
|
| |
| void | triggerAnimation (int animationId) |
| | Starts transitioning to a different animation.
|
| |
| void | update () |
| |
Handles animation logic for a gModel instance, including switching, playback, and timing.
Supports multiple animation modes and allows defining transitions between animations.
◆ Mode
Defines playback behavior for animations.
| Enumerator |
|---|
| MODE_HOLD_ON_LAST_FRAME | |
| MODE_ONCE | |
| MODE_REPEAT | |
◆ TriggerType
Defines triggers for transitioning animations.
| Enumerator |
|---|
| TRIGGERTYPE_AFTER_COMPLETION | |
◆ gModelAnimator()
| gModelAnimator::gModelAnimator |
( |
| ) |
|
◆ ~gModelAnimator()
| gModelAnimator::~gModelAnimator |
( |
| ) |
|
◆ addAnimation()
| void gModelAnimator::addAnimation |
( |
int |
id, |
|
|
int |
startframe, |
|
|
int |
endframe, |
|
|
float |
speed, |
|
|
Mode |
mode, |
|
|
bool |
isDefault = false |
|
) |
| |
Adds a new animation to the animator.
- Parameters
-
| id | Unique identifier for the animation. |
| startframe | Starting frame of the animation. |
| endframe | Ending frame of the animation. Cannot be the same as startframe |
| mode | Animation playback mode. |
| isDefault | Whether this animation is the default on bake. |
◆ addTransition()
| void gModelAnimator::addTransition |
( |
TriggerType |
triggerType, |
|
|
int |
srcAnimation, |
|
|
int |
dstAnimation |
|
) |
| |
Adds a transition to another animation.
- Parameters
-
| triggerType | The trigger condition. |
| srcAnimation | Source animation ID. |
| dstAnimation | Destination animation ID. |
◆ bake()
| void gModelAnimator::bake |
( |
| ) |
|
Finalizes the animator setup. Should be called before use and after the animator is fully configured.
◆ setGeneralSpeed()
| void gModelAnimator::setGeneralSpeed |
( |
float |
speed | ) |
|
|
inline |
Sets a global animation speed multiplier.
- Parameters
-
| speed | Playback speed (1.0 = normal). |
◆ setModel()
| void gModelAnimator::setModel |
( |
gModel * |
model | ) |
|
|
inline |
Associates a gModel with this animator.
- Parameters
-
| model | The model to animate. |
◆ triggerAnimation()
| void gModelAnimator::triggerAnimation |
( |
int |
animationId | ) |
|
Starts transitioning to a different animation.
- Parameters
-
| animationId | The animation to play. |
◆ update()
| void gModelAnimator::update |
( |
| ) |
|
The documentation for this class was generated from the following file: