A skeleton (aka. "rig") is a re-usable Asset defined as a hierarchical set of interconnected articulated joints that define the "skin" of a Mesh. Mostly used to deform organic Mesh such as humans skeletons can also be used to animate the deformation of any type of objects such as a door, a cannon, branches on a tree etc...
Skeletons may not be hierarchical or interconnected and simply represents a higher level of description to describe a motion driven by an Action, or simply the part of the Mesh that need to be influenced.
See Also
Static Variables
Functions
Name | Description |
SetMesh | Connect an existing Mesh to the active Skeleton. |
Declaration bool SetMesh( Mesh *mesh ) Parameters
mesh : A valid reference to an existing Mesh or nil to disconnect the current Mesh associated to the Skeleton.
Return Value
true on success; else return false if the Mesh does not contains any vertex weights or if the joint index associated with the weight does not match the one of the active Skeleton.
|
GetJoint | Helper to retrieve an existing Joint by name. |
Declaration Joint *GetJoint( const char *name ) Parameters
name : Name of the Joint to retrieve the reference for.
Return Value
A nil value if no Joint contained in the active Skeleton matches the name received in parameter; else return the reference of the Joint that matches the name provided.
|
GetJointIndex | Retrieve the internal index of a specific Joint associated to the current Skeleton. |
Declaration int GetJointIndex( const Joint *joint ) Parameters
joint : A valid Joint reference.
Return Value
-1 if the joint reference passed to the function is invalid; else return its internal array index.
|
RenameJoint | Helper function to rename a specific Joint using its index as key. |
Declaration bool RenameJoint( unsigned short index, const char *name ) Parameters
index : Index of the Joint to rename.
name : The new name for the Joint.
Return Value
false if the index provided is out of range; else return true if the Joint have been renamed successfully.
|
VerifyMesh | Helper to verify if a specific Mesh can be deformed by the current Skeleton. |
Declaration bool VerifyMesh( Mesh *mesh ) Parameters
mesh : Reference to an existing Mesh.
Return Value
false if the mesh reference is invalid or if the Mesh does not contain any vertex weights or if the joint index associated with the weight does not match one of the active Skeleton.
</td>
|
GetJointAt | Return a Joint reference using its index as key. |
Declaration Joint *GetJointAt( unsigned short index ) Parameters
index : Index of the Joint to extract the reference for.
Return Value
nil if the index provided is out of scope; else return the reference of the Joint pointed by index.
|
AllocJoints | Manually allocate an array of Joint. |
Declaration void AllocJoints( unsigned short count ) Parameters
count : The amount of Joint to be allocated.
|
SetJoint | Manually set a specific Joint properties. |
Declaration bool SetJoint( unsigned short index, const char *name, int parent_index, const mat4 bind_matrix ) Parameters
index : Index of the Joint to update.
name : The new name of the Joint.
parent_index : Specify the parent Joint index; -1 if the Joint is a root.
bind_matrix : 4x4 transformation matrix relative to the parent Joint transformation (if any) that will be use to to calculate the bind pose of the Skeleton.
Return Value
true on success; false index provided is out of bounds.
|
CalculateLocalBounds | Manually force to recalculate the LocalBounds of the Skeleton. |
Declaration void CalculateLocalBounds( void )
|
Joint
Describes how the movement between two body parts attached to a Skeleton move in relation to each other. Each Joint is described by a name which acts as a unique identifier, a relation index to its parent Joint (if any) and a 4x4 transformation (aka. bind_matrix
) which represent its resting position.
Static Variables
Name | Description |
name | Current name of the active Joint. |
Declaration
|
parent_index | Parent Joint index (if any); -1 if root. |
Declaration
|
bind_matrix | 4x4 matrix to define the resting transformation of the Joint. |
Declaration
|