|
group2 0.1.0
CSE 125 Group 2
|
Per-entity animator. More...
#include <CharacterAnimator.hpp>
Classes | |
| struct | Impl |
Public Member Functions | |
| CharacterAnimator (const CharacterRig &rig, const AnimationLibrary &library) | |
| ~CharacterAnimator () | |
| CharacterAnimator (const CharacterAnimator &)=delete | |
| CharacterAnimator & | operator= (const CharacterAnimator &)=delete |
| CharacterAnimator (CharacterAnimator &&) noexcept=delete | |
| CharacterAnimator & | operator= (CharacterAnimator &&) noexcept=delete |
| void | setSkinningBackend (const ISkinningBackend *backend) |
| Set the skinning backend (non-owning). | |
| void | update (const AnimationInputs &inputs, float dt) |
| Advance the state machine, sample + blend, and compute skin matrices. | |
| void | computeSkinnedVertices (std::vector< std::vector< ModelVertex > > &out) const |
| Apply CPU skinning to every rig mesh, producing animated vertices. | |
| void | setDebugOverride (ClipId id, bool loop=true) |
| Force a single clip to play, bypassing the graph. | |
| ClipId | debugOverride () const noexcept |
Current debug override clip (_Count = no override). | |
| const std::array< ClipSampler, kNumSamplerSlots > & | samplers () const noexcept |
| Snapshot of the current sampler slots (for UI inspection). | |
| void | setDebugPlaybackSpeed (float mul) noexcept |
| Playback-speed multiplier applied in debug-override mode. | |
| int | numJoints () const noexcept |
| Number of joints in the underlying rig. | |
Per-entity animator.
Runs a small state machine that chooses which clips play, samples + blends them via ozz, converts to model-space matrices, and hands off to the skinning backend to produce deformed vertices.
Needs non-owning references to the shared rig + clip library + skinning backend, all of which must outlive the animator.
| CharacterAnimator::CharacterAnimator | ( | const CharacterRig & | rig, |
| const AnimationLibrary & | library | ||
| ) |
|
default |
|
delete |
|
deletenoexcept |
| void CharacterAnimator::computeSkinnedVertices | ( | std::vector< std::vector< ModelVertex > > & | out | ) | const |
Apply CPU skinning to every rig mesh, producing animated vertices.
| out | One output vector per rig mesh; internally resized. |
|
noexcept |
Current debug override clip (_Count = no override).
|
noexcept |
Number of joints in the underlying rig.
|
deletenoexcept |
|
delete |
|
noexcept |
Snapshot of the current sampler slots (for UI inspection).
| void CharacterAnimator::setDebugOverride | ( | ClipId | id, |
| bool | loop = true |
||
| ) |
Force a single clip to play, bypassing the graph.
| id | ClipId::_Count to clear the override. |
| loop | Looping mode (reserved; current implementation always loops). |
|
noexcept |
Playback-speed multiplier applied in debug-override mode.
| void CharacterAnimator::setSkinningBackend | ( | const ISkinningBackend * | backend | ) |
Set the skinning backend (non-owning).
Must outlive the animator. Phase-1: use CpuLbsSkinningBackend. Phase-2: GpuSkinningBackend will slot in here unchanged.
| void CharacterAnimator::update | ( | const AnimationInputs & | inputs, |
| float | dt | ||
| ) |
Advance the state machine, sample + blend, and compute skin matrices.
| inputs | Current driving inputs (velocity, yaw, movement mode, …). |
| dt | Frame time in seconds. |