group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
SkinnedModel Class Reference

Skinned mesh with skeletal animation, loaded from FBX (Mixamo). More...

#include <SkinnedModel.hpp>

Classes

struct  Impl
 

Public Member Functions

 SkinnedModel ()
 
 ~SkinnedModel ()
 
 SkinnedModel (SkinnedModel &&) noexcept
 
SkinnedModeloperator= (SkinnedModel &&) noexcept
 
 SkinnedModel (const SkinnedModel &)=delete
 
SkinnedModeloperator= (const SkinnedModel &)=delete
 
bool load (const std::string &path)
 Load an FBX file containing skeleton, mesh, and animation data.
 
void update (float dt)
 Advance animation by dt seconds (loops automatically) and recompute all CPU-skinned vertices.
 
const LoadedModelgetLoadedModel () const
 Model data for initial GPU upload (first-frame vertices + indices + materials).
 
const std::vector< ModelVertex > & getSkinnedVertices (size_t meshIndex=0) const
 Current frame's skinned vertices for mesh meshIndex.
 
size_t meshCount () const
 Number of skinned meshes in the model.
 
float duration () const
 Animation clip duration in seconds.
 
bool isLoaded () const
 True after a successful load().
 

Detailed Description

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:

  1. load() → parse FBX, build ozz skeleton + animation
  2. getLoadedModel() → hand to Renderer for initial GPU upload
  3. update(dt) each frame → recompute skinned vertices
  4. getSkinnedVertices(meshIdx) → re-upload to GPU vertex buffer

Constructor & Destructor Documentation

◆ SkinnedModel() [1/3]

SkinnedModel::SkinnedModel ( )

◆ ~SkinnedModel()

SkinnedModel::~SkinnedModel ( )
default

◆ SkinnedModel() [2/3]

SkinnedModel::SkinnedModel ( SkinnedModel &&  )
defaultnoexcept

◆ SkinnedModel() [3/3]

SkinnedModel::SkinnedModel ( const SkinnedModel )
delete

Member Function Documentation

◆ duration()

float SkinnedModel::duration ( ) const

Animation clip duration in seconds.

Returns
Duration in seconds, or 0 if no animation is loaded.
Here is the caller graph for this function:

◆ 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.
Here is the caller graph for this function:

◆ getSkinnedVertices()

const std::vector< ModelVertex > & SkinnedModel::getSkinnedVertices ( size_t  meshIndex = 0) const

Current frame's skinned vertices for mesh meshIndex.

Parameters
meshIndexIndex of the mesh to query (default 0).
Returns
Reference to the skinned vertex buffer, updated by update().
Here is the caller graph for this function:

◆ isLoaded()

bool SkinnedModel::isLoaded ( ) const

True after a successful load().

Returns
Whether model data is available.
Here is the caller graph for this function:

◆ load()

bool SkinnedModel::load ( const std::string &  path)

Load an FBX file containing skeleton, mesh, and animation data.

Parameters
pathAbsolute path to the .fbx file.
Returns
True on success (skeleton + at least one skinned mesh + animation).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ meshCount()

size_t SkinnedModel::meshCount ( ) const

Number of skinned meshes in the model.

Returns
Mesh count.
Here is the caller graph for this function:

◆ operator=() [1/2]

SkinnedModel & SkinnedModel::operator= ( const SkinnedModel )
delete

◆ operator=() [2/2]

SkinnedModel & SkinnedModel::operator= ( SkinnedModel &&  )
defaultnoexcept

◆ update()

void SkinnedModel::update ( float  dt)

Advance animation by dt seconds (loops automatically) and recompute all CPU-skinned vertices.

Parameters
dtTime step in seconds.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: