|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.expr.SimpleScope
com.threerings.opengl.model.Animation
public class Animation
An animation for an Articulated model.
| Nested Class Summary | |
|---|---|
protected static class |
Animation.AnimationOp
Animation op base class. |
protected static class |
Animation.FrameExecutor
Contains an executor to activate at a specific frame. |
static class |
Animation.Implementation
The actual animation implementation. |
static class |
Animation.Imported
An imported implementation. |
static class |
Animation.Procedural
A procedural implementation. |
static class |
Animation.Sequential
A sequential implementation. |
protected static class |
Animation.StartedOp
An ObserverList.ObserverOp that calls
AnimationObserver.animationStarted(com.threerings.opengl.model.Animation). |
protected static class |
Animation.StoppedOp
An ObserverList.ObserverOp that calls
AnimationObserver.animationStopped(com.threerings.opengl.model.Animation, boolean). |
| Field Summary | |
|---|---|
protected AnimationConfig |
_config
The configuration of this animation. |
protected GlContext |
_ctx
The application context. |
protected MutableLong |
_epoch
A container for the animation epoch. |
protected Animation.Implementation |
_impl
The animation implementation. |
protected String |
_name
The name of the animation. |
protected ObserverList<AnimationObserver> |
_observers
The lazily-initialized list of animation observers. |
protected float |
_speed
The speed at which to play the animation. |
protected static Animation.StartedOp |
_startedOp
Started op to reuse. |
protected static Animation.StoppedOp |
_stoppedOp
Stopped op to reuse. |
static Animation[] |
EMPTY_ARRAY
An empty array of animations. |
protected static Animation.Implementation |
NULL_IMPLEMENTATION
An implementation that does nothing. |
| Fields inherited from class com.threerings.expr.SimpleScope |
|---|
_parentScope |
| Fields inherited from interface com.threerings.expr.Scope |
|---|
EPOCH, NOW |
| Constructor Summary | |
|---|---|
Animation(GlContext ctx,
Scope parentScope)
Creates a new animation. |
|
| Method Summary | |
|---|---|
void |
addObserver(AnimationObserver observer)
Adds an observer to this animation. |
protected static void |
applyStartedOp(ObserverList<? extends AnimationObserver> observers,
Animation animation)
Applies the _startedOp to the supplied list of observers. |
protected static void |
applyStoppedOp(ObserverList<? extends AnimationObserver> observers,
Animation animation,
boolean completed)
Applies the _stoppedOp to the supplied list of observers. |
void |
blendTransforms(int update)
Blends in the influence of this animation. |
void |
configUpdated(ConfigEvent<AnimationConfig> event)
Called when a configuration has been updated. |
void |
dispose()
Releases the resources associated with this scope. |
String |
getName()
Returns the name of the animation. |
int |
getPriority()
Returns the priority of this animation. |
String |
getScopeName()
Returns the name of this scope for purposes of qualification. |
float |
getSpeed()
Returns the speed at which the animation is being played. |
boolean |
hasCompleted()
Checks whether the animation has just completed, and thus should be removed from the playing list after a final update has been performed. |
boolean |
isPlaying()
Determines whether this animation is playing. |
void |
removeObserver(AnimationObserver observer)
Removes an observer from this animation. |
protected void |
resetEpoch()
Resets the epoch value to the current time. |
void |
scopeUpdated(ScopeEvent event)
Called when the scope has been updated. |
void |
setConfig(String name,
AnimationConfig config)
Sets the configuration of this animation. |
void |
setConfig(String name,
ConfigReference<AnimationConfig> ref)
Sets the configuration of this animation. |
void |
setConfig(String name,
String config)
Sets the configuration of this animation. |
void |
setConfig(String name,
String config,
String firstKey,
Object firstValue,
Object... otherArgs)
Sets the configuration of this animation. |
void |
setSpeed(float speed)
Sets the speed at which to play the animation. |
void |
start()
Starts playing this animation. |
protected void |
started(float overrideBlendOut)
Notes that the animation started. |
void |
stop()
Stops playing this animation. |
void |
stop(float blendOut)
Stops playing this animation, blending it out over the specified interval (as opposed to its default interval). |
protected void |
stopped(boolean completed)
Notes that the animation stopped. |
boolean |
tick(float elapsed)
Updates this animation based on the elapsed time in seconds. |
String |
toString()
|
protected void |
updateFromConfig()
Updates the animation to match its new or modified configuration. |
void |
updateTransforms()
Updates the transforms directly from this animation. |
| Methods inherited from class com.threerings.expr.SimpleScope |
|---|
addListener, get, getParentScope, removeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Animation[] EMPTY_ARRAY
protected GlContext _ctx
protected String _name
protected AnimationConfig _config
protected float _speed
protected Animation.Implementation _impl
protected ObserverList<AnimationObserver> _observers
@Scoped protected MutableLong _epoch
protected static Animation.StartedOp _startedOp
protected static Animation.StoppedOp _stoppedOp
protected static final Animation.Implementation NULL_IMPLEMENTATION
| Constructor Detail |
|---|
public Animation(GlContext ctx,
Scope parentScope)
| Method Detail |
|---|
public void setConfig(String name,
String config)
public void setConfig(String name,
ConfigReference<AnimationConfig> ref)
public void setConfig(String name,
String config,
String firstKey,
Object firstValue,
Object... otherArgs)
public void setConfig(String name,
AnimationConfig config)
public String getName()
public void setSpeed(float speed)
public float getSpeed()
public void start()
public void stop()
public void stop(float blendOut)
public boolean isPlaying()
public void addObserver(AnimationObserver observer)
public void removeObserver(AnimationObserver observer)
public int getPriority()
public boolean tick(float elapsed)
public boolean hasCompleted()
public void updateTransforms()
public void blendTransforms(int update)
update - the current value of the update counter (used to determine which nodes have
been touched on this update).public void configUpdated(ConfigEvent<AnimationConfig> event)
ConfigUpdateListener
configUpdated in interface ConfigUpdateListener<AnimationConfig>public String getScopeName()
Scopenull
if qualified symbols cannot specifically address this scope.
getScopeName in interface ScopegetScopeName in class SimpleScopepublic void scopeUpdated(ScopeEvent event)
ScopeUpdateListener
scopeUpdated in interface ScopeUpdateListenerscopeUpdated in class SimpleScopepublic void dispose()
SimpleScope
dispose in class SimpleScopepublic String toString()
toString in class Objectprotected void updateFromConfig()
protected void started(float overrideBlendOut)
overrideBlendOut - if non-negative, an interval over which to blend out all
animations currently playing at the same priority level as this one.protected void stopped(boolean completed)
protected void resetEpoch()
protected static void applyStartedOp(ObserverList<? extends AnimationObserver> observers,
Animation animation)
_startedOp to the supplied list of observers.
protected static void applyStoppedOp(ObserverList<? extends AnimationObserver> observers,
Animation animation,
boolean completed)
_stoppedOp to the supplied list of observers.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||