com.threerings.opengl.model
Class Animation.Implementation

java.lang.Object
  extended by com.threerings.expr.SimpleScope
      extended by com.threerings.opengl.model.Animation.Implementation
All Implemented Interfaces:
Scope, ScopeUpdateListener
Direct Known Subclasses:
Animation.Imported, Animation.Procedural, Animation.Sequential
Enclosing class:
Animation

public abstract static class Animation.Implementation
extends SimpleScope

The actual animation implementation.


Field Summary
protected  AnimationConfig.Original _config
          The implementation configuration.
protected  GlContext _ctx
          The application context.
protected  float _targetWeight
          The target weight of the animation.
protected  float _weight
          The current weight of the animation.
protected  float _weightRate
          The weight's current rate of change.
 
Fields inherited from class com.threerings.expr.SimpleScope
_parentScope
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
Animation.Implementation(GlContext ctx, Scope parentScope)
          Creates a new implementation.
 
Method Summary
protected  void blendToWeight(float weight, float interval)
          Blends to a target weight over an interval specified in seconds.
 void blendTransforms(int update)
          Blends in the influence of this animation.
 int getPriority()
          Returns the priority of this animation.
 String getScopeName()
          Returns the name of this scope for purposes of qualification.
 boolean hasCompleted()
          Checks whether this animation has completed.
 boolean isPlaying()
          Determines whether the animation is currently playing.
protected  void setConfig(AnimationConfig.Original config)
          (Re)configures the implementation.
 void start()
          Starts the animation.
 void stop()
          Stops the animation.
 void stop(float blendOut)
          Stops the animation, blending out over the specified interval.
 boolean tick(float elapsed)
          Updates this animation based on the elapsed time in seconds.
 void updateTransforms()
          Updates the transforms directly from this animation.
 
Methods inherited from class com.threerings.expr.SimpleScope
addListener, dispose, get, getParentScope, removeListener, scopeUpdated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ctx

protected GlContext _ctx
The application context.


_config

protected AnimationConfig.Original _config
The implementation configuration.


_weight

protected float _weight
The current weight of the animation.


_targetWeight

protected float _targetWeight
The target weight of the animation.


_weightRate

protected float _weightRate
The weight's current rate of change.

Constructor Detail

Animation.Implementation

public Animation.Implementation(GlContext ctx,
                                Scope parentScope)
Creates a new implementation.

Method Detail

start

public void start()
Starts the animation.


stop

public void stop()
Stops the animation.


stop

public void stop(float blendOut)
Stops the animation, blending out over the specified interval.


isPlaying

public boolean isPlaying()
Determines whether the animation is currently playing.


getPriority

public int getPriority()
Returns the priority of this animation.


tick

public boolean tick(float elapsed)
Updates this animation based on the elapsed time in seconds.

Returns:
true if the animation has completed.

hasCompleted

public boolean hasCompleted()
Checks whether this animation has completed.


updateTransforms

public void updateTransforms()
Updates the transforms directly from this animation.


blendTransforms

public void blendTransforms(int update)
Blends in the influence of this animation.

Parameters:
update - the current value of the update counter (used to determine which nodes have been touched on this update).

getScopeName

public String getScopeName()
Description copied from interface: Scope
Returns the name of this scope for purposes of qualification. Can return null if qualified symbols cannot specifically address this scope.

Specified by:
getScopeName in interface Scope
Overrides:
getScopeName in class SimpleScope

setConfig

protected void setConfig(AnimationConfig.Original config)
(Re)configures the implementation.


blendToWeight

protected void blendToWeight(float weight,
                             float interval)
Blends to a target weight over an interval specified in seconds.