|
group2 0.1.0
CSE 125 Group 2
|
PR-27 — per-entity animation state snapshot, decoupled from CharacterAnimator. More...
#include <algorithm>#include <array>#include <cmath>#include <cstddef>#include <cstdint>Go to the source code of this file.
Classes | |
| struct | AnimSlot |
| One slot in an entity's blend stack. More... | |
| struct | AnimSnapshot |
| Snapshot of an entity's full animation state at one instant. More... | |
| struct | PendingShotIntent |
| PR-27: transient component placed on the shooter entity for the duration of one runWeapon invocation when the matching SHOT_INTENT packet was received from that client. More... | |
Namespaces | |
| namespace | anim_snapshot |
Functions | |
| float | anim_snapshot::delta (const AnimSnapshot &a, const AnimSnapshot &b) |
| PR-27 animation-state delta. | |
| void | anim_snapshot::pack (const AnimSlot &s, std::uint8_t out[4]) |
| Pack one AnimSlot into 4 bytes for wire transmission. | |
| AnimSlot | anim_snapshot::unpack (const std::uint8_t in[4]) |
| void | anim_snapshot::packSnapshot (const AnimSnapshot &snap, std::uint8_t out[k_wireSize]) |
| AnimSnapshot | anim_snapshot::unpackSnapshot (const std::uint8_t in[k_wireSize]) |
Variables | |
| constexpr std::size_t | anim_snapshot::k_wireSize = AnimSnapshot::k_numSlots * 4 |
| Total wire size of an AnimSnapshot (5 slots × 4 bytes). | |
PR-27 — per-entity animation state snapshot, decoupled from CharacterAnimator.
Both client and server run the same CharacterAnimator state machine; at any instant, an entity's animation is fully described by 5 sampler slots (ClipSampler[5] in client/animation/CharacterAnimator.hpp). AnimSnapshot is the wire-friendly + ECS-friendly mirror of those 5 slots — an uint8_t clip ID + two floats per slot.
Two consumers:
Per-slot delta semantics:
The total delta is dimensionless and uniform across body parts — 0.05 timeRatio drift in a fully-active slot is the same number regardless of which bone moves how far in those 0.05 of clip time. That uniformity is the whole reason this metric beats capsule- position-distance for "is the animation pose close enough?".