Skinned mesh with skeletal animation, loaded from FBX (Mixamo).
More...
#include <SkinnedModel.hpp>
Skinned mesh with skeletal animation, loaded from FBX (Mixamo).
Uses Assimp to extract skeleton, skin weights, and animation from FBX. Converts to ozz-animation runtime format for efficient CPU-side playback. Each update() call advances the animation clock, samples the skeleton pose, and rewrites the vertex buffer with linear-blend skinning.
Workflow:
- load() → parse FBX, build ozz skeleton + animation
- getLoadedModel() → hand to Renderer for initial GPU upload
- update(dt) each frame → recompute skinned vertices
- getSkinnedVertices(meshIdx) → re-upload to GPU vertex buffer
◆ SkinnedModel() [1/3]
| SkinnedModel::SkinnedModel |
( |
| ) |
|
◆ ~SkinnedModel()
| SkinnedModel::~SkinnedModel |
( |
| ) |
|
|
default |
◆ SkinnedModel() [2/3]
◆ SkinnedModel() [3/3]
◆ duration()
| float SkinnedModel::duration |
( |
| ) |
const |
Animation clip duration in seconds.
- Returns
- Duration in seconds, or 0 if no animation is loaded.
◆ getLoadedModel()
| const LoadedModel & SkinnedModel::getLoadedModel |
( |
| ) |
const |
Model data for initial GPU upload (first-frame vertices + indices + materials).
- Returns
- Reference to the loaded model data. Valid after load() returns true.
◆ getSkinnedVertices()
| const std::vector< ModelVertex > & SkinnedModel::getSkinnedVertices |
( |
size_t |
meshIndex = 0 | ) |
const |
Current frame's skinned vertices for mesh meshIndex.
- Parameters
-
| meshIndex | Index of the mesh to query (default 0). |
- Returns
- Reference to the skinned vertex buffer, updated by update().
◆ isLoaded()
| bool SkinnedModel::isLoaded |
( |
| ) |
const |
True after a successful load().
- Returns
- Whether model data is available.
◆ load()
| bool SkinnedModel::load |
( |
const std::string & |
path | ) |
|
Load an FBX file containing skeleton, mesh, and animation data.
- Parameters
-
| path | Absolute path to the .fbx file. |
- Returns
- True on success (skeleton + at least one skinned mesh + animation).
◆ meshCount()
| size_t SkinnedModel::meshCount |
( |
| ) |
const |
Number of skinned meshes in the model.
- Returns
- Mesh count.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ update()
| void SkinnedModel::update |
( |
float |
dt | ) |
|
Advance animation by dt seconds (loops automatically) and recompute all CPU-skinned vertices.
- Parameters
-
The documentation for this class was generated from the following files: