Go to the source code of this file.
- Copyright
- 2024 - Max Bebök @license MIT
◆ t3d_model_draw_skinned()
Draws a skinned model with default settings. Alternatively, use 't3d_model_draw_custom' and set 'matrices' in the config.
- Parameters
-
◆ t3d_skeleton_blend()
Blends two skeletons together. Note: it is safe to use the same skeleton as an input and output parameter.
- Parameters
-
| skelRes | Resulting skeleton |
| skelA | First skeleton |
| skelB | Second skeleton |
| factor | Blend factor (0.0-1.0), you are allowed to go beyond these values to "overdrive" animations |
◆ t3d_skeleton_clone()
Clones a skeleton instance. This can also be used to create optimized skeletons for blending animations.
- Parameters
-
| skel | Skeleton to clone |
| useMatrices | If false, no matrices will be allocated, this is useful for blending animations |
- Returns
- Cloned skeleton
◆ t3d_skeleton_create()
Creates a skeleton instance from a model's skeleton definition
- Parameters
-
| model | The model to create the skeleton from |
- Returns
- The created skeleton
◆ t3d_skeleton_create_buffered()
Creates a skeleton instance from a model's skeleton definition. It will internally reserve multiple matrix stacks to allow for buffering. This can be used to update a skeleton while the last frame is still being rendered. Note that only the fixed-point matrices are buffered, the bone data itself is not.
- Parameters
-
| model | The model to create the skeleton from |
| bufferCount | number of buffers, should match the frame-buffer count |
- Returns
- The created skeleton
- Copyright
- 2024 - Max Bebök @license MIT
◆ t3d_skeleton_destroy()
Frees data allocated in the skeleton struct. Note: it's safe to call this multiple times, pointers are set to NULL.
- Parameters
-
| skeleton | The skeleton to destroy |
◆ t3d_skeleton_find_bone()
| int t3d_skeleton_find_bone |
( |
T3DSkeleton * | skeleton, |
|
|
const char * | name ) |
Tries to finds a bone with the given name in the skeleton. Returns the index of the bone or -1 if not found.
- Parameters
-
| skeleton | The skeleton to search in |
| name | Name of the bone to find |
- Returns
- Index of the bone or -1 if not found
◆ t3d_skeleton_get_bone_pos_model_space()
| static T3DVec3 t3d_skeleton_get_bone_pos_model_space |
( |
const T3DSkeleton * | skeleton, |
|
|
int | boneIdx ) |
|
inlinestatic |
Gets the position in model space of the bone with the given index from its matrix. This assumes the bone matrix has been updated beforehand with t3d_skeleton_update.
- Parameters
-
| skeleton | The skeleton containing the bone |
| boneIdx | Index of the bone |
- Returns
- The T3DVec3 position of the bone in model space
◆ t3d_skeleton_reset()
Resets a skeleton to its initial state (resting pose). This can be useful when switching between animations. Note: To recalculate the bone matrices too, call 't3d_skeleton_update' afterwards.
- Parameters
-
| skeleton | The skeleton to reset |
◆ t3d_skeleton_update()
Updates the skeleton's bone matrices if data has changed. Call this after making changes to the bones individual properties (pos/rot/scale). To make this work, the hasChanged flag in the bone must also be set
- Parameters
-
| skeleton | The skeleton to update |
◆ t3d_skeleton_use()
| static void t3d_skeleton_use |
( |
const T3DSkeleton * | skel | ) |
|
|
inlinestatic |
Sets the given skeleton up for the next draw call. This has to be used for buffered skeletons, but is a no-op for single-buffer skeletons.
- Parameters
-
| skel | skeleton to use in the next draw |