group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
AnimatedCharacter.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
7
8#include <memory>
9
22{
23 std::unique_ptr<CharacterAnimator> animator;
24 int modelIndex = -1;
25
26 // Animation tick decoupling (perf Phase 3c).
27 //
28 // ozz pose sampling + skin-matrix flatten costs ~10-20 µs per character.
29 // Running it every render frame (potentially 1000+ FPS) is pure waste —
30 // human eyes can't tell the difference between 30 Hz and 1000 Hz pose
31 // updates as long as the world transform interpolates smoothly between
32 // samples. We accumulate render-thread frame time per character and
33 // only call animator->update() when enough time has passed for a fresh
34 // sample (default cadence in Game.cpp). Initialised to a large value so
35 // the very first frame always samples.
36 float animationAccumulator = 1.0f;
37};
Per-entity animator — state machine, sampling, blending, CPU skinning.
ECS component for an animated, skin-rendered character.
Definition AnimatedCharacter.hpp:22
std::unique_ptr< CharacterAnimator > animator
Per-entity sampling/blending/skinning state.
Definition AnimatedCharacter.hpp:23
float animationAccumulator
Seconds since last animator->update().
Definition AnimatedCharacter.hpp:36
int modelIndex
Renderer model index for this entity's skinned vertex buffer.
Definition AnimatedCharacter.hpp:24