|
| | 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 | renderFromServer (const AnimSnapshot &serverState, const AnimationInputs &inputs) |
| | PR-29: render the entity at server-authoritative animation state.
|
| 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.
|
| const std::vector< glm::mat4 > & | jointModelMatrices () const noexcept |
| | Model-space joint matrices with all procedural transforms applied (head pitch, wallrun mirror) but WITHOUT inverse-bind-matrix multiplication.
|
| const std::vector< glm::mat4 > & | skinMatrices () const noexcept |
| | Per-joint LBS skin matrices: procedural * modelMat * inverseBind.
|
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.
| const std::vector< glm::mat4 > & CharacterAnimator::jointModelMatrices |
( |
| ) |
const |
|
nodiscardnoexcept |
Model-space joint matrices with all procedural transforms applied (head pitch, wallrun mirror) but WITHOUT inverse-bind-matrix multiplication.
These are the matrices needed for hitbox capsule placement — each matrix transforms from bone-local space to the rig's model space. Apply the entity's world transform (position + yaw + scale) on top to get world space.
Valid after a call to update(). Size = numJoints().
PR-29: render the entity at server-authoritative animation state.
Bypasses the per-instance state machine (steps 1-6 of update()) — instead writes the supplied AnimSnapshot directly into the internal samplers and runs the ozz sampling + blending + LocalToModel pipeline on top. Used by the client renderer for REMOTE players whose animation state is replicated from the server via the snapshot stream; eliminates the residual ~0.4- median anim-state drift PR-27a's telemetry caught (server runs animator at 128 Hz, client at 30 Hz; both at 1.0× speed but per-clip start-time offsets persist for the lifetime of each clip).
The local player still uses update() — its prediction-driven state machine is authoritative client-side.
inputs is still consulted for per-frame post-processing that has no analog in the snapshot (head-pitch transform, wallrun mirror). Pass the SAME interp-delayed inputs you would have passed to update().