- Cal3D 0.9 API Reference -

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

# CalBone Class Reference

The bone class. More...

`#include <bone.h>`

List of all members.

## Public Member Functions

| CalBone ()
| Constructs the bone instance.
virtual | ~CalBone ()
| Destructs the bone instance.
void | blendState (float weight, const CalVector &translation, const CalQuaternion &rotation)
| Interpolates the current state to another state.
void | calculateState ()
| Calculates the current state.
void | clearState ()
| Clears the current state.
bool | create (CalCoreBone *pCoreBone)
| Creates the bone instance.
void | destroy ()
| Destroys the bone instance.
CalCoreBone * | getCoreBone ()
| Provides access to the core bone.
void | setCoreState ()
| Resets the bone to its core state.
void | setCoreStateRecursive ()
| Resets the bone and children to core states.
void | setRotation (const CalQuaternion &rotation)
| Sets the current rotation.
const CalQuaternion & | getRotation ()
| Returns the current rotation.
const CalQuaternion & | getRotationAbsolute ()
| Returns the current absolute rotation.
const CalQuaternion & | getRotationBoneSpace ()
| Returns the current bone space rotation.
void | setTranslation (const CalVector &translation)
| Sets the current translation.
const CalVector & | getTranslation ()
| Returns the current translation.
const CalVector & | getTranslationAbsolute ()
| Returns the current absolute translation.
const CalVector & | getTranslationBoneSpace ()
| Returns the current bone space translation.
const CalMatrix & | getTransformMatrix ()
| Returns the current bone space translation.
void | lockState ()
| Locks the current state.
void | setSkeleton (CalSkeleton *pSkeleton)
| Sets the skeleton.
void | calculateBoundingBox ()
| Calculates the bounding box.
CalBoundingBox & | getBoundingBox ()
| Returns the current bounding box.

## Protected Attributes

CalCoreBone * | m_pCoreBone
CalSkeleton * | m_pSkeleton
float | m_accumulatedWeight
float | m_accumulatedWeightAbsolute
CalVector | m_translation
CalQuaternion | m_rotation
CalVector | m_translationAbsolute
CalQuaternion | m_rotationAbsolute
CalVector | m_translationBoneSpace
CalQuaternion | m_rotationBoneSpace
CalMatrix | m_transformMatrix
CalBoundingBox | m_boundingBox

## Detailed Description

The bone class.

## Constructor & Destructor Documentation

CalBone::CalBone | ( |  | ) |

| Constructs the bone instance. This function is the default constructor of the bone instance.

CalBone::~CalBone | ( |  | ) | `[virtual]`

| Destructs the bone instance. This function is the destructor of the bone instance.

## Member Function Documentation

void CalBone::blendState | ( | float | weight,
|  | const CalVector & | translation,
|  | const CalQuaternion & | rotation
| ) |

| Interpolates the current state to another state. This function interpolates the current state (relative translation and rotation) of the bone instance to another state of a given weight.

Parameters:

  weight | The blending weight.
  translation | The relative translation to be interpolated to.
  rotation | The relative rotation to be interpolated to.

void CalBone::calculateBoundingBox | ( |  | ) |

| Calculates the bounding box. This function Calculates the bounding box of the bone instance.

void CalBone::calculateState | ( |  | ) |

| Calculates the current state. This function calculates the current state (absolute translation and rotation, as well as the bone space transformation) of the bone instance and all its children.

void CalBone::clearState | ( |  | ) |

| Clears the current state. This function clears the current state (absolute translation and rotation) of the bone instance and all its children.

bool CalBone::create | ( | CalCoreBone * | pCoreBone | ) |

| Creates the bone instance. This function creates the bone instance based on a core bone.

Parameters:

  pCoreBone | A pointer to the core bone on which this bone instance should be based on.

Returns:
  One of the following values:
  - true if successful
  - false if an error happend

void CalBone::destroy | ( |  | ) |

| Destroys the bone instance. This function destroys all data stored in the bone instance and frees all allocated memory.

CalBoundingBox & CalBone::getBoundingBox | ( |  | ) |

| Returns the current bounding box. This function returns the current bounding box of the bone instance.

Returns:
  bounding box.

CalCoreBone * CalBone::getCoreBone | ( |  | ) |

| Provides access to the core bone. This function returns the core bone on which this bone instance is based on.

Returns:
  One of the following values:
  - a pointer to the core bone
  - 0 if an error happend

const CalQuaternion & CalBone::getRotation | ( |  | ) |

| Returns the current rotation. This function returns the current relative rotation of the bone instance.

Returns:
  The relative rotation to the parent as quaternion.

const CalQuaternion & CalBone::getRotationAbsolute | ( |  | ) |

| Returns the current absolute rotation. This function returns the current absolute rotation of the bone instance.

Returns:
  The absolute rotation to the parent as quaternion.

const CalQuaternion & CalBone::getRotationBoneSpace | ( |  | ) |

| Returns the current bone space rotation. This function returns the current rotation to bring a point into the bone instance space.

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

const CalMatrix & CalBone::getTransformMatrix | ( |  | ) |

| Returns the current bone space translation. This function returns the current translation to bring a point into the bone instance space.

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

const CalVector & CalBone::getTranslation | ( |  | ) |

| Returns the current translation. This function returns the current relative translation of the bone instance.

Returns:
  The relative translation to the parent as quaternion.

const CalVector & CalBone::getTranslationAbsolute | ( |  | ) |

| Returns the current absolute translation. This function returns the current absolute translation of the bone instance.

Returns:
  The absolute translation to the parent as quaternion.

const CalVector & CalBone::getTranslationBoneSpace | ( |  | ) |

| Returns the current bone space translation. This function returns the current translation to bring a point into the bone instance space.

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

void CalBone::lockState | ( |  | ) |

| Locks the current state. This function locks the current state (absolute translation and rotation) of the bone instance and all its children.

void CalBone::setCoreState | ( |  | ) |

| Resets the bone to its core state. This function changes the state of the bone to its default non-animated position and orientation. Child bones are unaffected and may be animated independently.

void CalBone::setCoreStateRecursive | ( |  | ) |

| Resets the bone and children to core states. This function changes the state of the bone to its default non-animated position and orientation. All child bones are also set in this manner.

void CalBone::setRotation | ( | const CalQuaternion & | rotation | ) |

| Sets the current rotation. This function sets the current relative rotation of the bone instance. Caveat: For this change to appear, calculateState() must be called afterwards.

void CalBone::setSkeleton | ( | CalSkeleton * | pSkeleton | ) |

| Sets the skeleton. This function sets the skeleton to which the bone instance is attached to.

Parameters:

  pSkeleton | The skeleton to which the bone instance should be attached to.

void CalBone::setTranslation | ( | const CalVector & | translation | ) |

| Sets the current translation. This function sets the current relative translation of the bone instance. Caveat: For this change to appear, calculateState() must be called afterwards.

The documentation for this class was generated from the following files:

- bone.h
- bone.cpp

Generated at Wed Apr 7 16:57:17 2004 by The Cal3D Team with 1.3.6 © 1997-2001 Dimitri van Heesch