org.jagatoo.loaders.models.cal3d.core
Class CalCoreTrack

java.lang.Object
  extended by org.jagatoo.loaders.models.cal3d.core.CalCoreTrack

public class CalCoreTrack
extends java.lang.Object

The core track class.


Field Summary
protected  int coreBoneId
           
protected  java.util.SortedSet<CalCoreKeyframe> coreKeyframes
           
 
Constructor Summary
CalCoreTrack()
          Constructs the core track instance.
CalCoreTrack(int coreBoneId)
           
 
Method Summary
 void addCoreKeyframe(CalCoreKeyframe coreKeyframe)
          Adds a core keyframe.
 int getCoreBoneId()
          Returns the ID of the core bone.
 java.util.SortedSet<CalCoreKeyframe> getCoreKeyFrames()
          Returns the core keyframe map.
 void getState(float time, org.openmali.vecmath2.Vector3f translation, org.openmali.vecmath2.Quaternion4f rotation)
          Returns a specified state.
 void scale(float factor)
          Scale the core track.
 void setCoreBoneId(int coreBoneId)
          Sets the ID of the core bone.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coreBoneId

protected int coreBoneId

coreKeyframes

protected java.util.SortedSet<CalCoreKeyframe> coreKeyframes
Constructor Detail

CalCoreTrack

public CalCoreTrack()
Constructs the core track instance. This function is the default constructor of the core track instance.


CalCoreTrack

public CalCoreTrack(int coreBoneId)
Method Detail

addCoreKeyframe

public void addCoreKeyframe(CalCoreKeyframe coreKeyframe)
Adds a core keyframe. This function adds a core keyframe to the core track instance.

Parameters:
coreKeyframe - A pointer to the core keyframe that should be added.

getCoreBoneId

public int getCoreBoneId()
Returns the ID of the core bone. This function returns the ID of the core bone to which the core track instance is attached to.

Returns:
One of the following values: \li the \b ID of the core bone \li \b -1 if an error happend

getCoreKeyFrames

public java.util.SortedSet<CalCoreKeyframe> getCoreKeyFrames()
Returns the core keyframe map. This function returns the map that contains all core keyframes of the core track instance.

Returns:
A reference to the core keyframe map.

getState

public void getState(float time,
                     org.openmali.vecmath2.Vector3f translation,
                     org.openmali.vecmath2.Quaternion4f rotation)
Returns a specified state. This function returns the state (translation and rotation of the core bone) for the specified time and duration.

Parameters:
time - The time in seconds at which the state should be returned.
translation - A reference to the translation reference that will be filled with the specified state.
rotation - A reference to the rotation reference that will be filled with the specified state.

setCoreBoneId

public void setCoreBoneId(int coreBoneId)
Sets the ID of the core bone. This function sets the ID of the core bone to which the core track instance is attached to.

Parameters:
coreBoneId - The ID of the bone to which the core track instance should be attached to.

scale

public void scale(float factor)
Scale the core track. This function rescale all the data that are in the core track instance.

Parameters:
factor - A float with the scale factor