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

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

public class CalCoreSkeleton
extends java.lang.Object

The core skeleton class.


Field Summary
protected  java.util.Map<java.lang.String,CalCoreBone> coreBonesByName
           
protected  java.util.List<java.lang.Integer> listRootCoreBoneId
           
protected  java.lang.String name
           
protected  java.util.Vector<CalCoreBone> vectorCoreBone
           
 
Constructor Summary
CalCoreSkeleton()
          Constructs the core skeleton instance.
 
Method Summary
 int addCoreBone(CalCoreBone coreBone)
          Adds a core bone.
 void calculateBoneSpaces()
          Calculates the bone spaces by inversion from the absolute transforms.
 void calculateState()
          Calculates the current state.
 CalCoreBone getCoreBone(int coreBoneId)
          Provides access to a core bone.
 CalCoreBone getCoreBone(java.lang.String name)
          Gets the core bone specified by name.
 int getCoreBoneId(java.lang.String strName)
           
 java.util.Vector<CalCoreBone> getCoreBones()
           
 java.util.List<java.lang.Integer> getListRootCoreBoneId()
           
 java.lang.String getName()
           
 void reconnectChildren()
          Reconnects the children of each bone based on the parent ids.
 void setName(java.lang.String name)
           
 java.lang.String toStringAsTree()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

vectorCoreBone

protected java.util.Vector<CalCoreBone> vectorCoreBone

coreBonesByName

protected java.util.Map<java.lang.String,CalCoreBone> coreBonesByName

listRootCoreBoneId

protected java.util.List<java.lang.Integer> listRootCoreBoneId
Constructor Detail

CalCoreSkeleton

public CalCoreSkeleton()
Constructs the core skeleton instance. This function is the default constructor of the core skeleton instance.

Method Detail

addCoreBone

public int addCoreBone(CalCoreBone coreBone)
Adds a core bone. This function adds a core bone to the core skeleton instance. In doing so it sets the core bone's skeleton to this core skeleton instance (in contrast to the original Cal3D).

Parameters:
coreBone - A pointer to the core bone that should be added.
Returns:
One of the following values: \li the assigned bone \b ID of the added core bone \li \b -1 if an error happend

calculateState

public void calculateState()
Calculates the current state. This function calculates the current state of the core skeleton instance by calculating all the core bone states.


calculateBoneSpaces

public void calculateBoneSpaces()
Calculates the bone spaces by inversion from the absolute transforms. Useful for importing from model formats that don't include the bone spaces.


getCoreBone

public CalCoreBone getCoreBone(int coreBoneId)
Provides access to a core bone. This function returns the core bone with the given ID.

Parameters:
coreBoneId - The ID of the core bone that should be returned.
Returns:
One of the following values: \li a pointer to the core bone \li \b 0 if an error happend

getCoreBoneId

public int getCoreBoneId(java.lang.String strName)
Parameters:
strName - The name of the core bone that should be returned.
Returns:
the ID of a specified core bone. This function returns the ID of a specified core bone.

getCoreBone

public CalCoreBone getCoreBone(java.lang.String name)
Gets the core bone specified by name.


getListRootCoreBoneId

public java.util.List<java.lang.Integer> getListRootCoreBoneId()
Returns:
the root core bone id list. This function returns the list that contains all root core bone IDs of the core skeleton instance.

getCoreBones

public java.util.Vector<CalCoreBone> getCoreBones()
Returns:
the core bone vector. This function returns the vector that contains all core bones of the core skeleton instance.

reconnectChildren

public void reconnectChildren()
Reconnects the children of each bone based on the parent ids. Useful for loaders and importers.


getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

toStringAsTree

public java.lang.String toStringAsTree()