com.md5importer.model.anim
Class Frame

java.lang.Object
  extended by com.md5importer.model.anim.Frame
All Implemented Interfaces:
com.jme.util.export.Savable, IFrame, java.io.Serializable
Direct Known Subclasses:
BaseFrame

public class Frame
extends java.lang.Object
implements java.io.Serializable, IFrame

Frame defines the concrete implementation of a frame.

Frame should not be cloned directly. The cloning process of a Frame should be initiated by the cloning process of the parent* IMD5Animation.

This class is used internally by MD5Importer only.

See Also:
Serialized Form

Field Summary
protected  com.jme.math.Quaternion[] orientations
          The array of Quaternion orientations.
protected  com.jme.math.Vector3f[] translations
          The array of Vector3f translations.
 
Constructor Summary
  Frame()
          Constructor of Frame.
  Frame(int numJoints)
          Constructor of Frame.
protected Frame(com.jme.math.Vector3f[] translations, com.jme.math.Quaternion[] orientations)
          Constructor of Frame.
 
Method Summary
 IFrame clone()
          Clone this frame.
 java.lang.Class getClassTag()
           
 com.jme.math.Quaternion getOrientation(int jointIndex)
          Retrieve the orientation of the Joint with given index.
 float getTransformValue(int jointIndex, int transIndex)
          Retrieve the transform value with given indices.
 com.jme.math.Vector3f getTranslation(int jointIndex)
          Retrieve the translation of the Joint with given index.
 void read(com.jme.util.export.JMEImporter im)
           
 void setTransform(int jointIndex, int index, float value)
          Set the transform of this Frame.
 void write(com.jme.util.export.JMEExporter ex)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

translations

protected com.jme.math.Vector3f[] translations
The array of Vector3f translations.


orientations

protected com.jme.math.Quaternion[] orientations
The array of Quaternion orientations.

Constructor Detail

Frame

public Frame()
Constructor of Frame.


Frame

public Frame(int numJoints)
Constructor of Frame.

Parameters:
numJoints - The Integer number of joints.

Frame

protected Frame(com.jme.math.Vector3f[] translations,
                com.jme.math.Quaternion[] orientations)
Constructor of Frame.

Parameters:
translations - The array of Vector3f translations.
orientations - The array of Quaternion orientations.
Method Detail

setTransform

public void setTransform(int jointIndex,
                         int index,
                         float value)
Set the transform of this Frame.

Specified by:
setTransform in interface IFrame
Parameters:
jointIndex - The index of the Joint.
index - The transform index number.
value - The transform value to be set.

getTranslation

public com.jme.math.Vector3f getTranslation(int jointIndex)
Description copied from interface: IFrame
Retrieve the translation of the Joint with given index.

Specified by:
getTranslation in interface IFrame
Parameters:
jointIndex - The Joint index number.
Returns:
The Vector3f translation value.

getOrientation

public com.jme.math.Quaternion getOrientation(int jointIndex)
Description copied from interface: IFrame
Retrieve the orientation of the Joint with given index.

Specified by:
getOrientation in interface IFrame
Parameters:
jointIndex - The Joint number.
Returns:
The Quaternion orientation value.

getTransformValue

public float getTransformValue(int jointIndex,
                               int transIndex)
Description copied from interface: IFrame
Retrieve the transform value with given indices.

Specified by:
getTransformValue in interface IFrame
Parameters:
jointIndex - The Integer joint index.
transIndex - The Integer transform index.
Returns:
The Float transform value.

getClassTag

public java.lang.Class getClassTag()
Specified by:
getClassTag in interface com.jme.util.export.Savable

write

public void write(com.jme.util.export.JMEExporter ex)
           throws java.io.IOException
Specified by:
write in interface com.jme.util.export.Savable
Throws:
java.io.IOException

read

public void read(com.jme.util.export.JMEImporter im)
          throws java.io.IOException
Specified by:
read in interface com.jme.util.export.Savable
Throws:
java.io.IOException

clone

public IFrame clone()
Description copied from interface: IFrame
Clone this frame.

Specified by:
clone in interface IFrame
Overrides:
clone in class java.lang.Object
Returns:
The cloned IFrame instance.