hmi.graphics.collada.scenegraph
Class GSkin

java.lang.Object
  extended by hmi.xml.XMLStructureAdapter
      extended by hmi.graphics.collada.scenegraph.GSkin
All Implemented Interfaces:
XMLStructure

public final class GSkin
extends XMLStructureAdapter

GSkin represents mesh skinning information: joint names and, per mesh vertex, a number of jointIndex/jointWeight pairs. The number of such pairs is kept, per vertex, in vcount.

Author:
Job Zwiers

Field Summary
private  float[] bindShapeMatrix
           
private  float[] invBindMatrices
           
private  int[] jointIndices
           
private  String[] jointNames
           
private static int JOINTNAMESPERLINE
           
private  float[] jointWeights
           
private  int[] vcount
           
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
private GSkin()
           
  GSkin(XMLTokenizer tokenizer)
           
 
Method Summary
 StringBuilder appendAttributeString(StringBuilder buf, XMLFormatting fmt)
          appends the id and sid XML attributes to buf.
 VertexWeights createVertexWeights()
          Creates a new VertexWeight by copying jointIndices, jointWeights, and count data
 void decodeAttributes(HashMap<String,String> attrMap, XMLTokenizer tokenizer)
          decodes the id and sid XML attributes.
 float[] getBindShapeMatrix()
          Returns the bind shape matrix, which could be null
 float[] getInvBindMatrices()
           
 int[] getJointIndices()
          Returns the jointIndices array.
 String[] getJointNames()
          Returns the jointNames array
 float[] getJointWeights()
          Returns the jointWeights array.
 int[] getVCount()
           
 String getXMLTag()
          returns the XML Stag for XML encoding
 void setBindShapeMatrix(float[] m4x4)
          Sets a 4x4 matrix in row major order(a Mat4f element)
 void setInvBindMatrices(float[] invBindMatrices)
          Sets the inverse bind matrices
 void setJointIndices(int[] jointIndices)
          Sets the jointIndices array.
 void setJointNames(String[] jointNames)
          Sets the jointNames array
 void setJointWeights(float[] jointWeights)
          Sets the jointWeights array.
 void setVCount(int[] vcount)
           
 String toString()
          appends the id and sid XML attributes to buf.
static String xmlTag()
          The XML Stag for XML encoding
 
Methods inherited from class hmi.xml.XMLStructureAdapter
appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttributes, appendAttributes, appendAttributeString, appendBooleans, appendCloseEmptyTag, appendCloseSTag, appendComment, appendContent, appendContent, appendDoubleElement, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendETag, appendETag, appendFloatArrayElement, appendFloatElement, appendFloats, appendIntArrayElement, appendIntElement, appendInts, appendLongElement, appendNewLine, appendNewLine, appendNewLine, appendOpenSTag, appendOptionalDoubleElement, appendOptionalFloatElement, appendOptionalIntElement, appendOptionalLongElement, appendSpaces, appendSpaces, appendSTag, appendSTag, appendSTag, appendStringArrayElement, appendStrings, appendSystemNewLine, appendTab, appendTextElement, appendXML, appendXML, appendXML, appendXML, appendXML, appendXMLStructure, appendXMLStructureList, appendXMLTextElementList, countTokens, countTokens, decodeAttribute, decodeAttribute, decodeBoolean, decodeBooleanArray, decodeBooleanArray, decodeBooleanArray, decodeBooleanArray, decodeContent, decodeDouble, decodeDoubleArray, decodeDoubleArray, decodeDoubleArray, decodeDoubleArray, decodeFloat, decodeFloatArray, decodeFloatArray, decodeFloatArray, decodeFloatArray, decodeInt, decodeIntArray, decodeIntArray, decodeIntArray, decodeIntArray, decodeLong, decodeStringArray, decodeStringArray, decodeStringArray, decodeStringArray, decodeXMLStructureList, decodeXMLValueElement, getNamespace, getOptionalAttribute, getOptionalAttribute, getOptionalBooleanAttribute, getOptionalDoubleAttribute, getOptionalFloatAttribute, getOptionalIntAttribute, getOptionalLongAttribute, getRequiredAttribute, getRequiredBooleanAttribute, getRequiredDoubleAttribute, getRequiredFloatAttribute, getRequiredIntAttribute, getRequiredLongAttribute, getTagLine, hasContent, parseXMLElement, postProcess, preProcess, readXML, readXML, readXML, setConsoleAttributeEnabled, setDefaultRecoverMode, setRecoverMode, spaces, toXMLString, toXMLString, toXMLString, toXMLString, toXMLString, toXMLString, writeXML, writeXML, writeXML, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jointNames

private String[] jointNames

bindShapeMatrix

private float[] bindShapeMatrix

invBindMatrices

private float[] invBindMatrices

jointIndices

private int[] jointIndices

jointWeights

private float[] jointWeights

vcount

private int[] vcount

JOINTNAMESPERLINE

private static final int JOINTNAMESPERLINE
See Also:
Constant Field Values

XMLTAG

private static final String XMLTAG
See Also:
Constant Field Values
Constructor Detail

GSkin

private GSkin()

GSkin

public GSkin(XMLTokenizer tokenizer)
      throws IOException
Throws:
IOException
Method Detail

setJointIndices

public void setJointIndices(int[] jointIndices)
Sets the jointIndices array.


getJointIndices

public int[] getJointIndices()
Returns the jointIndices array.


setJointWeights

public void setJointWeights(float[] jointWeights)
Sets the jointWeights array. Also sets the size to jointIndices.length


getJointWeights

public float[] getJointWeights()
Returns the jointWeights array.


setVCount

public void setVCount(int[] vcount)

getVCount

public int[] getVCount()

createVertexWeights

public VertexWeights createVertexWeights()
Creates a new VertexWeight by copying jointIndices, jointWeights, and count data


setBindShapeMatrix

public void setBindShapeMatrix(float[] m4x4)
Sets a 4x4 matrix in row major order(a Mat4f element)


getBindShapeMatrix

public float[] getBindShapeMatrix()
Returns the bind shape matrix, which could be null


setJointNames

public void setJointNames(String[] jointNames)
Sets the jointNames array


getJointNames

public String[] getJointNames()
Returns the jointNames array


setInvBindMatrices

public void setInvBindMatrices(float[] invBindMatrices)
Sets the inverse bind matrices


getInvBindMatrices

public float[] getInvBindMatrices()

toString

public String toString()
appends the id and sid XML attributes to buf.

Overrides:
toString in class XMLStructureAdapter

appendAttributeString

public StringBuilder appendAttributeString(StringBuilder buf,
                                           XMLFormatting fmt)
appends the id and sid XML attributes to buf.

Overrides:
appendAttributeString in class XMLStructureAdapter

decodeAttributes

public void decodeAttributes(HashMap<String,String> attrMap,
                             XMLTokenizer tokenizer)
decodes the id and sid XML attributes.

Overrides:
decodeAttributes in class XMLStructureAdapter

xmlTag

public static String xmlTag()
The XML Stag for XML encoding


getXMLTag

public String getXMLTag()
returns the XML Stag for XML encoding

Specified by:
getXMLTag in interface XMLStructure
Overrides:
getXMLTag in class XMLStructureAdapter