AnimationMixer
Player for animations on a particular object in the scene.
This class manages animation playback for a specific object, providing
methods to control animation timing, playback speed, and action
management. When multiple objects are animated independently, one
AnimationMixer may be used for each object.
- Time scaling for playback speed
- AnimationAction management
- Memory resource management
- Get actions for animation clips
- Update mixer in render loop
Methods
AnimationMixer(Object3D* rootObject)
Constructor with root object
| rootObject | Object whose animations shall be played by this mixer |
AnimationAction* clipAction(const AnimationClip& clip, Object3D* optionalRoot = nullptr)
Returns an existing or new AnimationAction for the passed clip
| clip | AnimationClip object | |
| optionalRoot | Optional root object different from mixer's default |
AnimationAction* existingAction(const AnimationClip& clip, Object3D* optionalRoot = nullptr)
Returns an existing AnimationAction or nullptr for the passed clip
| clip | AnimationClip object | |
| optionalRoot | Optional root object different from mixer's default |
Object3D* getRoot() const
Returns this mixer's root object
AnimationMixer& stopAllAction()
Deactivates all previously scheduled actions on this mixer
AnimationMixer& update(f32 deltaTimeInSeconds)
Advances the global mixer time and updates the animation
| deltaTimeInSeconds | Delta time in seconds |
AnimationMixer& setTime(f32 timeInSeconds)
Sets the global mixer to a specific time and updates animation
| timeInSeconds | Time in seconds to set |
Properties
| time | f32 | Global mixer time in seconds |
| timeScale | f32 | Scaling factor for global mixer time |