Om
1.0.0
A universal framework for multimedia simulation
|
A class that describes a hierarchy of bones with corresponding transformations. More...
#include <omGraphicsSkeleton.h>
Classes | |
class | Bone |
A class that stores information about a bone that makes up a skeleton. More... | |
Public Member Functions | |
Skeleton () | |
Create an empty skeleton with no bones. More... | |
Size | getBoneCount () const |
Return the number of bones there are in this skeleton. More... | |
const Bone & | getBone (Index boneIndex) const |
Return a reference to the bone in this skeleton at the specified index. More... | |
Bool | getBoneIndex (const UTF8String &boneName, Index &boneIndex) const |
Determine the index of the first bone in this skeleton with the specified name. More... | |
Index | addBone (const Bone &newBone) |
Add a new bone to this skeleton. More... | |
Bool | removeBone (Index boneIndex) |
Remove the bone at the specified index from this skeleton. More... | |
Bool | removeBoneUpdateParents (Index boneIndex) |
Remove the bone at the specified index from this skeleton. More... | |
void | clearBones () |
Remove all bones from this skeleton. More... | |
const Transform3 & | getBoneTransform (Index boneIndex) const |
Return a reference to the parent-relative transformation of the bone at the specified index. More... | |
Bool | setBoneTransform (Index boneIndex, const Transform3 &newTransform) |
Set the parent-relative transformation of the bone at the specified index in this skeleton. More... | |
const Transform3 & | getBoneBindTransform (Index boneIndex) const |
Return a reference to the parent-relative bind transformation of the bone at the specified index. More... | |
Bool | setBoneBindTransform (Index boneIndex, const Transform3 &newTransform) |
Set the parent-relative bind transformation of the bone at the specified index in this skeleton. More... | |
const UTF8String & | getBoneName (Index boneIndex) const |
Return a reference to the name of the bone at the specified index. More... | |
Bool | setBoneName (Index boneIndex, const UTF8String &newName) |
Set the name of the bone at the specified index in this skeleton. More... | |
Index | getBoneParent (Index boneIndex) const |
Return the index of the parent of the bone at the specified index. More... | |
Bool | setBoneParent (Index boneIndex, Index newParentIndex) |
Set the index of the parent of the bone at the specified index in this skeleton. More... | |
const Matrix4 & | getBoneMatrix (Index boneIndex) const |
Return a reference to the bone-to-world transformation matrix of the bone at the specified index. More... | |
const Matrix4 * | getBoneMatrices () const |
Return a pointer to an array of bone-to-world transformation matrices for this skeleton's bones. More... | |
void | updateBoneMatrices (const Matrix4 &worldTransform) |
Update the bone matrices for this skeleton for the specified skeleton-to-world transformation. More... | |
Static Public Attributes | |
static const ResourceType | RESOURCE_TYPE |
The resource type for a graphics skeleton. More... | |
static const Index | INVALID_BONE = Index(-1) |
The index used to indicate an invalid bone index. More... | |
A class that describes a hierarchy of bones with corresponding transformations.
om::graphics::shapes::Skeleton::Skeleton | ( | ) |
Create an empty skeleton with no bones.
|
inline |
Return the number of bones there are in this skeleton.
Return a reference to the bone in this skeleton at the specified index.
Bool om::graphics::shapes::Skeleton::getBoneIndex | ( | const UTF8String & | boneName, |
Index & | boneIndex | ||
) | const |
Determine the index of the first bone in this skeleton with the specified name.
The method places the bone index in the output parameter and returns TRUE if there is a bone with that name in the skeleton. If not, FALSE is returned indicating there was no bone with that name.
Add a new bone to this skeleton.
The method returns the index of the new bone in this skeleton. There are no restrictions on the parent index range, since the parent index may reference bones that are not added to the skeleton yet. During skeleton updating, an out-of-range parent index is interpreted as INVALID_BONE.
Remove the bone at the specified index from this skeleton.
The method returns whether or not the bone was successfully removed. The parent indices of the bones are not affected.
Remove the bone at the specified index from this skeleton.
The method returns whether or not the bone was successfully removed. This method automatically adjusts all bone parent indices that are greater than the removed bone index so that the reflect the new bone indices.
void om::graphics::shapes::Skeleton::clearBones | ( | ) |
Remove all bones from this skeleton.
|
inline |
Return a reference to the parent-relative transformation of the bone at the specified index.
|
inline |
Set the parent-relative transformation of the bone at the specified index in this skeleton.
The method returns whether or not the operation was successful.
|
inline |
Return a reference to the parent-relative bind transformation of the bone at the specified index.
|
inline |
Set the parent-relative bind transformation of the bone at the specified index in this skeleton.
The method returns whether or not the operation was successful.
|
inline |
Return a reference to the name of the bone at the specified index.
|
inline |
Set the name of the bone at the specified index in this skeleton.
The method returns whether or not the operation was successful.
Return the index of the parent of the bone at the specified index.
The method returns INVALID_BONE_INDEX if there is no parent for that bone.
Set the index of the parent of the bone at the specified index in this skeleton.
The method returns whether or not the operation was successful.
Return a reference to the bone-to-world transformation matrix of the bone at the specified index.
|
inline |
Return a pointer to an array of bone-to-world transformation matrices for this skeleton's bones.
void om::graphics::shapes::Skeleton::updateBoneMatrices | ( | const Matrix4 & | worldTransform | ) |
Update the bone matrices for this skeleton for the specified skeleton-to-world transformation.
This method should be called once per frame before drawing any meshes that use this skeleton.
|
static |
The resource type for a graphics skeleton.
The index used to indicate an invalid bone index.