Skip to main content

set_cube

Function set_cube 

Source
pub fn set_cube(world: &mut Vxl, x: i32, y: i32, z: i32, color: Option<u32>)
Expand description

Edit a single voxel at (x, y, z). Voxlap5.c:4669 setcube.

color = None carves to air; Some(c) inserts solid coloured c. Out-of-bounds coordinates are silently skipped.

Note: This port skips voxlap C’s “exposed-solid in-place colour overwrite” optimization — every call goes through the scum2 + delslab/insslab + compilerle pipeline. Per-voxel edits are rare in the cave-demo workload; the optimization can land later if needed.

§Panics

Panics if world.vbit is empty — call Vxl::reserve_edit_capacity first.