Capítulo 287 de 859

Chapter 287: AnimationMixer

Core Idea

AnimationMixer is a player for animations on a particular object in the scene. When multiple objects in the scene are animated independently, one AnimationMixer may be used for each object.

Key Concepts

  • time : number: The global mixer time (in seconds; starting with 0 on the mixer's creation).
  • timeScale : number: A scaling factor for the global time.

Reference Tables

Constructor

Signature
new AnimationMixer( root : Object3D )

Properties

PropertyDescription
.time : numberThe global mixer time (in seconds; starting with 0 on the mixer's creation).
.timeScale : numberA scaling factor for the global time.

Methods

MethodDescription
`.clipAction( clip : AnimationClipstring, optionalRoot : Object3D, blendMode : NormalAnimationBlendMode
`.existingAction( clip : AnimationClipstring, optionalRoot : Object3D ) : AnimationAction`
.getRoot() : Object3DReturns this mixer's root object.
.setTime( time : number ) : AnimationMixerSets the global mixer to a specific time and updates the animation accordingly.
.stopAllAction() : AnimationMixerDeactivates all previously scheduled actions on this mixer.
`.uncacheAction( clip : AnimationClipstring, optionalRoot : Object3D )`
.uncacheClip( clip : AnimationClip )Deallocates all memory resources for a clip. Before using this method make sure to call AnimationAction#stop for all related actions.
.uncacheRoot( root : Object3D )Deallocates all memory resources for a root object. Before using this method make sure to call AnimationAction#stop for all related actions or alternatively [AnimationMix…
.update( deltaTime : number ) : AnimationMixerAdvances the global mixer time and updates the animation.

Key Takeaways

  1. Most relevant properties: time, timeScale.
  2. Key methods: clipAction, existingAction, getRoot, setTime.

Connects To