AnimatableModel

interface AnimatableModel

An AnimatableModel is an object whose properties can be animated by an ModelAnimation. The object animation transformation can be done at the desired frame callback place. ModelAnimation updates the value (like in a standard context) or to apply them inside a global/common frame callback.

An AnimatableModel can, for example, update the data of each animated property managed by an com.google.android.filament.gltfio.Animator.

Inheritors

Functions

Link copied to clipboard
open fun animate(repeat: Boolean): ObjectAnimator
Constructs and returns an ObjectAnimator for all ModelAnimation of this object.
open fun animate(animationIndexes: Array<Int>): ObjectAnimator
Constructs and returns an ObjectAnimator for targeted ModelAnimation with a a given index of this object.
open fun animate(animations: Array<ModelAnimation>): ObjectAnimator
Constructs and returns an ObjectAnimator for a targeted ModelAnimation of this object.
open fun animate(animationNames: Array<String>): ObjectAnimator
Constructs and returns an ObjectAnimator for targeted ModelAnimation with a given name of this object.
Link copied to clipboard
abstract fun applyAnimationChange(animation: ModelAnimation): Boolean
Occurs when a ModelAnimation has received any property changed.
Link copied to clipboard
abstract fun getAnimation(animationIndex: Int): ModelAnimation
Get the associated ModelAnimation at the given index or throw an IndexOutOfBoundsException.
Get the associated ModelAnimation by name or null if none exist with the given name.
Link copied to clipboard
abstract fun getAnimationCount(): Int
Returns the number of ModelAnimation definitions in the model.
Link copied to clipboard
open fun getAnimationIndex(name: String): Int
Get the Zero-based index for the animation name of interest or -1 if not found.
Link copied to clipboard
open fun getAnimationName(animationIndex: Int): String
Get the name of the ModelAnimation at the Zero-based index This name corresponds to the one defined and exported in the renderable asset.
Link copied to clipboard
Get the names of the ModelAnimation This names correspond to the ones defined and exported in the renderable asset.
Link copied to clipboard
Get the associated ModelAnimation by name or throw an Exception if none exist with the given name.
Link copied to clipboard
Return true if getAnimationCount>0
Link copied to clipboard
Called form the ModelAnimation when it dirty state changed.
Link copied to clipboard
open fun setAnimationsFramePosition(framePosition: Int)
Sets the current position of (seeks) all the animations to the specified frame number according to the getFrameRate This method will apply rotation, translation, and scale to the Renderable that have been targeted.
Link copied to clipboard
open fun setAnimationsTimePosition(timePosition: Float)
Sets the current position of (seeks) the animation to the specified time position in seconds.