org.jagatoo.loaders.models.collada.datastructs.animation
Class Skeleton

java.lang.Object
  extended by org.jagatoo.loaders.models.collada.datastructs.animation.Skeleton
All Implemented Interfaces:
java.lang.Iterable<Bone>

public class Skeleton
extends java.lang.Object
implements java.lang.Iterable<Bone>

A Skeleton. It contains a root bone, which can have several children


Field Summary
 org.openmali.vecmath2.Point3f relativeTranslation
          The position of our Skeleton.
 java.util.ArrayList<KeyFrameTuple3f> transKeyFrames
          The keyframes of position
 
Constructor Summary
Skeleton(Bone rootBone, org.openmali.vecmath2.Point3f relativeTranslation, java.util.ArrayList<Bone> boneList)
          Creates a new Skeleton.
 
Method Summary
 Bone getBoneBySourceId(java.lang.String sourceId)
           
 Bone getRootBone()
           
 java.util.Iterator<Bone> iterator()
          
 void resetIterator()
           
 int selectCurrentTransFrame(long currentTime)
          Selects the current translation key frame, based on the current time.
 void updateAbsolutes()
          Updates the skeleton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

relativeTranslation

public final org.openmali.vecmath2.Point3f relativeTranslation
The position of our Skeleton. The root bone is transformed by this position (and thus, the children bones are transformed too).


transKeyFrames

public java.util.ArrayList<KeyFrameTuple3f> transKeyFrames
The keyframes of position

Constructor Detail

Skeleton

public Skeleton(Bone rootBone,
                org.openmali.vecmath2.Point3f relativeTranslation,
                java.util.ArrayList<Bone> boneList)
Creates a new Skeleton.

Parameters:
rootBone - The root bone
relativeTranslation - The position of the Skeleton
boneList -
Method Detail

getRootBone

public final Bone getRootBone()
Returns:
the rootBone

getBoneBySourceId

public final Bone getBoneBySourceId(java.lang.String sourceId)

selectCurrentTransFrame

public int selectCurrentTransFrame(long currentTime)
Selects the current translation key frame, based on the current time.

Parameters:
currentTime - beetween 0 and the end of the animation, in milliseconds
Returns:
frame index selected

updateAbsolutes

public void updateAbsolutes()
Updates the skeleton.
It recomputes the transform matrix of each bone, starting with the root bone and then each child recursively.


iterator

public java.util.Iterator<Bone> iterator()

Specified by:
iterator in interface java.lang.Iterable<Bone>

resetIterator

public void resetIterator()