pub struct Recording {
pub buffer: Vec<u8>,
pub accumulated_bounds: Aabb,
pub have_bounds: bool,
/* private fields */
}Expand description
User-owned recording buffer. The world appends into it while recording; the user saves and destroys it. (b2Recording — the mutex is dropped in the serial port)
Fields§
§buffer: Vec<u8>§accumulated_bounds: AabbUnion of world bounds over every recorded step, written out at stop so a replay can frame the whole motion. have_bounds gates the first union the same way world_get_bounds does.
have_bounds: boolImplementations§
Source§impl Recording
impl Recording
Sourcepub fn new(capacity_hint: usize) -> Recording
pub fn new(capacity_hint: usize) -> Recording
(b2CreateRecording — the capacity hint sizes the buffer up front)
Sourcepub fn begin_record(&mut self, opcode: u8)
pub fn begin_record(&mut self, opcode: u8)
Start a framed record: opcode byte plus a 3-byte payload-size slot
backpatched by Recording::end_record. (b2RecBeginRecord)
Sourcepub fn end_record(&mut self)
pub fn end_record(&mut self)
Compute the final payload size and record it in the 24-bit space reserved right after the opcode. (b2RecEndRecord)
Sourcepub fn commit_record(&mut self, opcode: u8, payload: &[u8])
pub fn commit_record(&mut self, opcode: u8, payload: &[u8])
Append a completed record (opcode + u24 size + payload) in one shot. (b2RecCommitRecord — lock-free in the serial port)
Sourcepub fn accumulate_bounds(&mut self, bounds: Aabb)
pub fn accumulate_bounds(&mut self, bounds: Aabb)
Fold one step’s world bounds into the running union the recorder writes out at stop. (b2RecAccumulateBounds)