com.threerings.opengl.model
Class Animation.Imported

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

public static class Animation.Imported
extends Animation.Implementation

An imported implementation.


Field Summary
protected  float _accum
          The progress towards the next frame.
protected  boolean _completed
          Set when the animation has completed.
protected  AnimationConfig.Imported _config
          The implementation configuration.
protected  float _countdown
          The time remaining until we have to start blending the animation out.
protected  boolean _counting
          Whether we are counting down until we must blend out.
protected  int _eidx
          The index of the next executor.
protected  Animation.FrameExecutor[] _executors
          Executors for frame actions.
protected  int _fidx
          The index of the current animation frame.
protected  Transform3D[] _snapshot
          A snapshot of the original transforms of the targets, for transitioning.
protected  Articulated.Node[] _targets
          The targets of the animation.
protected  boolean _transitioning
          Whether we are currently transitioning into the first frame.
protected  Transform3D _xform
          A temporary transform for interpolation.
 
Fields inherited from class com.threerings.opengl.model.Animation.Implementation
_ctx, _targetWeight, _weight, _weightRate
 
Fields inherited from class com.threerings.expr.SimpleScope
_parentScope
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
Animation.Imported(GlContext ctx, Scope parentScope, AnimationConfig.Imported config)
          Creates a new imported 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.
protected  void executeActions()
          Executes all actions scheduled before or at the current frame.
protected  float getFrameRate()
          Returns the animation's frame rate.
 boolean hasCompleted()
          Checks whether this animation has completed.
 boolean isPlaying()
          Determines whether the animation is currently playing.
 void setConfig(AnimationConfig.Imported config)
          (Re)configures the implementation.
 void start()
          Starts the animation.
 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.opengl.model.Animation.Implementation
getPriority, getScopeName, setConfig, stop, stop
 
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

_config

protected AnimationConfig.Imported _config
The implementation configuration.


_targets

protected Articulated.Node[] _targets
The targets of the animation.


_snapshot

protected Transform3D[] _snapshot
A snapshot of the original transforms of the targets, for transitioning.


_executors

protected Animation.FrameExecutor[] _executors
Executors for frame actions.


_transitioning

protected boolean _transitioning
Whether we are currently transitioning into the first frame.


_counting

protected boolean _counting
Whether we are counting down until we must blend out.


_countdown

protected float _countdown
The time remaining until we have to start blending the animation out.


_fidx

protected int _fidx
The index of the current animation frame.


_accum

protected float _accum
The progress towards the next frame.


_eidx

protected int _eidx
The index of the next executor.


_completed

protected boolean _completed
Set when the animation has completed.


_xform

protected Transform3D _xform
A temporary transform for interpolation.

Constructor Detail

Animation.Imported

public Animation.Imported(GlContext ctx,
                          Scope parentScope,
                          AnimationConfig.Imported config)
Creates a new imported implementation.

Method Detail

setConfig

public void setConfig(AnimationConfig.Imported config)
(Re)configures the implementation.


start

public void start()
Description copied from class: Animation.Implementation
Starts the animation.

Overrides:
start in class Animation.Implementation

isPlaying

public boolean isPlaying()
Description copied from class: Animation.Implementation
Determines whether the animation is currently playing.

Overrides:
isPlaying in class Animation.Implementation

tick

public boolean tick(float elapsed)
Description copied from class: Animation.Implementation
Updates this animation based on the elapsed time in seconds.

Overrides:
tick in class Animation.Implementation
Returns:
true if the animation has completed.

hasCompleted

public boolean hasCompleted()
Description copied from class: Animation.Implementation
Checks whether this animation has completed.

Overrides:
hasCompleted in class Animation.Implementation

updateTransforms

public void updateTransforms()
Description copied from class: Animation.Implementation
Updates the transforms directly from this animation.

Overrides:
updateTransforms in class Animation.Implementation

blendTransforms

public void blendTransforms(int update)
Description copied from class: Animation.Implementation
Blends in the influence of this animation.

Overrides:
blendTransforms in class Animation.Implementation
Parameters:
update - the current value of the update counter (used to determine which nodes have been touched on this update).

blendToWeight

protected void blendToWeight(float weight,
                             float interval)
Description copied from class: Animation.Implementation
Blends to a target weight over an interval specified in seconds.

Overrides:
blendToWeight in class Animation.Implementation

getFrameRate

protected float getFrameRate()
Returns the animation's frame rate.


executeActions

protected void executeActions()
Executes all actions scheduled before or at the current frame.