group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
anim_snapshot Namespace Reference

Functions

float delta (const AnimSnapshot &a, const AnimSnapshot &b)
 PR-27 animation-state delta.
void pack (const AnimSlot &s, std::uint8_t out[4])
 Pack one AnimSlot into 4 bytes for wire transmission.
AnimSlot unpack (const std::uint8_t in[4])
void packSnapshot (const AnimSnapshot &snap, std::uint8_t out[k_wireSize])
AnimSnapshot unpackSnapshot (const std::uint8_t in[k_wireSize])

Variables

constexpr std::size_t k_wireSize = AnimSnapshot::k_numSlots * 4
 Total wire size of an AnimSnapshot (5 slots × 4 bytes).

Function Documentation

◆ delta()

float anim_snapshot::delta ( const AnimSnapshot & a,
const AnimSnapshot & b )
inlinenodiscard

PR-27 animation-state delta.

See AnimSnapshot.hpp's file comment for the formula derivation. Returns a dimensionless non-negative scalar — 0 means identical state, larger means more drift between a and b. Typical "accept" threshold: 0.10.

Here is the caller graph for this function:

◆ pack()

void anim_snapshot::pack ( const AnimSlot & s,
std::uint8_t out[4] )
inline

Pack one AnimSlot into 4 bytes for wire transmission.

  • byte 0 : clipIdRaw (or 0xFF for inactive)
  • bytes 1-2 : timeRatio quantised to uint16_t ([0..1] → [0..65535])
  • byte 3 : weight quantised to uint8_t ([0..1] → [0..255])
Here is the caller graph for this function:

◆ packSnapshot()

void anim_snapshot::packSnapshot ( const AnimSnapshot & snap,
std::uint8_t out[k_wireSize] )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unpack()

AnimSlot anim_snapshot::unpack ( const std::uint8_t in[4])
inline
Here is the caller graph for this function:

◆ unpackSnapshot()

AnimSnapshot anim_snapshot::unpackSnapshot ( const std::uint8_t in[k_wireSize])
inline
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ k_wireSize

std::size_t anim_snapshot::k_wireSize = AnimSnapshot::k_numSlots * 4
inlineconstexpr

Total wire size of an AnimSnapshot (5 slots × 4 bytes).