Polycode
Polycode::Bone Class Reference

Skeleton bone. More...

Inherits Polycode::SceneEntity.

List of all members.

Public Member Functions

 Bone (const String &boneName)
 Constructor.
const StringgetName () const
 Returns the name of the bone.
void Render ()
 Main render method.
void setParentBone (Bone *bone)
 Sets the parent bone of this bone.
void addChildBone (Bone *bone)
 Adds another bone as the child of this bone.
BonegetParentBone ()
 Returns the parent bone of this bone.
int getNumChildBones ()
 Returns the number of child bones of this bone.
BonegetChildBone (unsigned int index)
 Returns the child bone of this bone at the specified index.
Matrix4 getBoneMatrix () const
 Returns the bone matrix.
void setBoneMatrix (const Matrix4 &matrix)
 Sets the bone matrix.
Matrix4 getRestMatrix () const
 Returns the rest matrix of this bone.
Matrix4 getFullRestMatrix () const
 Returns the full rest matrix of this bone.
Matrix4 getParentRestMatrix () const
 Returns the rest matrix of this bone's parent.
Matrix4 getFinalMatrix () const
void setRestMatrix (const Matrix4 &matrix)
 Sets the rest matrix for this bone.
void setBaseMatrix (const Matrix4 &matrix)
 Sets the base matrix for this bone.
const Matrix4getBaseMatrix () const
 Returns the base matrix of this bone.
Matrix4 getFullBaseMatrix () const
 Returns the full base matrix of this bone.

Public Attributes

int parentBoneId
 Id of the bone.

Detailed Description

Skeleton bone.

Bones are bound to vertices of a mesh and when transformed, move the bound vertices of the mesh along with them. Bones are subclassed from SceneEntity, but have their own hierarchy system.

See also:
Skeleton

Constructor & Destructor Documentation

Bone::Bone ( const String boneName)

Constructor.

Parameters:
boneNameName of the bone.

Member Function Documentation

void Bone::addChildBone ( Bone bone)

Adds another bone as the child of this bone.

Parameters:
boneNew parent bone.
const Matrix4& Polycode::Bone::getBaseMatrix ( ) const [inline]

Returns the base matrix of this bone.

Returns:
Base matrix.
Matrix4 Bone::getBoneMatrix ( ) const

Returns the bone matrix.

Returns:
Bone matrix.
Bone * Bone::getChildBone ( unsigned int  index)

Returns the child bone of this bone at the specified index.

Parameters:
indexIndex of the child bone to return.
Returns:
Parent bone of this bone.
Matrix4 Bone::getFinalMatrix ( ) const
See also:
getBoneMatrix()
Matrix4 Bone::getFullBaseMatrix ( ) const

Returns the full base matrix of this bone.

Returns:
Full base matrix.
Matrix4 Bone::getFullRestMatrix ( ) const

Returns the full rest matrix of this bone.

Returns:
Full rest matrix.
const String & Bone::getName ( ) const

Returns the name of the bone.

Returns:
Name of the bone.
int Bone::getNumChildBones ( )

Returns the number of child bones of this bone.

Returns:
Number of child bones.
Bone * Bone::getParentBone ( )

Returns the parent bone of this bone.

Returns:
Parent bone of this bone.
Matrix4 Bone::getParentRestMatrix ( ) const

Returns the rest matrix of this bone's parent.

Returns:
Rest matrix of the bone's parent.
Matrix4 Bone::getRestMatrix ( ) const

Returns the rest matrix of this bone.

Returns:
Rest matrix.
void Bone::Render ( ) [virtual]

Main render method.

Override this to do your own drawing.

Reimplemented from Polycode::Entity.

void Bone::setBaseMatrix ( const Matrix4 matrix)

Sets the base matrix for this bone.

Parameters:
matrixNew base matrix.
void Bone::setBoneMatrix ( const Matrix4 matrix)

Sets the bone matrix.

Returns:
Bone matrix.
void Bone::setParentBone ( Bone bone)

Sets the parent bone of this bone.

Parameters:
boneNew parent bone.
void Bone::setRestMatrix ( const Matrix4 matrix)

Sets the rest matrix for this bone.

Parameters:
matrixNew rest matrix.