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

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

public class CalCoreBone
extends java.lang.Object

The core bone class.


Field Summary
protected  CalCoreSkeleton coreSkeleton
           
protected  java.util.ArrayList<java.lang.Integer> listChildId
           
protected  java.lang.String name
           
protected  int parentId
           
protected  org.openmali.vecmath2.Quaternion4f rotation
           
protected  org.openmali.vecmath2.Quaternion4f rotationAbsolute
           
protected  org.openmali.vecmath2.Quaternion4f rotationBoneSpace
           
protected  org.openmali.vecmath2.Matrix3f stateTransform
           
protected  org.openmali.vecmath2.Vector3f translation
           
protected  org.openmali.vecmath2.Vector3f translationAbsolute
           
protected  org.openmali.vecmath2.Vector3f translationBoneSpace
           
protected  java.lang.Object userData
           
 
Constructor Summary
CalCoreBone(java.lang.String name)
          Constructs the core bone instance.
 
Method Summary
 void addChildId(int childId)
          Adds a child ID.
 void calculateState()
          Calculates the current state.
 int getId()
          Get the id for this core bone - needed to find the corresponding bone instance.
 java.util.ArrayList<java.lang.Integer> getListChildId()
          Returns the child ID list.
 java.lang.String getName()
          Returns the name.
 int getParentId()
          Returns the parent ID.
 org.openmali.vecmath2.Quaternion4f getRotation()
          Returns the rotation.
 org.openmali.vecmath2.Quaternion4f getRotationAbsolute()
          Returns the absolute rotation.
 org.openmali.vecmath2.Quaternion4f getRotationBoneSpace()
          Returns the bone space rotation.
 org.openmali.vecmath2.Vector3f getTranslation()
          Returns the translation.
 org.openmali.vecmath2.Vector3f getTranslationAbsolute()
          Returns the absolute translation.
 org.openmali.vecmath2.Vector3f getTranslationBoneSpace()
          Returns the bone space translation.
 java.lang.Object getUserData()
          Provides access to the user data.
static void mul(org.openmali.vecmath2.Quaternion4f q, org.openmali.vecmath2.Vector3f v)
           
 void setCoreSkeleton(CalCoreSkeleton coreSkeleton)
          Sets the core skeleton.
 void setName(java.lang.String name)
           
 void setParentId(int parentId)
          Sets the parent ID.
 void setRotation(org.openmali.vecmath2.Quaternion4f rotation)
          Sets the rotation.
 void setRotationBoneSpace(org.openmali.vecmath2.Quaternion4f rotation)
          Sets the bone space rotation.
 void setTranslation(org.openmali.vecmath2.Vector3f translation)
          Sets the translation.
 void setTranslationBoneSpace(org.openmali.vecmath2.Vector3f translation)
          Sets the bone space translation.
 void setUserData(java.lang.Object userData)
          Stores user data.
 java.lang.String toString()
           
static void transform(org.openmali.vecmath2.Vector3f v, org.openmali.vecmath2.Quaternion4f q)
           
static void transformInv(org.openmali.vecmath2.Vector3f v, org.openmali.vecmath2.Quaternion4f q)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

coreSkeleton

protected CalCoreSkeleton coreSkeleton

parentId

protected int parentId

listChildId

protected java.util.ArrayList<java.lang.Integer> listChildId

translation

protected org.openmali.vecmath2.Vector3f translation

rotation

protected org.openmali.vecmath2.Quaternion4f rotation

translationAbsolute

protected org.openmali.vecmath2.Vector3f translationAbsolute

rotationAbsolute

protected org.openmali.vecmath2.Quaternion4f rotationAbsolute

translationBoneSpace

protected org.openmali.vecmath2.Vector3f translationBoneSpace

rotationBoneSpace

protected org.openmali.vecmath2.Quaternion4f rotationBoneSpace

stateTransform

protected org.openmali.vecmath2.Matrix3f stateTransform

userData

protected java.lang.Object userData
Constructor Detail

CalCoreBone

public CalCoreBone(java.lang.String name)
Constructs the core bone instance. This function is the default constructor of the core bone instance.

Method Detail

addChildId

public void addChildId(int childId)
Adds a child ID. This function adds a core bone ID to the child ID list of the core bone instance.

Parameters:
childId - The ID of the core bone ID that shoud be added to the child ID list.

calculateState

public void calculateState()
Calculates the current state. This function calculates the current state (absolute translation and rotation) of the core bone instance and all its children.


transform

public static void transform(org.openmali.vecmath2.Vector3f v,
                             org.openmali.vecmath2.Quaternion4f q)

transformInv

public static void transformInv(org.openmali.vecmath2.Vector3f v,
                                org.openmali.vecmath2.Quaternion4f q)

mul

public static void mul(org.openmali.vecmath2.Quaternion4f q,
                       org.openmali.vecmath2.Vector3f v)

getListChildId

public java.util.ArrayList<java.lang.Integer> getListChildId()
Returns the child ID list. This function returns the list that contains all child IDs of the core bone instance.

Returns:
A reference to the child ID list.

getName

public java.lang.String getName()
Returns the name. This function returns the name of the core bone instance.

Returns:
The name as string.

setName

public void setName(java.lang.String name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
the name of the bone.

getId

public int getId()
Get the id for this core bone - needed to find the corresponding bone instance.


getParentId

public int getParentId()
Returns the parent ID. This function returns the parent ID of the core bone instance.

Returns:
One of the following values: \li the \b ID of the parent \li \b -1 if the core bone instance is a root core bone

getRotation

public org.openmali.vecmath2.Quaternion4f getRotation()
Returns the rotation. This function returns the relative rotation of the core bone instance.

Returns:
The relative rotation to the parent as quaternion.

getRotationAbsolute

public org.openmali.vecmath2.Quaternion4f getRotationAbsolute()
Returns the absolute rotation. This function returns the absolute rotation of the core bone instance.

Returns:
The absolute rotation to the parent as quaternion.

getRotationBoneSpace

public org.openmali.vecmath2.Quaternion4f getRotationBoneSpace()
Returns the bone space rotation. This function returns the rotation to bring a point into the core bone instance space. I.e., the transform that takes the mesh in its reference pose to the bone space from which the physique transform can be applied.

Returns:
The rotation to bring a point into bone space.

getTranslation

public org.openmali.vecmath2.Vector3f getTranslation()
Returns the translation. This function returns the relative translation of the core bone instance.

Returns:
The relative translation to the parent as quaternion.

getTranslationAbsolute

public org.openmali.vecmath2.Vector3f getTranslationAbsolute()
Returns the absolute translation. This function returns the absolute translation of the core bone instance.

Returns:
The absolute translation to the parent as quaternion.

getTranslationBoneSpace

public org.openmali.vecmath2.Vector3f getTranslationBoneSpace()
Returns the bone space translation. This function returns the translation to bring a point into the core bone instance space. I.e., the transform that takes the mesh in its reference pose to the bone space from which the physique transform can be applied.

Returns:
The translation to bring a point into bone space.

getUserData

public java.lang.Object getUserData()
Provides access to the user data. This function returns the user data stored in the core bone instance.

Returns:
The user data stored in the core bone instance.

setCoreSkeleton

public void setCoreSkeleton(CalCoreSkeleton coreSkeleton)
Sets the core skeleton. This function sets the core skeleton to which the core bone instance is attached to.

Parameters:
coreSkeleton - The core skeleton to which the core bone instance should be attached to.

setParentId

public void setParentId(int parentId)
Sets the parent ID. This function sets the parent ID of the core bone instance.

Parameters:
parentId - The ID of the parent that should be set.

setRotation

public void setRotation(org.openmali.vecmath2.Quaternion4f rotation)
Sets the rotation. This function sets the relative rotation of the core bone instance.

Parameters:
rotation - The relative rotation to the parent as quaternion.

setRotationBoneSpace

public void setRotationBoneSpace(org.openmali.vecmath2.Quaternion4f rotation)
Sets the bone space rotation. This function sets the rotation that brings a point into the core bone instance space.

Parameters:
rotation - The rotation that brings a point into bone space.

setTranslation

public void setTranslation(org.openmali.vecmath2.Vector3f translation)
Sets the translation. This function sets the relative translation of the core bone instance.

Parameters:
translation - The relative translation to the parent as vector.

setTranslationBoneSpace

public void setTranslationBoneSpace(org.openmali.vecmath2.Vector3f translation)
Sets the bone space translation. This function sets the translation that brings a point into the core bone instance space.

Parameters:
translation - The translation that brings a point into bone space.

setUserData

public void setUserData(java.lang.Object userData)
Stores user data. This function stores user data in the core bone instance.

Parameters:
userData - The user data that should be stored.