#include <Skeleton.h>
Public Methods | |
| Skeleton (Bone *root) | |
| Constructs a Skeleton with one Bone (the root). | |
| ~Skeleton () | |
| Destructor destroys the Skeleton and deallocates all memory for the Bone objects that it holds. | |
| Bone * | getRoot () |
| Returns the root Bone of the Skeleton. | |
| Bone * | findBone (const std::string &boneName) |
| Searches the entire Bone hierarchy for the Bone with the specified name. | |
| void | addBone (Bone *parent, Bone *newBone) |
| Adds a Bone to be the child of the given parent. | |
| void | debugRender (StaticModel &m) |
| Provides a debug rendering by rendering the given model using each Bone's matrix. | |
| void | updateHierarchy (const Matrix &worldMat) |
| Updates all Bones in this skeleton, using the passed world matrix as the starting transformation. | |
| BonePtrListIter | beginBones () |
| Returns an iterator to the start of a linear collection of all Bone objects in this Skeleton. | |
| BonePtrListIter | endBones () |
| Returns an iterator to one past the last Bone in the collection of bones, exactly as the end method for an STL container. | |
Bones can be addressed by name, or by an index (as in an array). Other than acting as a linear container for bones, the Skeleton has no functionality. The Skeleon class is responsible for the memory of the bones. The usefulness of the Skeleton comes from the fact that you can get a sequential list of bones, or get the "root" bone and traverse the tree. When rendering the mesh or generating a list of bones, the linear access is well-suited, when applying/calculating transforms, tree traversal is well-suited.
|
|
Constructs a Skeleton with one Bone (the root). The memory for this root Bone becomes the responsiblity of this Skeleton. The passed pointer must not be NULL. |
|
|
Destructor destroys the Skeleton and deallocates all memory for the Bone objects that it holds. Any Bone objects that are part of this Skeleton are destroyed as a result. |
|
||||||||||||
|
Adds a Bone to be the child of the given parent. The parent must be a Bone from this Skeleton. The Bone newBone is added to the end of the list of Bones, so the linear list of bones is ordered by addition. Adding bones in this way allows one to create any Bone hierarchy but with an additional arbitrary traversal ordering. The memory for newBone becomes the responsibility of Skeleton. Adding bones invalidates any iterators from beginBones or endBones. |
|
|
Returns an iterator to the start of a linear collection of all Bone objects in this Skeleton. This iterator is an STL-compliant iterator of Bone*. The order of the bones is the order is the order they were inserted into the Skeleton. Adding bones invalidates any iterators from beginBones or endBones. |
|
|
Provides a debug rendering by rendering the given model using each Bone's matrix. It is suggested that the model is oriented around the origin so that the model is drawn about the transformed origin of all the Bones. |
|
|
Returns an iterator to one past the last Bone in the collection of bones, exactly as the end method for an STL container. Adding bones invalidates any iterators from beginBones or endBones. |
|
|
Searches the entire Bone hierarchy for the Bone with the specified name. Returns NULL if the Bone is not found, or a pointer to the located Bone. If more than one Bone of the same name exists in the hierarchy, then one of them will be returned. |
|
|
Returns the root Bone of the Skeleton. If the Skeleton has no bones, then NULL is returned. |
1.2.18