Polycode::Skeleton Class Reference

3D skeleton. More...

Inherits Polycode::SceneEntity.

List of all members.

Public Member Functions

 Skeleton (const String &fileName)
 Construct skeleton from a skeleton file.
void loadSkeleton (const String &fileName)
 Loads a new skeleton from file.
void playAnimation (const String &animName, bool once=false)
 Play back a loaded animation.
void addAnimation (const String &name, const String &fileName)
 Loads in a new animation from a file and adds it to the skeleton.
SkeletonAnimationgetAnimation (const String &name) const
 Returns a SkeletonAnimation by its name.
void Update ()
 Main update method.
BonegetBoneByName (const String &name) const
 Get bone instance by its name.
void bonesVisible (bool val)
 Toggles bone visibility on and off.
void enableBoneLabels (const String &labelFont, Number size, Number scale, Color labelColor)
 Enables labels with bone names to be rendered.
int getNumBones () const
 Returns the number of bones in the skeleton.
BonegetBone (int index) const
 Returns a bone at the specified index.
SkeletonAnimationgetCurrentAnimation () const
 Returns the current animation.

Detailed Description

3D skeleton.

Skeletons are applied to scene meshes and can be animated with loaded animations.


Constructor & Destructor Documentation

Skeleton::Skeleton ( const String fileName  ) 

Construct skeleton from a skeleton file.

Parameters:
fileName Skeleton file to load.

Member Function Documentation

void Skeleton::addAnimation ( const String name,
const String fileName 
)

Loads in a new animation from a file and adds it to the skeleton.

Parameters:
name Name of the new animation.
fileName File to load animation from.
void Skeleton::bonesVisible ( bool  val  ) 

Toggles bone visibility on and off.

Parameters:
val If true, bones will be rendered, if false, they will not.
void Skeleton::enableBoneLabels ( const String labelFont,
Number  size,
Number  scale,
Color  labelColor 
)

Enables labels with bone names to be rendered.

See SceneLabel for details on the parameters.

Parameters:
labelFont Font to use
size Size of font.
scale Scale of font.
labelColor Color of the label.
SkeletonAnimation * Skeleton::getAnimation ( const String name  )  const

Returns a SkeletonAnimation by its name.

Parameters:
Name of animation to return.
Bone * Skeleton::getBone ( int  index  )  const

Returns a bone at the specified index.

Parameters:
index Bone index.
Bone * Skeleton::getBoneByName ( const String name  )  const

Get bone instance by its name.

Parameters:
name Name of the bone.
void Skeleton::loadSkeleton ( const String fileName  ) 

Loads a new skeleton from file.

Parameters:
fileName Skeleton file to load.
void Skeleton::playAnimation ( const String animName,
bool  once = false 
)

Play back a loaded animation.

Parameters:
animName Name of animation to play.
once If true, will only play the animation once.
void Skeleton::Update (  )  [virtual]

Main update method.

Override this to do your updates before the render cycle.

Reimplemented from Polycode::Entity.

Generated on Sat Aug 11 18:04:11 2012 for Polycode by  doxygen 1.6.3