- Cal3D 0.11 API Reference -

Public Member Functions | List of all members
CalBone Class Reference

Public Member Functions

 CalBone (CalCoreBone *coreBone)
 
void blendState (float unrampedWeight, const CalVector &translation, const CalQuaternion &rotation, float scale=1.0f, bool replace=false, float rampValue=1.0f, bool absoluteTranslation=true)
 Interpolates the current state to another state. More...
 
void calculateState ()
 Calculates the current state. More...
 
void clearState ()
 Clears the current state. More...
 
CalCoreBonegetCoreBone ()
 Provides access to the core bone. More...
 
const CalCoreBonegetCoreBone () const
 Provides access to the core bone. More...
 
void setCoreTransformStateVariables ()
 Resets the bone transform state variables for rotation and translation. More...
 
void setCoreState ()
 Resets the bone to its core state. More...
 
void setCoreStateRecursive ()
 Resets the bone and children to core states. More...
 
void setRotation (const CalQuaternion &rotation)
 Sets the current rotation. More...
 
const CalQuaterniongetRotation () const
 Returns the current rotation. More...
 
const CalQuaterniongetRotationAbsolute () const
 Returns the current absolute rotation. More...
 
const CalQuaterniongetRotationBoneSpace () const
 Returns the current bone space rotation. More...
 
void setTranslation (const CalVector &translation)
 Sets the current translation. More...
 
const CalVectorgetTranslation () const
 Returns the current translation. More...
 
const CalVectorgetTranslationAbsolute () const
 Returns the current absolute translation. More...
 
void setMeshScaleAbsolute (CalVector const &sv)
 
const CalVectorgetTranslationBoneSpace () const
 
const CalMatrixgetTransformMatrix () const
 
void lockState ()
 Returns the current bone space translation. More...
 
void setSkeleton (CalSkeleton *pSkeleton)
 Sets the skeleton. More...
 
void calculateBoundingBox ()
 Calculates the bounding box. More...
 
CalBoundingBoxgetBoundingBox ()
 Returns the current bounding box. More...
 
const CalBoundingBoxgetBoundingBox () const
 Returns the current bounding box. More...
 

Member Function Documentation

◆ blendState()

void CalBone::blendState ( float  unrampedWeight,
const CalVector translation,
const CalQuaternion rotation,
float  scale = 1.0f,
bool  replace = false,
float  rampValue = 1.0f,
bool  absoluteTranslation = true 
)

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
unrampedWeightThe blending weight, not incorporating ramp value
translationThe relative translation to be interpolated to.
rotationThe relative rotation to be interpolated to.
scaleOptional scale from 0-1 applies to transformation directly without affecting weights.
replaceIf true, subsequent animations will have their weight attenuated by 1 - rampValue.
rampValueAmount to attenuate weight when ramping in/out the animation.
absoluteTranslationIf true, use the translation as absolute, otherwise add it to the current bone translation as relative.

◆ calculateBoundingBox()

void CalBone::calculateBoundingBox ( )

Calculates the bounding box.

This function Calculates the bounding box of the bone instance.

◆ calculateState()

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.

◆ clearState()

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.

◆ getBoundingBox() [1/2]

CalBoundingBox & CalBone::getBoundingBox ( )

Returns the current bounding box.

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

Returns
bounding box.

◆ getBoundingBox() [2/2]

const CalBoundingBox & CalBone::getBoundingBox ( ) const

Returns the current bounding box.

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

Returns
bounding box.

◆ getCoreBone() [1/2]

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 happened

◆ getCoreBone() [2/2]

const CalCoreBone * CalBone::getCoreBone ( ) const

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 happened

◆ getRotation()

const CalQuaternion & CalBone::getRotation ( ) const

Returns the current rotation.

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

Returns
The relative rotation to the parent as quaternion.

◆ getRotationAbsolute()

const CalQuaternion & CalBone::getRotationAbsolute ( ) const

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.

◆ getRotationBoneSpace()

const CalQuaternion & CalBone::getRotationBoneSpace ( ) const

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.

◆ getTranslation()

const CalVector & CalBone::getTranslation ( ) const

Returns the current translation.

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

Returns
The relative translation to the parent as quaternion.

◆ getTranslationAbsolute()

const CalVector & CalBone::getTranslationAbsolute ( ) const

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.

◆ lockState()

void CalBone::lockState ( )

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. 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.Locks the current state.

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

◆ setCoreState()

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.

◆ setCoreStateRecursive()

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.

◆ setCoreTransformStateVariables()

void CalBone::setCoreTransformStateVariables ( )

Resets the bone transform state variables for rotation and translation.

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.

◆ setRotation()

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.

◆ setSkeleton()

void CalBone::setSkeleton ( CalSkeleton pSkeleton)

Sets the skeleton.

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

Parameters
pSkeletonThe skeleton to which the bone instance should be attached to.

◆ setTranslation()

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:

Generated by The Cal3D Team with Doxygen 1.8.14