#include <WSkeletalAnimation.hpp>
This class represents a single bone in a skeleton. The final matrix of this bone is calculated by GetInvBindingPose() * GetRelativeMatrix().
◆ AddChild()
| void WBone::AddChild |
( |
WBone * |
child | ) |
|
Adds a child to this bone.
- Parameters
-
| child | Pointer to the new child |
◆ ClearChildren()
| void WBone::ClearChildren |
( |
| ) |
|
Clears all children of this bone.
◆ GetChild() [1/2]
| WBone* WBone::GetChild |
( |
std::string |
name | ) |
const |
Retrieves a child by name.
- Parameters
-
| name | Name of the child to retrieve |
- Returns
- The child with the name name, or nullptr if it is invalid
◆ GetChild() [2/2]
| WBone* WBone::GetChild |
( |
uint32_t |
index | ) |
const |
Retrieve a pointer to the child with the given index.
- Parameters
-
- Returns
- The child at index, or nullptr if index is invalid
◆ GetIndex()
| uint32_t WBone::GetIndex |
( |
| ) |
const |
Retrieves the index of this bone.
- Returns
- Index of this bone
◆ GetInvBindingPose()
| WMatrix WBone::GetInvBindingPose |
( |
| ) |
const |
Retrieves the inverse binding pose for this bone.
- Returns
- The inverse binding pose matrix.
◆ GetMatrix()
Retrieves the local matrix of this bone.
- Returns
- Local matrix of this bone
◆ GetName()
| void WBone::GetName |
( |
char * |
name, |
|
|
uint32_t |
maxChars |
|
) |
| const |
Retrieves the name of this bone.
- Parameters
-
| name | A character array to be filled with the name |
| maxChars | Maximum number of characters to fill in name |
◆ GetNumChildren()
| uint32_t WBone::GetNumChildren |
( |
| ) |
const |
Retrieves the number of children this bone has.
- Returns
- Number of children for this bone
◆ GetParent()
| WBone* WBone::GetParent |
( |
| ) |
const |
Retrieves a pointer to the parent of this bone.
- Returns
- Parent of this bone
◆ GetRelativeMatrix()
| WMatrix WBone::GetRelativeMatrix |
( |
| ) |
|
Retrieves the local matrix of this bone multiplied by the relative matrix of the parent bone (will recursively produce the final matrix for this bone).
- Returns
- Relative (final) matrix of this bone.
◆ GetScale()
Retrieves the scale of this bone.
- Returns
- A 3D vector representing the scale components
◆ Load()
| WError WBone::Load |
( |
std::istream & |
inputStream | ) |
|
Load this bone from a file stream as a bone format.
- Parameters
-
| inputStream | Stream to read the data from |
- Returns
- Error code, see WError.h
◆ OnStateChange()
This is a callback (inherited from WOrientation) to inform this object of a change in orientation.
- Parameters
-
| type | Orientation change type (rotation or motion) |
Reimplemented from WOrientation.
◆ Save()
| WError WBone::Save |
( |
std::ostream & |
outputStream | ) |
const |
Save this bone to a file stream as a bone format.
- Parameters
-
| outputStream | Stream to read the data from |
- Returns
- Error code, see WError.h
◆ Scale() [1/2]
| void WBone::Scale |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
Sets the scale of this bone.
- Parameters
-
| x | Scale x multiplier |
| y | Scale y multiplier |
| z | Scale z multiplier |
◆ Scale() [2/2]
Sets the scale of this bone.
- Parameters
-
| scale | A 3D vector representing the scale components |
◆ SetIndex()
| void WBone::SetIndex |
( |
uint32_t |
index | ) |
|
Sets the index of this bone.
- Parameters
-
◆ SetInvBindingPose()
| void WBone::SetInvBindingPose |
( |
WMatrix |
mtx | ) |
|
Sets the inverse matrix of the binding pose for this bone.
- Parameters
-
| mtx | Inverse binding pose matrix |
◆ SetName()
| void WBone::SetName |
( |
std::string |
name | ) |
|
Sets the name of this bone.
- Parameters
-
◆ SetParent()
| void WBone::SetParent |
( |
WBone * |
parent | ) |
|
Sets the parent of this bone.
- Parameters
-
| Parent | pointer to the new parent |
◆ UpdateLocals()
| bool WBone::UpdateLocals |
( |
| ) |
|
Updates the local matrix of this bone. This function should only be called by WSkeleton.
- Returns
- true if the local matrix has changed, false if not.
The documentation for this class was generated from the following file: