five-on-it / packages/protocol/src/quantize
packages/protocol/src/quantize
The quantized pose of the delta snapshots (snapshot-v2.ts): what a client draws the others with, at a fraction of the full pose's 52 bytes. A position in 1/256 m (three 32-bit integers: 4 mm anywhere on a level), a rotation as its smallest three components in 32 bits (the index of the largest in two bits, the others in ten each: within a quarter of a degree), a velocity in 1/64 m/s and a spin in 1/256 rad/s (six 16-bit integers). The client's own entities keep their full pose (its prediction replays from it).