5#ifndef GRAPHICS_GMODELANIMATOR_H
6#define GRAPHICS_GMODELANIMATOR_H
55 void addAnimation(
int id,
int startframe,
int endframe,
float speed,
Mode mode,
bool isDefault =
false);
88 struct TransitionData {
91 struct AnimationData {
97 std::unordered_map<TriggerType, TransitionData> transitions;
102 std::unordered_map<int, AnimationData> animations;
103 int defaultanimation = 0;
106 int currentanimation;
108 float nextframetime = 0;
110 float currentanimationposition = 0.0f;
113 void prepareAnimation(
int animationId);
Handles animation logic for a gModel instance, including switching, playback, and timing.
Definition gModelAnimator.h:16
void addAnimation(int id, int startframe, int endframe, float speed, Mode mode, bool isDefault=false)
Adds a new animation to the animator.
void setGeneralSpeed(float speed)
Sets a global animation speed multiplier.
Definition gModelAnimator.h:74
void bake()
Finalizes the animator setup. Should be called before use and after the animator is fully configured.
void addTransition(TriggerType triggerType, int srcAnimation, int dstAnimation)
Adds a transition to another animation.
void setModel(gModel *model)
Associates a gModel with this animator.
Definition gModelAnimator.h:43
void triggerAnimation(int animationId)
Starts transitioning to a different animation.
TriggerType
Defines triggers for transitioning animations.
Definition gModelAnimator.h:35
@ TRIGGERTYPE_AFTER_COMPLETION
Definition gModelAnimator.h:36
Mode
Defines playback behavior for animations.
Definition gModelAnimator.h:25
@ MODE_HOLD_ON_LAST_FRAME
Definition gModelAnimator.h:26
@ MODE_ONCE
Definition gModelAnimator.h:27
@ MODE_REPEAT
Definition gModelAnimator.h:28