Skeleton
Class for representing armatures in the GameCube engine..
The skeleton is defined by a hierarchy of bones and manages bone
matrices for skeletal animation. It provides methods to calculate bone
inverse matrices, update bone transformations, and manage bone data for
vertex skinning.
- Manages collection of bones in hierarchy
- Calculates bone inverse matrices for bind pose
- Updates bone matrices for animation
Methods
Skeleton(const vector<Bone>& bones, const vector<Mtx>& boneInverses)
Constructor with bones and optional inverse matrices
| bones | Array of bones defining the skeleton | empty |
| boneInverses | Array of bone inverse matrices | empty |
void init()
Initializes the skeleton with bone data
void calculateInverses()
Computes the bone inverse matrices from current bone world matrices
void pose()
Resets the skeleton to the base pose using inverse matrices
void update()
Updates bone matrices for animation and prepares bone data
void computeBoneTexture()
Computes a data texture for passing bone data to vertex shader
Bone* getBoneByName(const string& name)
Searches for a bone with the specified name
| name | The name of the bone to find | "" |
Skeleton* clone()
Returns a clone of this Skeleton object
Properties
| boneInverses | vector<Mtx*> | Array of bone inverse matrices |
| boneMatrices | f32* | Array buffer holding bone data |
| boneTexture | Texture* | Texture holding bone data for vertex shader |
| bones | vector<Bone*> | Array of bones defining the skeleton |
| enabled | bool | Active/inactive |
| id | u32 | Unique identifier |
| isSkeleton | bool | Read-only tag |
| matricesHash | u32 | hash of last flattened matrices to detect changes |
| name | string | Optional display name |
| uuid | string | UUID string |
| version | u32 | Bumps on change |