hmi.elckerlyc.animationengine.pointing
Class PointingMU

java.lang.Object
  extended by hmi.elckerlyc.animationengine.motionunit.AbstractMotionUnit
      extended by hmi.elckerlyc.animationengine.pointing.PointingMU
All Implemented Interfaces:
KeyPositionManager, MotionUnit
Direct Known Subclasses:
DynamicPointingMU

public class PointingMU
extends AbstractMotionUnit

Timing: ready: gaze target reached relax: start to move back to rest pose (for now 0 rotation of neck joints)

Author:
welberge TODO: return to resting pose (requires resting pose :) TODO: Fitts' law based default timing TODO: Predictor TODO: Double-hand point

Field Summary
protected  String elbowId
           
protected  String fingerTipId
           
protected  String hand
           
protected  AnimationPlayer player
           
protected  double preparationDuration
           
protected  float[] qElbow
           
protected  float[] qElbowStart
           
protected  float[] qShoulder
           
protected  float[] qShoulderStart
           
protected  float[] qTemp
           
protected  KeyPosition ready
           
protected  KeyPosition relax
           
protected  String shoulderId
           
protected  AnalyticalIKSolver solver
           
protected  String target
           
protected  TimeManipulator tmp
           
protected  float[] vecTemp
           
protected  float[] vecTemp2
           
protected  VJoint vjElbow
           
protected  VJoint vjFingerTip
           
protected  VJoint vjShoulder
           
protected  VJoint vjWrist
           
protected  WorldObjectManager woManager
           
protected  WorldObject woTarget
           
protected  String wristId
           
 
Constructor Summary
PointingMU()
           
PointingMU(VJoint shoulder, VJoint elbow, VJoint wrist, VJoint fingerTip)
           
 
Method Summary
 PointingMU copy(AnimationPlayer p)
          Create a copy of this motion unit and link it to the animationplayer
 TimedMotionUnit createTMU(BMLBlockPeg bbPeg, String i, String bmlId)
          Creates the TimedMotionUnit corresponding to this motion unit
 String getParameterValue(String name)
           
 MotionUnit getPredictor(VJoint predict)
          Creates a gaze predictor.
 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 setEndRotation(float[] vecPos)
           
 void setHand(String hand)
           
 void setParameterValue(String name, float value)
           
 void setParameterValue(String name, String value)
           
 void setStartPose(double prep)
           
 void setTarget(String target)
           
 void setTimeManipulator(TimeManipulator tmp)
          Set the time manimpulator that describes the velocity profile for attack and decay.
private  void setupSolver()
           
 
Methods inherited from class hmi.elckerlyc.animationengine.motionunit.AbstractMotionUnit
addKeyPosition, getKeyPosition, getKeyPositions, removeKeyPosition, setKeyPositions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

qShoulder

protected float[] qShoulder

qElbow

protected float[] qElbow

qShoulderStart

protected float[] qShoulderStart

qElbowStart

protected float[] qElbowStart

qTemp

protected float[] qTemp

vecTemp

protected float[] vecTemp

vecTemp2

protected float[] vecTemp2

ready

protected KeyPosition ready

relax

protected KeyPosition relax

player

protected AnimationPlayer player

woManager

protected WorldObjectManager woManager

target

protected String target

tmp

protected TimeManipulator tmp

vjShoulder

protected VJoint vjShoulder

vjElbow

protected VJoint vjElbow

vjWrist

protected VJoint vjWrist

vjFingerTip

protected VJoint vjFingerTip

shoulderId

protected String shoulderId

elbowId

protected String elbowId

wristId

protected String wristId

fingerTipId

protected String fingerTipId

solver

protected AnalyticalIKSolver solver

hand

protected String hand

woTarget

protected WorldObject woTarget

preparationDuration

protected double preparationDuration
Constructor Detail

PointingMU

public PointingMU()

PointingMU

public PointingMU(VJoint shoulder,
                  VJoint elbow,
                  VJoint wrist,
                  VJoint fingerTip)
Method Detail

setupSolver

private void setupSolver()

copy

public PointingMU copy(AnimationPlayer p)
Description copied from interface: MotionUnit
Create a copy of this motion unit and link it to the animationplayer


setTarget

public void setTarget(String target)
               throws MUPlayException
Throws:
MUPlayException

setStartPose

public void setStartPose(double prep)
                  throws MUPlayException
Throws:
MUPlayException

setEndRotation

public void setEndRotation(float[] vecPos)
Parameters:
gazeDir - gaze direction

getPredictor

public MotionUnit getPredictor(VJoint predict)
Creates a gaze predictor. The gaze predictor starts at whatever start pose the first call to play on its TMU will set. This also locks the target pos. Since the GazeMU allows flexible start poses, it's not very handy nor needed to use a prediction on any time before the ready sync.

Parameters:
predict - VJoint to execute the prediction on
Returns:
predictor motion unit

getPreferedDuration

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

setHand

public void setHand(String hand)

play

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

Parameters:
t - execution time, 0 < t < 1

createTMU

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

i - behaviour id
bmlId - BML block id
Returns:
the TMU

setParameterValue

public void setParameterValue(String name,
                              String value)

getParameterValue

public String getParameterValue(String name)

setParameterValue

public void setParameterValue(String name,
                              float value)

setTimeManipulator

public void setTimeManipulator(TimeManipulator tmp)
Set the time manimpulator that describes the velocity profile for attack and decay. Default is SigmoidManipulator(3,4)


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