Class Animator
- java.lang.Object
-
- com.google.android.filament.gltfio.Animator
-
public class Animator extends java.lang.ObjectUpdates matrices according to glTFanimationandskindefinitions.Animator is owned by
FilamentAssetand can be used for two things:- Updating matrices in
TransformManagercomponents according to glTFanimationdefinitions. - Updating bone matrices in
RenderableManagercomponents according to glTFskindefinitions.
- See Also:
AssetLoader,FilamentAsset,ResourceLoader
- Updating matrices in
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyAnimation(int animationIndex, float time)Applies rotation, translation, and scale to entities that have been targeted by the given animation definition.intgetAnimationCount()Returns the number ofanimationdefinitions in the glTF asset.floatgetAnimationDuration(int animationIndex)Returns the duration of the specified glTFanimationin seconds.java.lang.StringgetAnimationName(int animationIndex)Returns a weak reference to the string name of the specifiedanimation, or an empty string if none was specified.voidupdateBoneMatrices()Computes root-to-node transforms for all bone nodes, then passes the results intoRenderableManager.setBonesAsMatrices(int, Buffer, int, int).
-
-
-
Method Detail
-
applyAnimation
public void applyAnimation(@IntRange(from=0L) int animationIndex, float time)Applies rotation, translation, and scale to entities that have been targeted by the given animation definition. UsesTransformManager.- Parameters:
animationIndex- Zero-based index for theanimationof interest.time- Elapsed time of interest in seconds.- See Also:
getAnimationCount()
-
updateBoneMatrices
public void updateBoneMatrices()
Computes root-to-node transforms for all bone nodes, then passes the results intoRenderableManager.setBonesAsMatrices(int, Buffer, int, int). UsesTransformManagerandRenderableManager.NOTE: this operation is independent of
animation.
-
getAnimationCount
public int getAnimationCount()
Returns the number ofanimationdefinitions in the glTF asset.
-
getAnimationDuration
public float getAnimationDuration(@IntRange(from=0L) int animationIndex)Returns the duration of the specified glTFanimationin seconds.- Parameters:
animationIndex- Zero-based index for theanimationof interest.- See Also:
getAnimationCount()
-
getAnimationName
public java.lang.String getAnimationName(@IntRange(from=0L) int animationIndex)Returns a weak reference to the string name of the specifiedanimation, or an empty string if none was specified.- Parameters:
animationIndex- Zero-based index for theanimationof interest.- See Also:
getAnimationCount()
-
-