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

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
 
CharacterAnimatoroperator= (const CharacterAnimator &)=delete
 
 CharacterAnimator (CharacterAnimator &&) noexcept=delete
 
CharacterAnimatoroperator= (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CharacterAnimator() [1/3]

CharacterAnimator::CharacterAnimator ( const CharacterRig rig,
const AnimationLibrary library 
)
Here is the call graph for this function:

◆ ~CharacterAnimator()

CharacterAnimator::~CharacterAnimator ( )
default

◆ CharacterAnimator() [2/3]

CharacterAnimator::CharacterAnimator ( const CharacterAnimator )
delete

◆ CharacterAnimator() [3/3]

CharacterAnimator::CharacterAnimator ( CharacterAnimator &&  )
deletenoexcept

Member Function Documentation

◆ computeSkinnedVertices()

void CharacterAnimator::computeSkinnedVertices ( std::vector< std::vector< ModelVertex > > &  out) const

Apply CPU skinning to every rig mesh, producing animated vertices.

Parameters
outOne output vector per rig mesh; internally resized.

◆ debugOverride()

ClipId CharacterAnimator::debugOverride ( ) const
noexcept

Current debug override clip (_Count = no override).

◆ numJoints()

int CharacterAnimator::numJoints ( ) const
noexcept

Number of joints in the underlying rig.

Here is the caller graph for this function:

◆ operator=() [1/2]

CharacterAnimator & CharacterAnimator::operator= ( CharacterAnimator &&  )
deletenoexcept

◆ operator=() [2/2]

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

◆ samplers()

const std::array< ClipSampler, kNumSamplerSlots > & CharacterAnimator::samplers ( ) const
noexcept

Snapshot of the current sampler slots (for UI inspection).

◆ setDebugOverride()

void CharacterAnimator::setDebugOverride ( ClipId  id,
bool  loop = true 
)

Force a single clip to play, bypassing the graph.

Parameters
idClipId::_Count to clear the override.
loopLooping mode (reserved; current implementation always loops).

◆ setDebugPlaybackSpeed()

void CharacterAnimator::setDebugPlaybackSpeed ( float  mul)
noexcept

Playback-speed multiplier applied in debug-override mode.

◆ setSkinningBackend()

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.

◆ update()

void CharacterAnimator::update ( const AnimationInputs inputs,
float  dt 
)

Advance the state machine, sample + blend, and compute skin matrices.

Parameters
inputsCurrent driving inputs (velocity, yaw, movement mode, …).
dtFrame time in seconds.
Here is the call graph for this function:

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