|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.xml.XMLStructureAdapter
hmi.animation.VJoint
public class VJoint
VJoint represent virtual joints...
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface hmi.animation.VObject |
|---|
VObject.Predicate |
| Field Summary | |
|---|---|
private ArrayList<VJoint> |
children
|
static int |
DEFAULTCAPACITY
|
private float[] |
globalMatrix
|
private boolean |
hasSharedBuffers
|
private String |
id
|
private float[] |
localMatrix
|
private static Logger |
logger
|
private String |
name
|
private VJoint |
parent
|
(package private) float[] |
q2
|
(package private) float[] |
qp
|
(package private) float[] |
qw
|
private float[] |
rotation
|
private float[] |
scaleMatrix
|
private float[] |
scaleVec
|
private Mat3f.ScalingType |
scalingType
|
private String |
sid
|
static int |
TAB
|
private float[] |
translation
|
private boolean |
validLocalMatrix
|
private static String |
XMLTAG
|
| Fields inherited from class hmi.xml.XMLStructureAdapter |
|---|
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB_STRING |
| Constructor Summary | |
|---|---|
VJoint()
Creates a new VJoint, with null name and default capacity. |
|
VJoint(String id)
Creates a new VJoint, with specified id and default capacity. |
|
VJoint(String id,
int capacity)
Creates a new VJoint, with specified id and specified capacity. |
|
VJoint(XMLTokenizer tokenizer)
Creates a new VJoint from XML |
|
| Method Summary | |
|---|---|
void |
addChild(VJoint newChild)
Adds a a child part to this VJoint. |
void |
affineTransform(float[] ma)
ma: 4x4 affine matrix of form T(tA) o U replace local transform L by ma o L o ma-inv replace translation t by U(t) |
StringBuilder |
appendAttributes(StringBuilder buf)
appends the id, sid, name XML attributes to buf. |
StringBuilder |
appendContent(StringBuilder buf,
XMLFormatting fmt)
Appends a String to buf that encodes the contents for the XML encoding. |
void |
calculateMatrices()
Equivalent to calculateMatrices(Matf4.ID) |
void |
calculateMatrices(float[] parentGlobalMatrix)
Performs a recursive tree walk over the scene graph with this VJoint as root, calculating the global and local matrices for all visited VObjects, automaticly setting all local matrices The calculation per VJoint is: globalMatrix' = parent.globalMatrix * localMatrix. |
void |
clearLocalAffineTransform()
Sets the local affine transform to identity. |
void |
clearLocalLinearTransform()
Sets the local linear transform to identity. |
void |
clearRotation()
|
void |
clearScale()
|
void |
clearTranslation()
|
VJoint |
clone()
Clones the VJoint, creates a new VJoint with the id, sid, name, translation and rotation Use @see{cloneTree} to recursively clone the VJoint and all its children |
VJoint |
cloneTree()
Clones a VJoint tree, copies the id, sid, name, translation and rotation of the clone, and generates clones for all the children of this VJoint |
void |
decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
decodes the id and sid XML attributes. |
void |
decodeContent(XMLTokenizer tokenizer)
decodes the XML contents, i.e. the XML between the STag and ETag of the encoding. |
private void |
decomposeLocalMatrix()
|
boolean |
equivId(VJoint vj)
returns true iff VJoint vj has the same non-null Id or the same non-null sid. |
boolean |
equivName(VJoint vj)
returns true iff VJoint vj has the same non-null Id or the same non-null sid or the same non-null name. |
void |
getAngularVelocity(float[] v)
Returns the current velocity vector in the form of a float array of length 3 |
void |
getAngularVelocity(float[] vc,
int vcIndex)
Returns the current velocity vector in the form of a float array of length 3 |
List<VJoint> |
getChildren()
Returns the List of child VJoints |
float[] |
getGlobalMatrix()
Returns a reference to the global transform matrix. |
boolean |
getHasSharedBuffers()
|
String |
getId()
Returns an interned String that specifies the id. |
String |
getIds()
|
float[] |
getLocalMatrix()
Returns (a reference to) the current local 4X4 transform matrix. |
String |
getName()
Returns an interned String that specifies the name. |
VJoint |
getParent()
Returns the parent of this VJoint; possibly null |
VJoint |
getPart(String partIdent)
Returns the result of a depth first search for some part identified by either id, sid, or name. |
VJoint |
getPartById(String partId)
Returns the result of a depth first search for some part identified by either id. |
VJoint |
getPartBySid(String partSid)
Returns the result of a breadth first search for some part identified by sid. |
List<VJoint> |
getParts()
|
List<VJoint> |
getParts(VObject.Predicate select)
|
List<VJoint> |
getParts(VObject.Predicate select,
VObject.Predicate prune)
|
List<VJoint> |
getParts(VObject.Predicate select,
VObject.Predicate prune,
ArrayList<VJoint> list)
|
List<VJoint> |
getPath(VJoint target)
Gets the VJoint path from target to this joint, including target and this joint |
private boolean |
getPath(VJoint target,
List<VJoint> path)
|
void |
getPathRotation(VJoint rootJoint,
float[] quat)
Calculates the "path" rotation, for the scene graph path starting at the specified root VJoint, and ending in this VJoint. |
void |
getPathTransformMatrix(VJoint rootObject,
float[] m)
Calculates the transform matrix for the scene graph path starting at the specified root VJoint, and ending in this VJoint. |
void |
getPathTranslation(VJoint rootJoint,
float[] vec)
Calculates the "path" translation, for the scene graph path starting at the specified root VJoint, and ending in this VJoint. |
float[] |
getPosition()
returns the Vec3f position of this VJoint. |
float[] |
getPosition(float[] positionVec)
returns the Vec3f position of this VJoint When the specified positionVec is non-null, this Vec3f is used and returned, otherwise a new Vec3f is allocated. |
float[] |
getRelativePositionFrom(VJoint ancestorJoint)
returns a Vec3f array with the position of this VJoint relative to the specified ancestor joint. |
void |
getRotation(float[] r)
Returns the current rotation quaternion in a float array of length four. |
void |
getRotation(float[] r,
int index)
Returns the current rotation quaternion in a float array of length four. |
float[] |
getRotationBuffer()
Returns the current rotation buffer, in the form of a float array of length four. |
void |
getScale(float[] r)
Returns the current scale vector in a float array of length three. |
void |
getScale(float[] r,
int index)
Returns the current scale vector. |
Mat3f.ScalingType |
getScalingType()
Return the scaling type: IDENTITY (i.e. no scaling), ALIGNED (i.e. vector scaling), or SKEW (matrix scaling). |
String |
getSid()
Returns an interned String that specifies the sid. |
float[] |
getSkewMatrix()
Returns the current skewing matrix, in the form of a Mat3f array. |
void |
getTranslation(float[] t)
Returns the current translation vector in the form of a float array of length 3 |
void |
getTranslation(float[] vc,
int vcIndex)
Returns the current translation vector in the form of a float array of length 3 |
float[] |
getTranslationBuffer()
Returns the current translation buffer, in the form of a float array of length three. |
void |
getVelocity(float[] v)
Unsupported VObject methods: /** Returns the current velocity vector in the form of a float array of length 3 |
void |
getVelocity(float[] vc,
int vcIndex)
Returns the current velocity vector in the form of a float array of length 3 |
List<VJoint> |
getVObjectPath(VJoint root)
Returns the path from the specified root node to this VJoint in the form of a List of VObjects. |
private List<VJoint> |
getVObjectPath(VJoint root,
List<VJoint> path)
|
String |
getXMLTag()
returns the XML tag for XML encoding |
String |
globalMatrixToString()
|
boolean |
hasRotation()
|
boolean |
hasScaling()
|
boolean |
hasTranslation()
|
private String |
idts(String s)
|
boolean |
isRigid()
Returns true when the local transform is a rigid transform, i.e. includes no scaling |
String |
localMatrixToString()
|
VJoint |
masterClone()
Make a master clone. |
VJoint |
masterCloneTree()
master-Clones a VJoint tree, copies the id, sid, name, translation and rotation of the clone, and generates master clones for all the children of this VJoint |
private void |
newLine(StringBuilder buf,
int tab)
|
void |
pathTransform(VJoint rootJoint,
float[] pt)
Calculates the "path" transform on point "pt", where all local transforms along a scene graph path are applied. |
void |
removeChild(VJoint vo)
Removes child part, if present. |
void |
rotate(float[] rq)
pre- multiplies the current rotation with the specified rotation. |
void |
rotateAxisAngle(float ax,
float ay,
float az,
float angle)
pre- multiplies the current rotation with the specified rotation, specified by axis (ax, ay, az) and an angle in radians. |
void |
rotateJoint(float[] rq)
Rotates the scenegraph, starting at this VJoint, around the origin. |
void |
rotateScaleJoint(float[] rq,
float scale)
Rotates the scenegraph, starting at this VJoint, around the origin. |
void |
scale(float s)
|
void |
scale(float sx,
float sy,
float sz)
|
private VJoint |
searchPart(String searchId)
|
private VJoint |
searchPartById(String searchId)
|
private VJoint |
searchPartBySid(String searchSid)
|
void |
setAngularVelocity(float[] v)
Sets the current velocity vector from a float array, which should have length 3. |
void |
setAngularVelocity(float[] vc,
int vcIndex)
Sets the current velocity vector by copying three floats from float array va, starting at the specified index. |
void |
setAngularVelocity(float wx,
float wy,
float wz)
Sets the current angular velocity vector from three floats. |
void |
setAxisAngle(float ax,
float ay,
float az,
float angle)
Sets the current rotation quaternion derived from a rotation axis (ax, ay, az) and a rotation angle angle, specified in radians. |
void |
setId(String id)
Sets the id for this VJoint. |
void |
setLocalMatrix(float[] matrix4f)
Sets the rotation quaternion, translation vector, scaling, as well as the local transform matrix, from the specified 4 X 4 matrix, in the form of a Mat4f float array. |
void |
setLocalTransform(float[] matrix)
Sets the local 4X4 transform matrix, and decomposes it into a rotation, translation, and scaling. |
void |
setName(String name)
Sets the name for this VJoint. |
void |
setParent(VJoint parent)
Sets the parent of this VJoint, which could be null. |
void |
setPathRotation(float[] q,
VJoint rootJoint)
Sets the rotation to q, in the coordinate system of rootJoint |
void |
setRollPitchYawDegrees(float roll,
float pitch,
float yaw)
Sets the rotation from roll-pitch-yaw angles, specified in degrees(!) |
void |
setRotation(float[] ra)
Sets the current rotation quaternion from a float array, which should have length 4. |
void |
setRotation(float[] ra,
int raIndex)
Sets the current rotation quaternion by copying four floats from float array ra, starting at the specified index. |
void |
setRotation(float qs,
float qx,
float qy,
float qz)
Sets the current rotation quaternion from four floats. |
void |
setRotationBuffer(float[] rot)
Sets the rotation buffer. |
void |
setScale(float s)
Sets the current scale vector from a float array sa, which should have length 3. |
void |
setScale(float[] sa)
Sets the current scale vector from a float array sa, which should have length 3. |
void |
setScale(float[] sa,
int saIndex)
Sets the current scale vector by copying three floats from float array sa, starting at the specified index. |
void |
setScale(float sx,
float sy,
float sz)
Sets the current scale vector from a float array sa, which should have length 3. |
void |
setSid(String sid)
Sets the sid for this VJoint. |
void |
setSkewMatrix(float[] matrix)
Sets the skewing matrix, in the form of a Mat3f matrix. |
void |
setTranslation(float[] ta)
Sets the current translation vector from a float array, which should have length 3. |
void |
setTranslation(float[] ta,
int taIndex)
Sets the current translation vector by copying three floats from float array ta, starting at the specified index. |
void |
setTranslation(float tx,
float ty,
float tz)
Sets the current translation vector from three floats. |
void |
setTranslationBuffer(float[] ta)
Sets the translation buffer. |
void |
setVelocity(float[] v)
Sets the current velocity vector from a float array, which should have length 3. |
void |
setVelocity(float[] vc,
int vcIndex)
Sets the current velocity vector by copying three floats from float array va, starting at the specified index. |
void |
setVelocity(float vx,
float vy,
float vz)
Sets the current velocity vector from three floats. |
String |
showSkeleton()
|
String |
showSkeleton(int level)
|
private void |
showSkeleton(int tab,
int level,
StringBuilder buf)
|
VJoint |
slaveClone()
make a slave clone. a slave clone is one that, just before executing calculatematrices, grabs translation and rotation from the original vjoint from which it was cloned. |
VJoint |
slaveCloneTree()
Slave-Clones a VJoint tree, copies the id, sid, name, translation and rotation of the clone, and generates slave clones for all the children of this VJoint |
String |
toString()
the default toString() method returns the result of toXMLSTring() |
void |
translate(float[] tvec)
Adds the specified translation vector to the current translation |
static String |
xmlTag()
The XML tag for XML encoding |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static Logger logger
private String id
private String sid
private String name
private VJoint parent
private ArrayList<VJoint> children
public static final int DEFAULTCAPACITY
private float[] translation
private float[] rotation
private Mat3f.ScalingType scalingType
private float[] scaleVec
private float[] scaleMatrix
private final float[] localMatrix
private final float[] globalMatrix
private boolean validLocalMatrix
private boolean hasSharedBuffers
float[] qw
float[] qp
float[] q2
public static final int TAB
private static final String XMLTAG
| Constructor Detail |
|---|
public VJoint()
public VJoint(String id)
public VJoint(String id,
int capacity)
public VJoint(XMLTokenizer tokenizer)
throws IOException
IOException| Method Detail |
|---|
public void setId(String id)
setId in interface VObjectpublic void setSid(String sid)
setSid in interface VObjectpublic void setName(String name)
setName in interface VObjectpublic String getId()
getId in interface VObjectpublic String getSid()
getSid in interface VObjectpublic String getName()
getName in interface VObjectpublic String getIds()
public boolean equivId(VJoint vj)
public boolean equivName(VJoint vj)
public Mat3f.ScalingType getScalingType()
public VJoint getParent()
public void setParent(VJoint parent)
public void addChild(VJoint newChild)
public void removeChild(VJoint vo)
public List<VJoint> getChildren()
public VJoint getPart(String partIdent)
private VJoint searchPart(String searchId)
public VJoint getPartById(String partId)
private VJoint searchPartById(String searchId)
public VJoint getPartBySid(String partSid)
private VJoint searchPartBySid(String searchSid)
public List<VJoint> getParts()
public List<VJoint> getParts(VObject.Predicate select)
public List<VJoint> getParts(VObject.Predicate select,
VObject.Predicate prune)
public List<VJoint> getParts(VObject.Predicate select,
VObject.Predicate prune,
ArrayList<VJoint> list)
private List<VJoint> getVObjectPath(VJoint root,
List<VJoint> path)
public VJoint clone()
clone in class Objectpublic VJoint cloneTree()
public VJoint masterClone()
public VJoint masterCloneTree()
public VJoint slaveClone()
public VJoint slaveCloneTree()
public List<VJoint> getVObjectPath(VJoint root)
public void getTranslation(float[] t)
getTranslation in interface VObject
public void getTranslation(float[] vc,
int vcIndex)
getTranslation in interface VObjectpublic float[] getTranslationBuffer()
public void setTranslationBuffer(float[] ta)
public void setTranslation(float[] ta)
setTranslation in interface VObject
public void setTranslation(float[] ta,
int taIndex)
setTranslation in interface VObject
public void setTranslation(float tx,
float ty,
float tz)
setTranslation in interface VObjectpublic void clearTranslation()
public void translate(float[] tvec)
public boolean hasTranslation()
public void setRotation(float[] ra)
setRotation in interface VObject
public void setPathRotation(float[] q,
VJoint rootJoint)
public void setRotation(float[] ra,
int raIndex)
setRotation in interface VObjectpublic void getRotation(float[] r)
getRotation in interface VObject
public void getRotation(float[] r,
int index)
getRotation in interface VObjectpublic float[] getRotationBuffer()
public void setRotationBuffer(float[] rot)
public void setRotation(float qs,
float qx,
float qy,
float qz)
setRotation in interface VObjectpublic void clearRotation()
public void setAxisAngle(float ax,
float ay,
float az,
float angle)
setAxisAngle in interface VObject
public void setRollPitchYawDegrees(float roll,
float pitch,
float yaw)
public void rotate(float[] rq)
public void rotateAxisAngle(float ax,
float ay,
float az,
float angle)
public boolean hasRotation()
public void rotateJoint(float[] rq)
public void rotateScaleJoint(float[] rq,
float scale)
public void affineTransform(float[] ma)
public boolean isRigid()
public void setScale(float s)
public void setScale(float sx,
float sy,
float sz)
public void scale(float sx,
float sy,
float sz)
public void scale(float s)
public void clearScale()
public void setScale(float[] sa)
setScale in interface VObject
public void setScale(float[] sa,
int saIndex)
setScale in interface VObjectpublic void getScale(float[] r)
getScale in interface VObject
public void getScale(float[] r,
int index)
getScale in interface VObjectpublic void setSkewMatrix(float[] matrix)
public float[] getSkewMatrix()
public boolean hasScaling()
public final float[] getLocalMatrix()
public void setLocalTransform(float[] matrix)
private void decomposeLocalMatrix()
public void clearLocalAffineTransform()
public void clearLocalLinearTransform()
public final void setLocalMatrix(float[] matrix4f)
public final float[] getGlobalMatrix()
public String localMatrixToString()
public String globalMatrixToString()
public void calculateMatrices()
public void calculateMatrices(float[] parentGlobalMatrix)
public void getPathTransformMatrix(VJoint rootObject,
float[] m)
public void pathTransform(VJoint rootJoint,
float[] pt)
private boolean getPath(VJoint target,
List<VJoint> path)
public List<VJoint> getPath(VJoint target)
public void getPathRotation(VJoint rootJoint,
float[] quat)
public void getPathTranslation(VJoint rootJoint,
float[] vec)
public float[] getPosition()
public float[] getPosition(float[] positionVec)
public float[] getRelativePositionFrom(VJoint ancestorJoint)
public void getVelocity(float[] v)
getVelocity in interface VObject
public void getVelocity(float[] vc,
int vcIndex)
getVelocity in interface VObjectpublic void setVelocity(float[] v)
setVelocity in interface VObject
public void setVelocity(float[] vc,
int vcIndex)
setVelocity in interface VObject
public void setVelocity(float vx,
float vy,
float vz)
setVelocity in interface VObjectpublic void getAngularVelocity(float[] v)
getAngularVelocity in interface VObject
public void getAngularVelocity(float[] vc,
int vcIndex)
getAngularVelocity in interface VObjectpublic void setAngularVelocity(float[] v)
setAngularVelocity in interface VObject
public void setAngularVelocity(float[] vc,
int vcIndex)
setAngularVelocity in interface VObject
public void setAngularVelocity(float wx,
float wy,
float wz)
setAngularVelocity in interface VObjectprivate final String idts(String s)
private final void newLine(StringBuilder buf,
int tab)
public String toString()
XMLStructureAdapter
toString in class XMLStructureAdapterpublic String showSkeleton()
public String showSkeleton(int level)
private void showSkeleton(int tab,
int level,
StringBuilder buf)
public boolean getHasSharedBuffers()
public StringBuilder appendAttributes(StringBuilder buf)
appendAttributes in class XMLStructureAdapter
public void decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
decodeAttributes in class XMLStructureAdapter
public StringBuilder appendContent(StringBuilder buf,
XMLFormatting fmt)
XMLStructureAdapter
appendContent in class XMLStructureAdapter
public void decodeContent(XMLTokenizer tokenizer)
throws IOException
XMLStructureAdapter
decodeContent in class XMLStructureAdapterIOExceptionpublic static String xmlTag()
public String getXMLTag()
getXMLTag in interface XMLStructuregetXMLTag in class XMLStructureAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||