Expand description
Recording, replay, and world snapshots.
Port of recording.c / recording.h / recording_replay.c / world_snapshot.c.
SPDX-FileCopyrightText: 2026 Erin Catto SPDX-License-Identifier: MIT
Re-exports§
pub use ops::RecOp;pub use player::validate_replay;pub use player::RecPlayer;pub use snapshot::clone_world_via_snapshot;pub use snapshot::compute_layout_hash;pub use snapshot::deserialize_into_shell;pub use snapshot::serialize_world;pub use snapshot::SNAP_FLAG_DOUBLE_PRECISION;pub use snapshot::SNAP_FLAG_VALIDATION;pub use snapshot::SNAP_LAYOUT_VERSION;pub use snapshot::SNAP_MAGIC;pub use snapshot::SNAP_VERSION;
Modules§
- dispatch
- Op-stream dispatcher for recording replay.
- ops
- Recording op table generated from recording_ops.inl. Opcode constants; the framed write helpers live in write_ops/.
- player
- Recording player and validate-replay. Port of recording_replay.c player API.
- query_
replay - Spatial-query replay helpers. Port of recording_replay.c query dispatch.
- snapshot
- World snapshot serialize/deserialize. Port of world_snapshot.c — field-by-field for Vec-backed Rust pools.
Structs§
- Geometry
Entry - One entry per unique geometry blob. (b3GeometryEntry)
- Geometry
Registry - Growable array of geometry entries with content-hash dedup. (b3GeometryRegistry)
- RecBuffer
- Growable append-only byte buffer. Doubles on demand.
count_onlytallies size without allocating. (b3RecBuffer) - RecHeader
- Fixed 48-byte recording header. (b3RecHeader)
- RecTag
- Interned query tag. (b3RecTag)
- Recording
- User-owned recording buffer. (b3Recording)
- Registry
Slot - Resolved geometry slot for deserialization. (b3RegistrySlot)
- Snap
Reader - Bounds-checked read cursor for snapshot images. (b3SnapReader)
Enums§
- Geometry
Kind - Geometry kinds for the trailing registry section. (b3GeometryKind)
Constants§
- REC_
MAGIC - Magic ‘B3RC’ little-endian. (B3_REC_MAGIC)
- REC_
VERSION_ MAJOR - Major recording version. (B3_REC_VERSION_MAJOR)
- REC_
VERSION_ MINOR - Minor recording version. (B3_REC_VERSION_MINOR)
- SNAP_
FNV_ INIT - FNV-1a 64-bit constants. (B3_SNAP_FNV_*)
- SNAP_
FNV_ PRIME
Functions§
- fnv_
mix_ position - Mix a world position at full width. (b3FnvMixPosition)
- hash64_
blob - Content hash for geometry blobs. (b3Hash64Blob)
- hash_
world_ state - Hash live body transforms and awake velocities. (b3HashWorldState)
- record_
op - Record a void mutator if a session is active.
- start_
recording - Start recording into a user-owned buffer. (b3StartRecordingIntoBuffer / b3World_StartRecording)
- stop_
recording - Stop recording and finalize the buffer. (b3StopRecordingInternal / b3World_StopRecording)
- with_
recording - Invoke
fon the active recording, if any. - world_
public_ id - Public world id matching C’s
{ worldId+1, generation }.