hmi.elckerlyc.animationengine
Class AnimationPlayerManager

java.lang.Object
  extended by hmi.elckerlyc.animationengine.AnimationPlayerManager

public class AnimationPlayerManager
extends Object

Manages the playback and physical simulation of multiple AnimationPlayers

Author:
Herwin van Welbergen

Field Summary
private  VJoint animationRootJoint
           
private  VJoint currentRootJoint
           
private static float PHYSICS_STEPTIME
           
private  PhysicsCallback physicsCallback
           
private  ArrayList<AnimationPlayer> players
           
private  double prevTime
           
private  VObjectTransformCopier votc
           
 
Constructor Summary
AnimationPlayerManager(PhysicsCallback pb, VJoint animationRoot, VJoint currRoot)
          ASSUMPTION: the humanoidroots are added directly under animationRoot In each frame: 1.
 
Method Summary
 void addAnimationPlayer(AnimationPlayer p)
           
static float getH()
           
 double getPrevTime()
           
 void removeAnimationPlayer(AnimationPlayer p)
          Removes the animationplayer.
 void reset()
           
 void time(double currentTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

votc

private VObjectTransformCopier votc

players

private ArrayList<AnimationPlayer> players

prevTime

private double prevTime

physicsCallback

private PhysicsCallback physicsCallback

PHYSICS_STEPTIME

private static final float PHYSICS_STEPTIME
See Also:
Constant Field Values

animationRootJoint

private VJoint animationRootJoint

currentRootJoint

private VJoint currentRootJoint
Constructor Detail

AnimationPlayerManager

public AnimationPlayerManager(PhysicsCallback pb,
                              VJoint animationRoot,
                              VJoint currRoot)
ASSUMPTION: the humanoidroots are added directly under animationRoot In each frame: 1. Run all animation players, in each animation player:
a Copy next to cur, cur to prev
b Run procedural animations on next
c Calculate the forces and torques generated by the proc motion
2. Do a physics step
3. Copy physical body rotations to cur and next
4. Copy curr to the animation tree

Method Detail

removeAnimationPlayer

public void removeAnimationPlayer(AnimationPlayer p)
Removes the animationplayer. Make sure the VJoint controlled by p is removed from the animationRootJoint.


addAnimationPlayer

public void addAnimationPlayer(AnimationPlayer p)

reset

public void reset()

time

public void time(double currentTime)

getH

public static float getH()
Returns:
the PHYSICS_STEPTIME

getPrevTime

public double getPrevTime()
Returns:
the prevTime