Expand description
Packets for entity movement updates.
These packets use fixed-point encoding for position deltas. The client maintains
a VecDeltaCodec for each entity which tracks the “base” position. Deltas are
computed as encode(current) - encode(base) where encode multiplies by 4096
and rounds.
The server must track what the client’s base position is (PositionCodec) to
compute correct deltas and know when the delta would overflow i16 bounds.
Structs§
- CMove
Entity Pos - Updates an entity’s position with a delta from its current position.
- CMove
Entity PosRot - Updates an entity’s position and rotation.
- CMove
Entity Rot - Updates an entity’s rotation only.
- Packed
Entity Delta - A fixed-point entity movement delta encoded as a protocol
i16.
Constants§
- MAX_
DELTA 🔒 - Maximum delta value that fits in i16.
- MIN_
DELTA 🔒 - Minimum delta value that fits in i16.
- TRUNCATION_
STEPS 🔒 - Fixed-point encoding multiplier (1/4096 block precision).
Functions§
- calc_
delta - Calculates the delta for entity movement.
- encode_
position - Encodes a position component to the protocol’s fixed-point format.
- to_
angle_ byte - Converts degrees to a protocol angle byte (0-255 representing 0-360 degrees).