com.jme3.animation
Class Skeleton

java.lang.Object
  extended by com.jme3.animation.Skeleton
All Implemented Interfaces:
Savable

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

Skeleton is a convenience class for managing a bone hierarchy. Skeleton updates the world transforms to reflect the current local animated matrixes.


Constructor Summary
Skeleton()
          Serialization only.
Skeleton(Bone[] boneList)
          Creates a skeleton from a bone list.
Skeleton(Skeleton source)
          Special-purpose copy constructor.
 
Method Summary
 Matrix4f[] computeSkinningMatrices()
          Compute the skining matrices for each bone of the skeleton that would be used to transform vertices of associated meshes
 Bone getBone(int index)
          return a bone for the given index
 Bone getBone(java.lang.String name)
          returns the bone with the given name
 int getBoneCount()
          returns the number of bones of this skeleton
 int getBoneIndex(Bone bone)
          returns the bone index of the given bone
 int getBoneIndex(java.lang.String name)
          returns the bone index of the bone that has the given name
 Bone[] getRoots()
          returns the array of all root bones of this skeleton
 void read(JmeImporter im)
           
 void reset()
          Reset the skeleton to bind pose.
 void resetAndUpdate()
          Reset the skeleton to bind pose and updates the bones
 void setBindingPose()
          Saves the current skeleton state as it's binding pose.
 java.lang.String toString()
           
 void updateWorldVectors()
          Updates world transforms for all bones in this skeleton.
 void write(JmeExporter ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Skeleton

public Skeleton(Bone[] boneList)
Creates a skeleton from a bone list. The root bones are found automatically.

Note that using this constructor will cause the bones in the list to have their bind pose recomputed based on their local transforms.

Parameters:
boneList - The list of bones to manage by this Skeleton

Skeleton

public Skeleton(Skeleton source)
Special-purpose copy constructor.

Shallow copies bind pose data from the source skeleton, does not copy any other data.

Parameters:
source - The source Skeleton to copy from

Skeleton

public Skeleton()
Serialization only. Do not use.

Method Detail

updateWorldVectors

public void updateWorldVectors()
Updates world transforms for all bones in this skeleton. Typically called after setting local animation transforms.


setBindingPose

public void setBindingPose()
Saves the current skeleton state as it's binding pose.


reset

public final void reset()
Reset the skeleton to bind pose.


resetAndUpdate

public final void resetAndUpdate()
Reset the skeleton to bind pose and updates the bones


getRoots

public Bone[] getRoots()
returns the array of all root bones of this skeleton

Returns:

getBone

public Bone getBone(int index)
return a bone for the given index

Parameters:
index -
Returns:

getBone

public Bone getBone(java.lang.String name)
returns the bone with the given name

Parameters:
name -
Returns:

getBoneIndex

public int getBoneIndex(Bone bone)
returns the bone index of the given bone

Parameters:
bone -
Returns:

getBoneIndex

public int getBoneIndex(java.lang.String name)
returns the bone index of the bone that has the given name

Parameters:
name -
Returns:

computeSkinningMatrices

public Matrix4f[] computeSkinningMatrices()
Compute the skining matrices for each bone of the skeleton that would be used to transform vertices of associated meshes

Returns:

getBoneCount

public int getBoneCount()
returns the number of bones of this skeleton

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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