class
AnimationScene
Keeps track of all active animations in a single scene instance.
Queues animation thread tasks and synchronizes data between main, render and animation threads.
Public
Constructors
AnimationScene
Methods
SetPaused
Pauses or resumes the animation evaluation.
SetUpdateRate
Determines how often to evaluate animations.
If rendering is not running at adequate framerate the animation could end up being evaluated less times than specified here.
- fps
- Number of frames per second to evaluate the animation. Default is 60.
Update
Evaluates animations for all animated objects, and returns the evaluated skeleton bone poses and morph shape meshes that can be passed along to the renderer.
- async
- If true the method returns immediately while the animation gets evaluated in the background. The returned evaluated data will be the data from the previous frame. Therefore note that this introduces a one frame latency on the animation. If the latency is not acceptable set this to false, at a potential performance impact.
Returns: Evaluated animation data for this frame (if is false), or the previous frame (if is true). Note that the system re-uses the returned buffers, and the returned buffer should stop being used after every second call to Update(). This is enough to have one buffer be processed by the render thread, one queued for future rendering and one that's being written to.
Internal
Methods
SetOwner
Scene instance that owns this animation scene.
Private
Methods
RegisterAnimation
Registers a new animation and returns a unique ID for it.
Must be called whenever an Animation is constructed.
UnregisterAnimation
Unregisters an animation with the specified ID.
Must be called before an Animation is destroyed.
EvaluateAnimation
Evaluates animation for a single object and writes the result in the currently active write buffer.
- anim
- Proxy representing the animation to evaluate.
- outBoneIndex
- Index in the output buffer in which to write evaluated bone information. This will be automatically advanced by the number of written bone transforms.