- Cal3D 0.9 API Reference -

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

CalCoreBone Class Reference

The core bone class. More...

#include <corebone.h>

List of all members.

Public Member Functions

 CalCoreBone ()
 Constructs the core bone instance.
virtual ~CalCoreBone ()
 Destructs the core bone instance.
bool addChildId (int childId)
 Adds a child ID.
void calculateState ()
 Calculates the current state.
bool create (const std::string &strName)
 Creates the core bone instance.
void destroy ()
 Destroys the core bone instance.
std::list< int > & getListChildId ()
 Returns the child ID list.
const std::string & getName ()
 Returns the name.
int getParentId ()
 Returns the parent ID.
CalCoreSkeleton * getCoreSkeleton ()
 Provides access to the core skeleton.
const CalQuaternion & getRotation ()
 Returns the rotation.
const CalQuaternion & getRotationAbsolute ()
 Returns the absolute rotation.
const CalQuaternion & getRotationBoneSpace ()
 Returns the bone space rotation.
const CalVector & getTranslation ()
 Returns the translation.
const CalVector & getTranslationAbsolute ()
 Returns the absolute translation.
const CalVector & getTranslationBoneSpace ()
 Returns the bone space translation.
Cal::UserData getUserData ()
 Provides access to the user data.
void setCoreSkeleton (CalCoreSkeleton *pCoreSkeleton)
 Sets the core skeleton.
void setParentId (int parentId)
 Sets the parent ID.
void setRotation (const CalQuaternion &rotation)
 Sets the rotation.
void setRotationBoneSpace (const CalQuaternion &rotation)
 Sets the bone space rotation.
void setTranslation (const CalVector &translation)
 Sets the translation.
void setTranslationBoneSpace (const CalVector &translation)
 Sets the bone space translation.
void setUserData (Cal::UserData userData)
 Stores user data.
void calculateBoundingBox (CalCoreModel *pCoreModel)
 Calculates the bounding box.
CalBoundingBox & getBoundingBox ()
 Returns the current bounding box.
void getBoundingData (int planeId, CalVector &position)
bool isBoundingBoxPrecomputed ()
void scale (float factor)
 Scale the core bone.

Protected Attributes

std::string m_strName
CalCoreSkeleton * m_pCoreSkeleton
int m_parentId
std::list< int > m_listChildId
CalVector m_translation
CalQuaternion m_rotation
CalVector m_translationAbsolute
CalQuaternion m_rotationAbsolute
CalVector m_translationBoneSpace
CalQuaternion m_rotationBoneSpace
Cal::UserData m_userData
CalBoundingBox m_boundingBox
CalVector m_boundingPosition [6]
bool m_boundingBoxPrecomputed


Detailed Description

The core bone class.


Constructor & Destructor Documentation

CalCoreBone::CalCoreBone (   ) 
 

Constructs the core bone instance.

This function is the default constructor of the core bone instance.

CalCoreBone::~CalCoreBone (   )  [virtual]
 

Destructs the core bone instance.

This function is the destructor of the core bone instance.


Member Function Documentation

bool CalCoreBone::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.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

void CalCoreBone::calculateBoundingBox (  CalCoreModel *  pCoreModel  ) 
 

Calculates the bounding box.

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

Parameters:
pCoreModel The coreModel (needed for vertices data.

void CalCoreBone::calculateState (   ) 
 

Calculates the current state.

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

bool CalCoreBone::create (  const std::string &  strName  ) 
 

Creates the core bone instance.

This function creates the core bone instance.

Parameters:
strName A string that should be used as the name of the core bone instance.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

void CalCoreBone::destroy (   ) 
 

Destroys the core bone instance.

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

CalBoundingBox & CalCoreBone::getBoundingBox (   ) 
 

Returns the current bounding box.

This function returns the current bounding box of the core bone instance.

Returns:
bounding box.

CalCoreSkeleton * CalCoreBone::getCoreSkeleton (   ) 
 

Provides access to the core skeleton.

This function returns the core skeleton.

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

std::list< int > & CalCoreBone::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.

const std::string & CalCoreBone::getName (   ) 
 

Returns the name.

This function returns the name of the core bone instance.

Returns:
The name as string.

int CalCoreBone::getParentId (   ) 
 

Returns the parent ID.

This function returns the parent ID of the core bone instance.

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

const CalQuaternion & CalCoreBone::getRotation (   ) 
 

Returns the rotation.

This function returns the relative rotation of the core bone instance.

Returns:
The relative rotation to the parent as quaternion.

const CalQuaternion & CalCoreBone::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.

const CalQuaternion & CalCoreBone::getRotationBoneSpace (   ) 
 

Returns the bone space rotation.

This function returns the rotation to bring a point into the core bone instance space.

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

const CalVector & CalCoreBone::getTranslation (   ) 
 

Returns the translation.

This function returns the relative translation of the core bone instance.

Returns:
The relative translation to the parent as quaternion.

const CalVector & CalCoreBone::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.

const CalVector & CalCoreBone::getTranslationBoneSpace (   ) 
 

Returns the bone space translation.

This function returns the translation to bring a point into the core bone instance space.

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

Cal::UserData CalCoreBone::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.

void CalCoreBone::scale (  float  factor  ) 
 

Scale the core bone.

This function rescale all the data that are in the core bone instance and in his childs.

Parameters:
factor A float with the scale factor

void CalCoreBone::setCoreSkeleton (  CalCoreSkeleton *  pCoreSkeleton  ) 
 

Sets the core skeleton.

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

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

void CalCoreBone::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.

void CalCoreBone::setRotation (  const CalQuaternion &  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.

void CalCoreBone::setRotationBoneSpace (  const CalQuaternion &  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.

void CalCoreBone::setTranslation (  const CalVector &  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.

void CalCoreBone::setTranslationBoneSpace (  const CalVector &  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.

void CalCoreBone::setUserData (  Cal::UserData  userData  ) 
 

Stores user data.

This function stores user data in the core bone instance.

Parameters:
userData The user data that should be stored.


The documentation for this class was generated from the following files:
Generated at Sat Apr 30 13:55:28 2005 by The Cal3D Team with doxygen 1.4.2 © 1997-2001 Dimitri van Heesch