hmi.elckerlyc.animationengine
Class AnimationPlayerManager
java.lang.Object
hmi.elckerlyc.animationengine.AnimationPlayerManager
public class AnimationPlayerManager
- extends Object
Manages the playback and physical simulation of multiple AnimationPlayers
- Author:
- Herwin van Welbergen
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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
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