hmi.elckerlyc.animationengine.keyframe
Class KeyframeMU

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

public class KeyframeMU
extends Object
implements MotionUnit

Motion unit for keyframe/mocap motion specified in a SkeletonInterpolator.

Author:
Herwin van Welbergen

Field Summary
private  SkeletonInterpolator baseIp
           
private  SkeletonInterpolator currentIp
           
private  Set<String> filter
           
private  KeyPositionManager keyPositionManager
           
private  boolean mirror
           
private  HashMap<String,String> parameters
           
 
Constructor Summary
KeyframeMU(SkeletonInterpolator si)
           
 
Method Summary
 void addKeyPosition(KeyPosition kp)
           
private  void applyParameters()
           
 MotionUnit copy(AnimationPlayer p)
          Create a copy of this motion unit and link it to the animationplayer
 MotionUnit copy(VJoint v)
           
 TimedMotionUnit createTMU(BMLBlockPeg bbPeg, String i, String bmlId)
          Creates the TimedMotionUnit corresponding to this motion unit
 void filterJoints(Set<String> jointFilter)
           
 Set<String> getJoints()
           
 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
 SkeletonInterpolator getSkeletonInterpolator()
           
 void play(double t)
          Executes the motion unit, typically by rotating some VJoints
 void removeKeyPosition(String id)
           
 void setKeyPositions(List<KeyPosition> p)
           
 void setParameterValue(String name, float value)
           
 void setParameterValue(String name, String value)
           
 void setTarget(VJoint v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseIp

private SkeletonInterpolator baseIp

currentIp

private SkeletonInterpolator currentIp

parameters

private HashMap<String,String> parameters

keyPositionManager

private KeyPositionManager keyPositionManager

mirror

private boolean mirror

filter

private Set<String> filter
Constructor Detail

KeyframeMU

public KeyframeMU(SkeletonInterpolator si)
Method Detail

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

removeKeyPosition

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

setTarget

public void setTarget(VJoint v)

getJoints

public Set<String> getJoints()

getKeyPosition

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

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

applyParameters

private void applyParameters()

filterJoints

public void filterJoints(Set<String> jointFilter)

getSkeletonInterpolator

public SkeletonInterpolator getSkeletonInterpolator()
Returns:
the unfiltered, unmirrored etc skeletonInterpolator

copy

public MotionUnit copy(VJoint v)

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

copy

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

Specified by:
copy in interface MotionUnit

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