Nv::NvSkeleton Class Reference
NvSkeleton holds an array of nodes that comprise the hierarchy of transformations for the model. More...
#include <NvSkeleton.h>
Public Member Functions | |
NvSkeleton () | |
Default constructor. Creates skeleton with 0 bones. | |
NvSkeleton (const NvSkeletonNode *pNodes, uint32_t numNodes) | |
Constructor initializes skeleton with the given array of nodes. | |
int32_t | GetNumNodes () const |
Retrieves the number of nodes contained in the skeleton. | |
int32_t | GetNodeIndexByName (const std::string &name) const |
Retrieves the index of the first node in the skeleton with the given name. | |
const NvSkeletonNode * | GetNodeByName (const std::string &name) const |
Retrieves the first node in the skeleton with the given name. | |
const NvSkeletonNode * | GetNodeByIndex (uint32_t index) const |
Retrieves the node in the node array at the given index. | |
nv::matrix4f * | GetTransforms () |
Retrieves a pointer to the array of matrices representing the current model-space transforms for the nodes of the skeleton. | |
nv::matrix4f * | GetTransform (uint32_t index) |
Retrieves a pointer to the matrix representing the current model-space transform of the node at the given index. | |
Protected Types | |
typedef std::vector < NvSkeletonNode > | NodeArray |
typedef std::vector< nv::matrix4f > | NodeTransformArray |
Protected Attributes | |
NodeArray | m_nodes |
NodeTransformArray | m_nodeTransforms |
Detailed Description
NvSkeleton holds an array of nodes that comprise the hierarchy of transformations for the model.These nodes form the basis for applying hierarchical transformations to meshes within a model as well as skinning those meshes. An NvSkeleton is a tree where each node has at most one parent, and the index of a parent node MUST be less than that of all of its children. This allows all transforms to be propagated through the tree with a single sequential traversal of the array and any operations performed on nodes in such a traversal to be performed on any child's parent before the child itself. Note that a skeleton may contain more than one "tree" (i.e. multiple nodes with no parent node), but by definition, node 0 is the root of a tree.
Constructor & Destructor Documentation
Nv::NvSkeleton::NvSkeleton | ( | const NvSkeletonNode * | pNodes, | |
uint32_t | numNodes | |||
) |
Constructor initializes skeleton with the given array of nodes.
- Parameters:
-
pNodes Pointer to an array of NvSkeletonNodes that have been initialized with data defining the skeletal hierarchy numNodes Number of NvSkeletonNodes contained in the array pointed to by pNodes
Member Function Documentation
const NvSkeletonNode* Nv::NvSkeleton::GetNodeByIndex | ( | uint32_t | index | ) | const |
Retrieves the node in the node array at the given index.
- Parameters:
-
index Index of the node to retrieve
- Returns:
- A pointer to the node at the index provided. NULL if the index was not valid
const NvSkeletonNode* Nv::NvSkeleton::GetNodeByName | ( | const std::string & | name | ) | const |
Retrieves the first node in the skeleton with the given name.
- Parameters:
-
name Name of the node to find
- Returns:
- A pointer to the node whose name matches that provided. NULL if no node contained a matching name
- Note:
- There may be more than one node in the skeleton with the given name. The matching node with the lowest index will be returned.
int32_t Nv::NvSkeleton::GetNodeIndexByName | ( | const std::string & | name | ) | const |
Retrieves the index of the first node in the skeleton with the given name.
- Parameters:
-
name Name of the node to find
- Returns:
- The index of the first node with a name matching that provided, but -1 if no node contained a matching name
- Note:
- There may be more than one node in the skeleton with the given name. The matching node with the lowest index will be returned.
int32_t Nv::NvSkeleton::GetNumNodes | ( | ) | const [inline] |
Retrieves the number of nodes contained in the skeleton.
- Returns:
- Number of nodes contained in the skeleton
nv::matrix4f* Nv::NvSkeleton::GetTransform | ( | uint32_t | index | ) |
Retrieves a pointer to the matrix representing the current model-space transform of the node at the given index.
- Parameters:
-
index Index of the node in the skeleton for which to retrieve a current transform
- Returns:
- A pointer to the matrix representing the current transform of the node at the given index, but NULL if the index was invalid.
nv::matrix4f* Nv::NvSkeleton::GetTransforms | ( | ) |
Retrieves a pointer to the array of matrices representing the current model-space transforms for the nodes of the skeleton.
- Returns:
- A pointer to the array of current transform matrices, NULL if there are no nodes, thus no current transforms.
The documentation for this class was generated from the following file: