|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.xml.XMLStructureAdapter
hmi.animation.SkeletonInterpolator
public class SkeletonInterpolator
A SkeletonInterpolator is an interpolator for simultaneous animation of several selected parts of a VObject tree. It is assumed that the joints of this skeleton tree have rotations that are to be interpolated. Optionally, the root joint has also a translation that must be interpolated. Scaling, if any, or translation of joints other than the root are considered to be fixed.
| Field Summary | |
|---|---|
private float[] |
buf
|
private ConfigList |
configs
|
private int |
configSize
|
private String |
configType
|
private static String[] |
empty_PartIds
|
private boolean |
hasAngularVelocity
|
private boolean |
hasRootTranslation
|
private boolean |
hasRotation
|
private boolean |
hasScale
|
private boolean |
hasTranslation
|
private boolean |
hasVelocity
|
private double |
interval
|
private static org.slf4j.Logger |
logger
|
private float[] |
lowerConfig
|
private int |
lowerIndex
|
private double |
lowerTime
|
private String[] |
partIds
|
private String |
rotationEncoding
|
private int |
stride
|
private VJoint |
target
|
private VObject[] |
targetParts
|
private float[] |
upperConfig
|
private int |
upperIndex
|
private double |
upperTime
|
private static String |
XMLTAG
|
| Fields inherited from class hmi.xml.XMLStructureAdapter |
|---|
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB, TAB_STRING |
| Constructor Summary | |
|---|---|
SkeletonInterpolator()
|
|
SkeletonInterpolator(SkeletonInterpolator p)
|
|
SkeletonInterpolator(SkeletonInterpolator p,
VObject[] targetParts)
|
|
SkeletonInterpolator(String[] partIds,
ConfigList configs,
String configType)
Creates a new SkeletonInterpolator for a specified ConfigList, VParts, and Config type. |
|
SkeletonInterpolator(XMLTokenizer tokenizer)
Creates a new, uninitialized, SkeletonInterpolator |
|
| Method Summary | |
|---|---|
StringBuilder |
appendAttributeString(StringBuilder buf)
Appends a String of signature attributes to buf |
StringBuilder |
appendContent(StringBuilder buf,
XMLFormatting fmt)
Appends the config elements as XML content. |
private void |
calculateConfigSize()
|
private void |
convertFromAxisAngles()
|
void |
decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
decodes the XML attributes |
void |
decodeContent(String data)
|
void |
decodeContent(XMLTokenizer xmlTokenizer)
Decodes XML content, and converts it into the double time values and float cofig data. |
void |
filterJoints(Set<String> joints)
Filter out all parts that are not in joints |
private void |
filterTargetParts(Set<String> joints)
|
float[] |
getConfig(int i)
Returns the Config at index i |
ConfigList |
getConfigList()
Gets the Config list |
int |
getConfigSize()
Returns the (uniform) size of configs, in number of floats. |
String |
getConfigType()
Returns the configuration type, as encoded conform VOBject types. |
double |
getEndTime()
|
float[] |
getInterpolatedConfig(double t,
float[] conf)
Returns the interpolated config array for the specified time t, in the specified conf float array. |
private float |
getInterpolationConfigs(double t)
Finds the interval [lowerIndex, upperIndex] for a specified time t, such that time[lowerIndex] <= t < time[upperIndex], where upperIndex == lowerIndex+1. |
String[] |
getPartIds()
Returns the list of ids of the VObject parts that are influenced by this interpolator. |
double |
getStartTime()
|
VObject[] |
getTargetParts()
|
double |
getTime(int i)
Returns the time for config i |
private int |
getWidth(int partIndex)
|
String |
getXMLTag()
The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object |
void |
initTime(double t)
The time method for the ClockListener interface; equivalent to interpolateTargetParts |
void |
interpolateMillis(long time)
calculates the current config for the specified time in milliseconds and copies it to the current target |
void |
interpolateTargetParts(double time)
Interpolates two float array configurations lowerConfig and upperConfig, and places the result in the target VObjects. |
void |
mirror()
Mirrors all joint rotations on the XY plane, switches left/right partIds |
private void |
mirrorParts(int i)
|
static SkeletonInterpolator |
read(Resources resources,
String fileName)
Creates a new SkeletonInterpolator from an XML encoded file. |
static SkeletonInterpolator |
read(String fileName)
Creates a new SkeletonInterpolator from an XML encoded file. |
static SkeletonInterpolator |
read(String resourceDir,
String fileName)
Creates a new SkeletonInterpolator from an XML encoded file. |
void |
sampleTargetParts(double time)
Samples the transformations from the target VObjects, and stores these as configuration, sor the specified time. |
void |
setConfigList(ConfigList configs)
Sets the ConfigList, defining the VPartsConfigs to be interpolated. |
void |
setConfigType(String configType)
|
void |
setPartIds(String[] partIds)
Sets the list of VObject ids/sids |
void |
setRotationEncoding(String rotationEncoding)
|
void |
setTarget(VJoint target)
Sets a specified VJoint as target for interpolation A lookup is performed for parts of the target with Id/Sid/Name as defined by the partIds for this interpolator. |
void |
setTargetParts(int c)
Set targetparts to the configlist at frame c |
int |
size()
returns the size of the list |
void |
time(double t)
The time method for the ClockListener interface; equivalent to interpolateTargetParts |
static String |
xmlTag()
The XML Stag for XML encoding -- use this static method when you want to see if a given String equals the xml tag for this class |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static org.slf4j.Logger logger
private static final String[] empty_PartIds
private String[] partIds
private ConfigList configs
private String configType
private int configSize
private int stride
private boolean hasRootTranslation
private boolean hasTranslation
private boolean hasRotation
private boolean hasScale
private boolean hasVelocity
private boolean hasAngularVelocity
private String rotationEncoding
private VObject[] targetParts
private VJoint target
private int lowerIndex
private int upperIndex
private double lowerTime
private double upperTime
private double interval
private float[] lowerConfig
private float[] upperConfig
private float[] buf
private static final String XMLTAG
| Constructor Detail |
|---|
public SkeletonInterpolator(XMLTokenizer tokenizer)
throws IOException
IOException
public SkeletonInterpolator(String[] partIds,
ConfigList configs,
String configType)
public SkeletonInterpolator(SkeletonInterpolator p,
VObject[] targetParts)
public SkeletonInterpolator(SkeletonInterpolator p)
public SkeletonInterpolator()
| Method Detail |
|---|
public void setConfigList(ConfigList configs)
public ConfigList getConfigList()
public void setPartIds(String[] partIds)
public String[] getPartIds()
public String getConfigType()
public void setConfigType(String configType)
private void calculateConfigSize()
public void setRotationEncoding(String rotationEncoding)
public int getConfigSize()
public int size()
public double getTime(int i)
public float[] getConfig(int i)
public double getStartTime()
public double getEndTime()
public void setTarget(VJoint target)
private int getWidth(int partIndex)
private void filterTargetParts(Set<String> joints)
public void filterJoints(Set<String> joints)
public void interpolateMillis(long time)
public float[] getInterpolatedConfig(double t,
float[] conf)
public void initTime(double t)
initTime in interface ClockListenerpublic void time(double t)
time in interface ClockListenerpublic void setTargetParts(int c)
public void interpolateTargetParts(double time)
private final float getInterpolationConfigs(double t)
public void sampleTargetParts(double time)
private void mirrorParts(int i)
public void mirror()
public StringBuilder appendAttributeString(StringBuilder buf)
appendAttributeString in class XMLStructureAdapter
public void decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
decodeAttributes in class XMLStructureAdapter
public StringBuilder appendContent(StringBuilder buf,
XMLFormatting fmt)
appendContent in class XMLStructureAdapter
public void decodeContent(XMLTokenizer xmlTokenizer)
throws IOException
decodeContent in class XMLStructureAdapterIOExceptionpublic void decodeContent(String data)
private void convertFromAxisAngles()
public static SkeletonInterpolator read(Resources resources,
String fileName)
throws IOException
IOException
public static SkeletonInterpolator read(String resourceDir,
String fileName)
throws IOException
IOException
public static SkeletonInterpolator read(String fileName)
throws IOException
IOExceptionpublic static String xmlTag()
public String getXMLTag()
getXMLTag in interface XMLStructuregetXMLTag in class XMLStructureAdapterpublic VObject[] getTargetParts()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||