pub unsafe extern "C" fn b2World_Snapshot(
worldId: b2WorldId,
image: *mut u8,
capacity: c_int,
) -> c_intExpand description
Write a snapshot of the world’s simulation state into a caller-owned buffer. Call once with image == NULL to get the required size, then again with a buffer of at least that size. Must be called at a step boundary. @param worldId The world to snapshot @param image Destination buffer, or NULL to query the size @param capacity Size of image in bytes, ignored when querying @return The number of bytes the snapshot needs. If it exceeds capacity nothing is written. Returns 0 if the world is mid-step or serialization exceeds the reviewed byte limit.