Animator

class Animator(nativeHandle: NativePointer)

Animator updates matrices according to glTF animation and skin definitions.

Animator handles two primary tasks:

  1. Updating matrices in TransformManager components based on glTF animation definitions

  2. Updating bone matrices in RenderableManager components based on glTF skin definitions

Usage pattern for animated skeletal meshes:

animator.applyAnimation(currentIndex, time)      // Apply current animation
animator.applyCrossFade(previousAnimIndex, previousAnimTime, alpha) // Blend with previous (optional)
animator.updateBoneMatrices() // Propagate bone transforms to renderables

See also

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Properties

Link copied to clipboard

Get the number of animations in the glTF asset.

Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Functions

Link copied to clipboard
fun applyAnimation(animationIndex: Int, time: Float)

Apply a glTF animation to the transform hierarchy.

Link copied to clipboard
fun applyCrossFade(previousAnimIndex: Int, previousAnimTime: Float, alpha: Float)

Cross-fade from a previous animation with alpha blending.

Link copied to clipboard
fun getAnimationDuration(animationIndex: Int): Float

Get the duration of a glTF animation.

Link copied to clipboard
fun getAnimationName(animationIndex: Int): String?

Get the name of a glTF animation.

Link copied to clipboard

Reset all bone matrices to identity (T-pose).

Link copied to clipboard

Compute root-to-node transforms for all bone nodes and push to RenderableManager.