hmi.elckerlyc.animationengine.controller
Class ControllerMU

java.lang.Object
  extended by hmi.elckerlyc.animationengine.controller.ControllerMU
All Implemented Interfaces:
KeyPositionManager, MotionUnit

public class ControllerMU
extends Object
implements MotionUnit

MotionUnit for a physical controller

Author:
Herwin van Welbergen

Field Summary
private  PhysicalController controller
           
private  List<PhysicalController> controllerList
           
private  KeyPositionManager keyPositionManager
           
private  String replacementgroup
           
 
Constructor Summary
ControllerMU(PhysicalController pc, List<PhysicalController> pcl)
          Constructor
 
Method Summary
 void addKeyPosition(KeyPosition kp)
           
 MotionUnit copy(AnimationPlayer p)
          Create a copy for use in animation player p (that is, link up to its VNext, PhysicalHumanoid, physically steered joint list
 ControllerMU copy(PhysicalHumanoid ph)
           
 TimedMotionUnit createTMU(BMLBlockPeg bbPeg, String i, String bmlId)
          Creates the TimedMotionUnit corresponding to this motion unit
 KeyPosition getKeyPosition(String name)
           
 List<KeyPosition> getKeyPositions()
          Gets a sorted view of the list of keypositions
 String getParameterValue(String name)
           
 MotionUnit getPredictor(VJoint predict)
          Returns a new motion unit that can be used as a predictor for this motion unit, null if prediction is not attainable
 double getPreferedDuration()
           
 String getReplacementGroup()
          Get the motionunit replacement group (=typically the BML behavior) Used to determine the currently active persistent TMU for this group in the player Only one group is active at a time
 void play(double t)
          Executes the motion unit, typically by rotating some VJoints
 void removeKeyPosition(String id)
           
 void reset()
           
 void setKeyPositions(List<KeyPosition> p)
           
 void setParameterValue(String name, float value)
           
 void setParameterValue(String name, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controller

private PhysicalController controller

controllerList

private List<PhysicalController> controllerList

replacementgroup

private String replacementgroup

keyPositionManager

private KeyPositionManager keyPositionManager
Constructor Detail

ControllerMU

public ControllerMU(PhysicalController pc,
                    List<PhysicalController> pcl)
Constructor

Parameters:
pc - physical controller linked to the motion unit
pcl - physical controller list. This ControllerMU adds the controller to this list whenever it's playing.
Method Detail

getPreferedDuration

public double getPreferedDuration()
Specified by:
getPreferedDuration in interface MotionUnit
Returns:
Prefered duration (in seconds) of this motion unit, 0 means not determined/infinite

play

public void play(double t)
Description copied from interface: MotionUnit
Executes the motion unit, typically by rotating some VJoints

Specified by:
play in interface MotionUnit
Parameters:
t - execution time, 0 < t < 1

getPredictor

public MotionUnit getPredictor(VJoint predict)
Description copied from interface: MotionUnit
Returns a new motion unit that can be used as a predictor for this motion unit, null if prediction is not attainable

Specified by:
getPredictor in interface MotionUnit
Parameters:
predict - VJoint to execute the prediction on
Returns:
predictor motion unit

copy

public ControllerMU copy(PhysicalHumanoid ph)

copy

public MotionUnit copy(AnimationPlayer p)
Create a copy for use in animation player p (that is, link up to its VNext, PhysicalHumanoid, physically steered joint list

Specified by:
copy in interface MotionUnit
Parameters:
p - animation player to use the MotionUnit in

setParameterValue

public void setParameterValue(String name,
                              float value)
Specified by:
setParameterValue in interface MotionUnit

setParameterValue

public void setParameterValue(String name,
                              String value)
Specified by:
setParameterValue in interface MotionUnit

getParameterValue

public String getParameterValue(String name)
Specified by:
getParameterValue in interface MotionUnit

createTMU

public TimedMotionUnit createTMU(BMLBlockPeg bbPeg,
                                 String i,
                                 String bmlId)
Description copied from interface: MotionUnit
Creates the TimedMotionUnit corresponding to this motion unit

Specified by:
createTMU in interface MotionUnit
i - behaviour id
bmlId - BML block id
Returns:
the TMU

getReplacementGroup

public String getReplacementGroup()
Description copied from interface: MotionUnit
Get the motionunit replacement group (=typically the BML behavior) Used to determine the currently active persistent TMU for this group in the player Only one group is active at a time

Specified by:
getReplacementGroup in interface MotionUnit

reset

public void reset()

addKeyPosition

public void addKeyPosition(KeyPosition kp)
Specified by:
addKeyPosition in interface KeyPositionManager

getKeyPositions

public List<KeyPosition> getKeyPositions()
Description copied from interface: KeyPositionManager
Gets a sorted view of the list of keypositions

Specified by:
getKeyPositions in interface KeyPositionManager

setKeyPositions

public void setKeyPositions(List<KeyPosition> p)
Specified by:
setKeyPositions in interface KeyPositionManager

getKeyPosition

public KeyPosition getKeyPosition(String name)
Specified by:
getKeyPosition in interface KeyPositionManager

removeKeyPosition

public void removeKeyPosition(String id)
Specified by:
removeKeyPosition in interface KeyPositionManager