hmi.elckerlyc.animationengine
Class AnimationPlayer

java.lang.Object
  extended by hmi.elckerlyc.animationengine.AnimationPlayer
All Implemented Interfaces:
PUExceptionCallback, Player

public class AnimationPlayer
extends Object
implements PUExceptionCallback, Player


Field Summary
private  PlanPlayer app
           
private  PlanPlayer appPredict
           
private  ArrayList<PhysicalController> controllers
           
private  org.slf4j.Logger logger
           
private  MixedPlayer mPlayer
           
private  ArrayList<MixedSystem> mSystems
           
private  PhysicalHumanoid pHuman
           
private  boolean prevValid
           
private  boolean prevValidOld
           
private  float stepTime
           
private  List<PlanUnit> tmuRemove
           
private  VJoint vCurr
           
private  SkeletonPose vCurrStartPose
           
private  VJoint vNext
           
private  SkeletonPose vNextStartPose
           
private  VObjectTransformCopier votcCurrToPrev
           
private  VObjectTransformCopier votcNextToCurr
           
private  VJoint vPredict
           
private  VJoint vPrev
           
private  SkeletonPose vPrevStartPose
           
private  ExceptionManager warningManager
           
protected  WorldObjectManager woManager
           
 
Constructor Summary
AnimationPlayer(VJoint vP, VJoint vC, VJoint vN, VJoint vPred, ArrayList<MixedSystem> m, float h)
           
AnimationPlayer(VJoint vP, VJoint vC, VJoint vN, VJoint vPred, ArrayList<MixedSystem> m, float h, WorldObjectManager wom)
           
 
Method Summary
 void addExceptionListener(BMLExceptionListener ws)
           
 void addTimedMotionUnit(TimedMotionUnit tmu)
           
 void clearAll(double time)
           
 void copyPhysics()
           
 void exception(BMLExceptionFeedback e)
           
 Set<String> getBehaviours(String bmlId)
           
 ArrayList<PhysicalController> getControllers()
           
 double getEndTime(String behId, String bmlId)
           
 Set<String> getInvalidBehaviors()
           
 ArrayList<MixedSystem> getMixedSystems()
           
 int getNumberOfTimedMotionUnits()
           
 PhysicalHumanoid getPHuman()
           
 float getStepTime()
           
 VJoint getVCurr()
          Get the current set of joints that is to be animated
 VJoint getVNext()
          Get the set of joints that is to be animated
 VJoint getVPredict()
          Get the predicted joint rotation
 VJoint getVPrev()
          Get the prev set of joints that is to be animated
 WorldObjectManager getWoManager()
           
 void interruptBehaviourBlock(String bmlId, double time)
          Interrupts all behaviors in the block; that is: calls their stop and removes them from the plan
 void interruptTimedMotionUnit(String id, String bmlId, double globalTime)
           
 void predict(double time)
           
 void puException(PlanUnit timedMU, String message, double time)
          Callback for behaviors
 void removeAllExceptionListeners()
           
 void reset()
          Resets all controllers, mixed systems (that is: restores their start physical humanoids and sets connector velocity to 0) and sets vPrev, vNext and vCurr to their pose at initialization
 void setBMLBlockState(String bmlId, PlanUnitState state)
           
 void setParameterValue(String behId, String bmlId, String paramId, float value)
           
 void setParameterValue(String behId, String bmlId, String paramId, String value)
           
 void setResetPose()
          Sets the reset pose to the current vNext.
 void shutdown()
          Clean up resources constructed with the planner (e.g. for native stuff, spawned threads, ...).
 void step(float prevTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vPrev

private VJoint vPrev

vCurr

private VJoint vCurr

vNext

private VJoint vNext

vPredict

private VJoint vPredict

pHuman

private PhysicalHumanoid pHuman

votcCurrToPrev

private VObjectTransformCopier votcCurrToPrev

votcNextToCurr

private VObjectTransformCopier votcNextToCurr

prevValid

private boolean prevValid

controllers

private ArrayList<PhysicalController> controllers

app

private PlanPlayer app

appPredict

private PlanPlayer appPredict

mSystems

private ArrayList<MixedSystem> mSystems

mPlayer

private MixedPlayer mPlayer

stepTime

private float stepTime

vPrevStartPose

private SkeletonPose vPrevStartPose

vCurrStartPose

private SkeletonPose vCurrStartPose

vNextStartPose

private SkeletonPose vNextStartPose

prevValidOld

private boolean prevValidOld

woManager

protected WorldObjectManager woManager

tmuRemove

private List<PlanUnit> tmuRemove

logger

private org.slf4j.Logger logger

warningManager

private final ExceptionManager warningManager
Constructor Detail

AnimationPlayer

public AnimationPlayer(VJoint vP,
                       VJoint vC,
                       VJoint vN,
                       VJoint vPred,
                       ArrayList<MixedSystem> m,
                       float h)

AnimationPlayer

public AnimationPlayer(VJoint vP,
                       VJoint vC,
                       VJoint vN,
                       VJoint vPred,
                       ArrayList<MixedSystem> m,
                       float h,
                       WorldObjectManager wom)
Method Detail

getNumberOfTimedMotionUnits

public int getNumberOfTimedMotionUnits()

interruptTimedMotionUnit

public void interruptTimedMotionUnit(String id,
                                     String bmlId,
                                     double globalTime)

getWoManager

public WorldObjectManager getWoManager()

addTimedMotionUnit

public void addTimedMotionUnit(TimedMotionUnit tmu)

predict

public void predict(double time)

reset

public void reset()
Resets all controllers, mixed systems (that is: restores their start physical humanoids and sets connector velocity to 0) and sets vPrev, vNext and vCurr to their pose at initialization

Specified by:
reset in interface Player

getInvalidBehaviors

public Set<String> getInvalidBehaviors()

setResetPose

public void setResetPose()
Sets the reset pose to the current vNext. The reset pose gets set to all the mixed systems whenever the the reset function is called. Typical workflow:
1. player = new AnimationPlayer(...
2. vNext = player.getVNext();
3. set pose in vNext
4. vNext.calculateMatrices();
5. player.setResetPose();


exception

public void exception(BMLExceptionFeedback e)

addExceptionListener

public void addExceptionListener(BMLExceptionListener ws)
Specified by:
addExceptionListener in interface Player

removeAllExceptionListeners

public void removeAllExceptionListeners()
Specified by:
removeAllExceptionListeners in interface Player

puException

public void puException(PlanUnit timedMU,
                        String message,
                        double time)
Callback for behaviors

Specified by:
puException in interface PUExceptionCallback

step

public void step(float prevTime)

copyPhysics

public void copyPhysics()

getControllers

public ArrayList<PhysicalController> getControllers()
Returns:
the controllers

getVNext

public VJoint getVNext()
Get the set of joints that is to be animated

Returns:
the vNext

getVPrev

public VJoint getVPrev()
Get the prev set of joints that is to be animated

Returns:
the vPrev

getVCurr

public VJoint getVCurr()
Get the current set of joints that is to be animated

Returns:
the vCurr

getVPredict

public VJoint getVPredict()
Get the predicted joint rotation


getPHuman

public PhysicalHumanoid getPHuman()
Returns:
the pHuman

getStepTime

public float getStepTime()
Returns:
the stepTime

clearAll

public void clearAll(double time)

getMixedSystems

public ArrayList<MixedSystem> getMixedSystems()
Returns:
the mSystems

setBMLBlockState

public void setBMLBlockState(String bmlId,
                             PlanUnitState state)
Specified by:
setBMLBlockState in interface Player

getEndTime

public double getEndTime(String behId,
                         String bmlId)
Specified by:
getEndTime in interface Player

getBehaviours

public Set<String> getBehaviours(String bmlId)
Specified by:
getBehaviours in interface Player

interruptBehaviourBlock

public void interruptBehaviourBlock(String bmlId,
                                    double time)
Description copied from interface: Player
Interrupts all behaviors in the block; that is: calls their stop and removes them from the plan

Specified by:
interruptBehaviourBlock in interface Player

setParameterValue

public void setParameterValue(String behId,
                              String bmlId,
                              String paramId,
                              float value)
Specified by:
setParameterValue in interface Player

setParameterValue

public void setParameterValue(String behId,
                              String bmlId,
                              String paramId,
                              String value)
Specified by:
setParameterValue in interface Player

shutdown

public void shutdown()
Description copied from interface: Player
Clean up resources constructed with the planner (e.g. for native stuff, spawned threads, ...). A planner should not be (re)used after shutting it down.

Specified by:
shutdown in interface Player