Most visited

Recently visited

Animation

public class Animation
extends Object

java.lang.Object
   ↳ com.viro.core.Animation


Animation represents a set of skeletal or keyframe animations that can be executed. These animations are techniques for animating complex geometries; for example, to make a humanoid character walk. They are typically authored in 3D graphics software, and exported as FBX files, which can then be loaded into Viro via Object3D. To retrieve an Animation, use getAnimation(String).

Summary

Nested classes

interface Animation.Listener

Callback interface to respond to Animation events. 

enum Animation.State

Represents the playback state of an Animation. 

Public methods

long getDelay()

Get the delay, in millieconds, that the Animation will wait before running.

Animation.Listener getListener()

Get the Animation.Listener used to receive callbacks for this Animation.

boolean getLoop()

Return true if the Animation is currently set to loop after playback.

void pause()

Pauses a RUNNING Animation or terminates a SCHEDULED Animation.

void play()

Start a STOPPED Animation or resume a PAUSED Animation.

void setDelay(long delay)

Set the delay, in milliseconds, that the Animation will wait before running after play() is invoked.

void setListener(Animation.Listener listener)

Set the Animation.Listener, which can be used to respond to Animation playback events.

void setLoop(boolean loop)

Set to true to make the Animation automatically loop to the beginning when playback finishes.

void stop()

Terminates any SCHEDULED, RUNNING or PAUSED Animation.

Public methods

getDelay

long getDelay ()

Get the delay, in millieconds, that the Animation will wait before running.

Returns
long The delay in milliseconds.

getListener

Animation.Listener getListener ()

Get the Animation.Listener used to receive callbacks for this Animation.

Returns
Animation.Listener The listener, or null if none is attached.

getLoop

boolean getLoop ()

Return true if the Animation is currently set to loop after playback.

Returns
boolean True if loop is enabled.

pause

void pause ()

Pauses a RUNNING Animation or terminates a SCHEDULED Animation. The Animation can be resumed by invoking play(). If the Animation was scheduled -- meaning it was waiting for its delay period to expire -- then this function will stop the animation.

play

void play ()

Start a STOPPED Animation or resume a PAUSED Animation. If the Animation is paused, then it will immediately resume. If the Animation is STOPPED, then it will first wait delay milliseconds before starting.

setDelay

void setDelay (long delay)

Set the delay, in milliseconds, that the Animation will wait before running after play() is invoked.

Parameters
delay long: The delay in milliseconds.

setListener

void setListener (Animation.Listener listener)

Set the Animation.Listener, which can be used to respond to Animation playback events.

Parameters
listener Animation.Listener: The listener to use for this Animation.

setLoop

void setLoop (boolean loop)

Set to true to make the Animation automatically loop to the beginning when playback finishes.

Parameters
loop boolean: True to loop.

stop

void stop ()

Terminates any SCHEDULED, RUNNING or PAUSED Animation.

Hooray!