ModelAnimation
An ModelAnimation is a reusable set of keyframe tracks which represent an animation.
This class provides support for animating time positions on a targeted AnimatableModel
Here are some use cases for animations :
- On a very basic 3D model like a single infinite rotating sphere, you should not have to use this class but probably instead just call animate
- For a synchronised animation set like animating a cube and a sphere position and rotation at same time or sequentially, please consider using an android.animation.AnimatorSet playing a ofAnimation or ofPropertyValuesHolder
- If the mesh is a character, for example, there may be one ModelAnimation for a walkcycle, a second for a jump, a third for sidestepping and so on. Assuming a character object has a skeleton, one keyframe track could store the data for the position changes of the lower arm bone over time, a different track the data for the rotation changes of the same bone, a third the track position, rotation or scaling of another bone, and so on. It should be clear, that an ModelAnimation can act on lots of such tracks. Assuming the model has morph targets (for example one morph target showing a friendly face and another showing an angry face), each track holds the information as to how the influence of a certain morph target changes during the performance of the clip. In this case you should manage one android.animation.ObjectAnimator coming from ofAnimation per action. And an android.animation.AnimatorSet to play them sequentially or together.
Types
Properties
Link copied to clipboard
A Property wrapper around the
fractionPosition
functionality handled by the setFractionPosition and getFractionPosition methodsLink copied to clipboard
A Property wrapper around the
framePosition
functionality handled by the setFramePosition and getFramePosition methodsLink copied to clipboard
A Property wrapper around the
timePosition
functionality handled by the setTimePosition and getTimePosition methods.Link copied to clipboard
Time position is applied inside a global android.view.Choreographer frame callback to ensure that the transformations are applied in a hierarchical order.
Functions
Link copied to clipboard
Get the elapsed time in seconds of a fraction position
Link copied to clipboard
Get the elapsed time in seconds of a frame position
Link copied to clipboard
Returns The Zero-based index of the target
animation
as defined in the original AnimatableModelLink copied to clipboard
Returns the duration of this animation in milliseconds.
Link copied to clipboard
Get the fraction position at the elapsed time in seconds.
Link copied to clipboard
Get the fractional value at the current animation position.
Link copied to clipboard
Get the frame position at the elapsed time in seconds.
Link copied to clipboard
Returns the total number of frames of this animation.
Link copied to clipboard
Get the current frame number at the current animation position.
Link copied to clipboard
Get the elapsed time in seconds of a fraction position
Link copied to clipboard
Get the elapsed time in seconds of a frame position
Link copied to clipboard
Convert time in seconds to time in millis
Link copied to clipboard
Sets the current position of (seeks) the animation to the specified fraction position.
Link copied to clipboard
Sets the current position of (seeks) the animation to the specified frame number according to the getFrameRate.
Link copied to clipboard
Get the fraction position at the elapsed time in seconds.
Link copied to clipboard
Get the frame position at the elapsed time in seconds.