com.jmex.model.ogrexml.anim
Class Bone

java.lang.Object
  extended by com.jmex.model.ogrexml.anim.Bone
All Implemented Interfaces:
Savable

public final class Bone
extends java.lang.Object
implements Savable


Field Summary
(package private)  Node attachNode
          The attachment node.
(package private)  java.util.ArrayList<Bone> children
           
(package private)  java.lang.String name
           
(package private)  Bone parent
           
(package private)  boolean userControl
          If enabled, user can control bone transform with setUserTransforms.
 
Constructor Summary
Bone()
          Used for binary loading as a Savable; the object must be constructed, then the parameters usually present in the constructor for this class are restored from the file the object was saved to.
Bone(Bone source)
          Copy constructor.
Bone(java.lang.String name)
          Creates a new bone
 
Method Summary
(package private)  void addChild(Bone bone)
           
 Node getAttachmentsNode()
          Returns the attachment node.
 java.lang.Class getClassTag()
           
(package private)  void getOffsetTransform(Matrix4f m)
          Stores the skinning transform in the specified Matrix4f.
 void read(JMEImporter im)
           
(package private)  void reset()
          Reset the bone and it's children to bind pose.
(package private)  void setAnimTransforms(Vector3f translation, Quaternion rotation)
           
(package private)  void setAnimTransforms(Vector3f translation, Quaternion rotation, Vector3f scale)
          Sets the local animation transform of this bone.
(package private)  void setBindingPose()
          Saves the current bone state as it's binding pose, including it's children.
(package private)  void setBindTransforms(Vector3f translation, Quaternion rotation)
           
(package private)  void setBindTransforms(Vector3f translation, Quaternion rotation, Vector3f scale)
          Sets local bind transform for bone.
 void setUserControl(boolean enable)
          If enabled, user can control bone transform with setUserTransforms.
 void setUserTransforms(Vector3f translation, Quaternion rotation, Vector3f scale)
          Set user transform.
(package private)  void update()
          Updates world transforms for this bone and it's children.
(package private)  void updateWorldVectors()
          Updates the world transforms for this bone, and, possibly the attach node if not null.
 void write(JMEExporter ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

java.lang.String name

parent

Bone parent

children

final java.util.ArrayList<Bone> children

userControl

boolean userControl
If enabled, user can control bone transform with setUserTransforms. Animation transforms are not applied to this bone when enabled.


attachNode

Node attachNode
The attachment node.

Constructor Detail

Bone

Bone(java.lang.String name)
Creates a new bone

Parameters:
name - Name to give to this bone

Bone

Bone(Bone source)
Copy constructor. local bind and world inverse bind transforms shallow copied.

Parameters:
source -

Bone

public Bone()
Used for binary loading as a Savable; the object must be constructed, then the parameters usually present in the constructor for this class are restored from the file the object was saved to.

Method Detail

setUserControl

public void setUserControl(boolean enable)
If enabled, user can control bone transform with setUserTransforms. Animation transforms are not applied to this bone when enabled.


addChild

void addChild(Bone bone)

updateWorldVectors

void updateWorldVectors()
Updates the world transforms for this bone, and, possibly the attach node if not null.


update

void update()
Updates world transforms for this bone and it's children.


setBindingPose

void setBindingPose()
Saves the current bone state as it's binding pose, including it's children.


reset

void reset()
Reset the bone and it's children to bind pose.


getOffsetTransform

void getOffsetTransform(Matrix4f m)
Stores the skinning transform in the specified Matrix4f. The skinning transform applies the animation of the bone to a vertex.

Parameters:
m -

setUserTransforms

public void setUserTransforms(Vector3f translation,
                              Quaternion rotation,
                              Vector3f scale)
Set user transform.

See Also:
setUserControl

getAttachmentsNode

public Node getAttachmentsNode()
Returns the attachment node. Attach models and effects to this node to make them follow this bone's motions.


setAnimTransforms

void setAnimTransforms(Vector3f translation,
                       Quaternion rotation,
                       Vector3f scale)
Sets the local animation transform of this bone. Bone is assumed to be in bind pose when this is called.


setBindTransforms

void setBindTransforms(Vector3f translation,
                       Quaternion rotation,
                       Vector3f scale)
Sets local bind transform for bone. Call setBindingPose() after all of the skeleton bones' bind transforms are set to save them.


setAnimTransforms

void setAnimTransforms(Vector3f translation,
                       Quaternion rotation)

setBindTransforms

void setBindTransforms(Vector3f translation,
                       Quaternion rotation)

getClassTag

public java.lang.Class getClassTag()
Specified by:
getClassTag in interface Savable

read

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

write

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