|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.xml.XMLStructureAdapter
hmi.elckerlyc.animationengine.procanimation.ProcAnimationMU
public class ProcAnimationMU
Generic procedural animation package Animation is described as end effector path, joint rotation
path and/or joint positions at key times
Typical program flow:
1. load proc animation through XML
2. setup an IKBody
3. link the IKBody to the proc animation through the setup function
4. animate using the play function
| Nested Class Summary | |
|---|---|
(package private) static class |
ProcAnimationMU.IKParameter
|
| Field Summary | |
|---|---|
private IKBody |
body
|
private Set<String> |
bodyPartFilter
|
private Set<VJoint> |
bodyParts
|
private ArrayList<EndEffector> |
endeffector
|
private float[] |
goal
|
Id |
id
|
private List<KeyframeMU> |
keyFrameMUs
|
private HashMap<String,Keyframes> |
keyframes
|
private KeyPositionManager |
keyPositionManager
|
private EndEffector |
leftFootEff
|
private EndEffector |
leftHandEff
|
private float[] |
lf
|
private float[] |
lh
|
private double |
maxDuration
|
private double |
minDuration
|
private ArrayList<ProcAnimationMU.IKParameter> |
parameters
|
private org.lsmp.djep.xjep.XJep |
parser
|
private double |
prefDuration
|
private float[] |
q
|
private float[] |
rf
|
private float[] |
rh
|
private EndEffector |
rightFootEff
|
private EndEffector |
rightHandEff
|
private float[] |
ro
|
private EndEffector |
rootEff
|
private HashMap<String,Rotation> |
rotations
|
private org.nfunk.jep.Variable |
tVar
|
| Fields inherited from class hmi.xml.XMLStructureAdapter |
|---|
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB, TAB_STRING |
| Constructor Summary | |
|---|---|
ProcAnimationMU()
Constructor |
|
| Method Summary | |
|---|---|
void |
addEndEffector(EndEffector eff)
Adds an endeffector |
void |
addKeyframes(Keyframes kf)
Adds a keyframe |
void |
addKeyPosition(KeyPosition kp)
|
void |
addParameter(Parameter p)
Adds a parameter |
void |
addSkeletonInterpolator(SkeletonInterpolator ski)
|
StringBuilder |
appendAttributeString(StringBuilder buf)
Appends a String to buf that encodes the attributes for the XML encoding. |
StringBuilder |
appendContent(StringBuilder buf,
XMLFormatting fmt)
Appends a String to buf that encodes the contents for the XML encoding. |
private boolean |
containsOnlyLetters(String str)
Checks if the given String only contains letters |
MotionUnit |
copy(AnimationPlayer p)
Create a copy of this motion unit and link it to the animationplayer |
MotionUnit |
copy(VJoint v)
Creates a copy of this ProcAnimation and links is to VJoint v |
TimedMotionUnit |
createTMU(BMLBlockPeg bbPeg,
String i,
String bmlId)
Creates the TimedMotionUnit corresponding to this motion unit |
boolean |
decodeAttribute(String attrName,
String attrValue)
decodes the value from an attribute value String returns true if succesful, returns false for attribute names that are not recognized. |
boolean |
decodeAttribute(String attrName,
String attrValue,
XMLTokenizer tokenizer)
decodes the value from an attribute value String returns true if succesful, returns false for attribute names that are not recognized. |
void |
decodeContent(XMLTokenizer tokenizer)
decodes the XML contents, i.e. the XML between the STag and ETag of the encoding. |
ProcAnimationMU |
deepCopy()
Creates a copy of this ProcAnimation. |
private void |
filterBodyParts()
|
private void |
findMissingParameters()
|
List<EndEffector> |
getAllEndEffectors()
Returns the complete arraylist with EndEffectors |
Set<VJoint> |
getControlledJoints()
Gets the joints steered with this ProcAnimation |
EndEffector |
getEndEffector(String target)
Get the EndEffector with sid target |
private ProcAnimationMU.IKParameter |
getIKParameter(String paramId)
|
KeyPosition |
getKeyPosition(String name)
|
List<KeyPosition> |
getKeyPositions()
Gets a sorted view of the list of keypositions |
EndEffector |
getLeftFootEff()
|
EndEffector |
getLeftHandEff()
|
double |
getMaxDuration()
|
double |
getMinDuration()
|
Collection<Parameter> |
getParameters()
Gets the parameters |
String |
getParameterValue(String name)
|
void |
getPositions(float[] lf,
float[] rf,
float[] lh,
float[] rh,
float[] root,
double[] swivels)
Get the current endeffector IK info |
MotionUnit |
getPredictor(VJoint predict)
Creates a copy of this ProcAnimation, but links the parameters of the copy directly to this animation. |
double |
getPrefDuration()
|
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 |
EndEffector |
getRightFootEff()
|
EndEffector |
getRightHandEff()
|
EndEffector |
getRootEff()
|
Rotation |
getRotation(String target)
Returns the Rotation of the given target |
HashMap<String,Rotation> |
getRotations()
|
String |
getXMLTag()
returns the XML tag that is used to encode this type of XMLStructure. |
private boolean |
isConstantParameter(String str)
|
void |
mirror()
|
private boolean |
parameterExists(String str)
Checks if a parameter exists with the given name |
void |
play(double t)
Play the IKAnimation at time 0 < t < 1 First plays all skeletoninterpolators, then sets the joints starting at the root as specified by IK and keyframes |
private void |
play(double t,
VJoint v)
|
void |
removeEndEffector(String name)
Removes all endeffectors with target name |
void |
removeKeyPosition(String id)
|
void |
removeRotation(String name)
Removes a rotation |
void |
set(ProcAnimationMU ani)
Sets to ani, copies over all of ani's properties |
void |
setEffectors(ProcAnimationMU ik)
Set the endeffectors of another ProcAnimation into this animation. |
void |
setEndEffector(String name,
String xForm,
String yForm,
String zForm,
String sForm,
boolean isLocal)
Sets a end effector to a certain formula, adds it to the endeffector list if it does not exist yet |
void |
setEndEffectors(ArrayList<EndEffector> newEndEffectors)
Set a new set of EndEffectors |
void |
setKeyframes(HashMap<String,Keyframes> frs)
Set the keyframes to frs |
void |
setKeyPositions(List<KeyPosition> p)
|
void |
setMaxDuration(double maxDuration)
|
void |
setMinDuration(double minDuration)
|
void |
setParameters(Collection<Parameter> ps)
Sets the parameters the parameters in ps, retaining the 'old' parameters that not are part of ps |
void |
setParameterValue(String sid,
float value)
Sets the parameter value for parameter sid. |
void |
setParameterValue(String name,
String value)
|
private void |
setParameterValues()
|
void |
setPrefDuration(double prefDuration)
|
void |
setRotation(String name,
String xForm,
String yForm,
String zForm)
Sets a rotation to a certain formula, adds it to the rotation list if it does not exist yet |
void |
setRotations(HashMap<String,Rotation> rots)
Set the rotations |
void |
setRotations(ProcAnimationMU ik)
Copies the rotations from another ProcAnimation Rotations that occur in ik but not in this ProcAnimation are ignored |
void |
setup(Collection<Parameter> params,
IKBody b)
Links the ProcAnimation to a body and a set of parameters Filters out the joints to animate based on the set Rotations, end effectors, keyframes and skeletoninterpolators |
private void |
setupEndEffectors()
|
private void |
setupParser()
|
String |
toString()
Get the id string |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Id id
private ArrayList<EndEffector> endeffector
private List<KeyframeMU> keyFrameMUs
private HashMap<String,Rotation> rotations
private HashMap<String,Keyframes> keyframes
private Set<VJoint> bodyParts
private Set<String> bodyPartFilter
private EndEffector rootEff
private EndEffector rightFootEff
private EndEffector leftFootEff
private EndEffector rightHandEff
private EndEffector leftHandEff
private double minDuration
private double maxDuration
private double prefDuration
private org.lsmp.djep.xjep.XJep parser
private org.nfunk.jep.Variable tVar
private ArrayList<ProcAnimationMU.IKParameter> parameters
private IKBody body
private KeyPositionManager keyPositionManager
private float[] lf
private float[] rf
private float[] lh
private float[] rh
private float[] goal
private float[] q
private float[] ro
| Constructor Detail |
|---|
public ProcAnimationMU()
| Method Detail |
|---|
public void addSkeletonInterpolator(SkeletonInterpolator ski)
public Set<VJoint> getControlledJoints()
public KeyPosition getKeyPosition(String name)
getKeyPosition in interface KeyPositionManagerpublic void addKeyPosition(KeyPosition kp)
addKeyPosition in interface KeyPositionManagerpublic void removeKeyPosition(String id)
removeKeyPosition in interface KeyPositionManagerpublic List<KeyPosition> getKeyPositions()
KeyPositionManager
getKeyPositions in interface KeyPositionManagerpublic void setKeyPositions(List<KeyPosition> p)
setKeyPositions in interface KeyPositionManagerpublic void mirror()
public ProcAnimationMU deepCopy()
public double getPreferedDuration()
getPreferedDuration in interface MotionUnitpublic void set(ProcAnimationMU ani)
public void removeRotation(String name)
public void setRotation(String name,
String xForm,
String yForm,
String zForm)
throws org.nfunk.jep.ParseException
name - name of the targetxForm - x formulayForm - y formulazForm - z formula
org.nfunk.jep.ParseException
public void setEndEffector(String name,
String xForm,
String yForm,
String zForm,
String sForm,
boolean isLocal)
name - name of the targetxForm - x formulayForm - y formulazForm - z formulapublic void setRotations(HashMap<String,Rotation> rots)
rotations - The rotations to set.
public void setParameterValue(String sid,
float value)
setParameterValue in interface MotionUnitpublic void setKeyframes(HashMap<String,Keyframes> frs)
public void setRotations(ProcAnimationMU ik)
ik - the IKAnimation to copy fromprivate void setParameterValues()
public void setParameters(Collection<Parameter> ps)
parameters - - the list of parameters to setprivate ProcAnimationMU.IKParameter getIKParameter(String paramId)
public void addKeyframes(Keyframes kf)
public void addParameter(Parameter p)
public void setEffectors(ProcAnimationMU ik)
public void setEndEffectors(ArrayList<EndEffector> newEndEffectors)
the - new list of EndEffectorspublic EndEffector getEndEffector(String target)
target - the sid of the endeffector to obtain
public List<EndEffector> getAllEndEffectors()
public void addEndEffector(EndEffector eff)
eff - endeffector to addpublic void removeEndEffector(String name)
name - the targetpublic HashMap<String,Rotation> getRotations()
public Rotation getRotation(String target)
the - target
public void getPositions(float[] lf,
float[] rf,
float[] lh,
float[] rh,
float[] root,
double[] swivels)
lf - output: left foot vectorrf - output: right foot positionlh - output: left hand positionrh - output: right hand positionroot - output: root positionswivels - output: swivel rotations of respectively left foot, rightfoot, lefthand, right
handpublic Collection<Parameter> getParameters()
private void setupEndEffectors()
public void setup(Collection<Parameter> params,
IKBody b)
private void filterBodyParts()
private void findMissingParameters()
private boolean containsOnlyLetters(String str)
private boolean isConstantParameter(String str)
private boolean parameterExists(String str)
private void play(double t,
VJoint v)
public void play(double t)
play in interface MotionUnitt - 0 <= t <= 1 the time positionpublic double getMaxDuration()
public void setMaxDuration(double maxDuration)
maxDuration - The new maxDuration in secondspublic double getMinDuration()
public void setMinDuration(double minDuration)
minDuration - The minDuration to set, in secondspublic double getPrefDuration()
public void setPrefDuration(double prefDuration)
prefDuration - the prefered duration (in seconds) of this ProcAnimationpublic String toString()
toString in class XMLStructureAdapterprivate void setupParser()
public EndEffector getLeftFootEff()
public EndEffector getLeftHandEff()
public EndEffector getRightFootEff()
public EndEffector getRightHandEff()
public EndEffector getRootEff()
public MotionUnit copy(AnimationPlayer p)
MotionUnit
copy in interface MotionUnitpublic MotionUnit copy(VJoint v)
public MotionUnit getPredictor(VJoint predict)
getPredictor in interface MotionUnitpredict - VJoint to execute the prediction on
public boolean decodeAttribute(String attrName,
String attrValue)
XMLStructureAdapter
decodeAttribute in class XMLStructureAdapter
public boolean decodeAttribute(String attrName,
String attrValue,
XMLTokenizer tokenizer)
XMLStructureAdapter
decodeAttribute in class XMLStructureAdapter
public void decodeContent(XMLTokenizer tokenizer)
throws IOException
XMLStructureAdapter
decodeContent in class XMLStructureAdapterIOException
public StringBuilder appendContent(StringBuilder buf,
XMLFormatting fmt)
XMLStructureAdapter
appendContent in class XMLStructureAdapterpublic StringBuilder appendAttributeString(StringBuilder buf)
XMLStructureAdapter
appendAttributeString in class XMLStructureAdapterpublic String getXMLTag()
XMLStructureAdapter
getXMLTag in interface XMLStructuregetXMLTag in class XMLStructureAdapter
public void setParameterValue(String name,
String value)
setParameterValue in interface MotionUnitpublic String getParameterValue(String name)
getParameterValue in interface MotionUnit
public TimedMotionUnit createTMU(BMLBlockPeg bbPeg,
String i,
String bmlId)
MotionUnit
createTMU in interface MotionUniti - behaviour idbmlId - BML block id
public String getReplacementGroup()
MotionUnit
getReplacementGroup in interface MotionUnit
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||