Home /Modules/spatial/SLVoxelGrid.md

SLVoxelGrid.md

lib/spatial/SLVoxelGrid.md · 31 line(s) · markdown

SLVoxelGrid

SLVoxelGrid is a dense 3D grid of int cells stored in a single flat, contiguous native array indexed by i = x + y*width + z*width*height (row-major, x fastest). It is the integrated alternative to a nested int[][][]: one allocation, cache-linear scans, and no per-axis pointer chasing.

Cells carry a caller-chosen empty sentinel (default 0) so a scan can skip unset space. Note the VM default-initialises new int[n] to null, so allocate explicitly fills every cell with the sentinel.

Operations

Example

See SLVoxelGridBasic.