Expand description
Section 22 (VOX0): 3D Sparse Voxel Octree / DAG Lattice Section.
Encodes volumetric underground strata, cavities, root networks, and CSG excavations
using a 16-byte cache-friendly Directed Acyclic Graph (Vox0DagNode).
§16-Byte POD Binary Layout (Vox0DagNode)
| Offset | Type | Field | Description |
|---|---|---|---|
0x00 | u8 | child_mask | Valid child octant presence bitmask (8 bits) |
0x01 | u8 | leaf_mask | Octants terminating as leaves (8 bits) |
0x02 | u8 | primary_material_lut | Majority constituent LUT index (0..255) |
0x03 | u8 | secondary_material_lut | Secondary constituent LUT index (0..255) |
0x04 | u32 | child_ptr_or_density | SVO index to child cluster, or packed density |
0x08 | [i8; 2] | normal_oct_snorm8 | Octahedral encoded surface normal vector |
0x0A | u8 | moisture_u8 | Volumetric water saturation Sw (0..255) |
0x0B | u8 | compaction_u8 | Overburden compaction / hardness metric |
0x0C | u16 | node_crc16 | Integrity checksum over bytes 0..11 |
0x0E | [u8; 2] | _reserved | Explicit zero padding to 16 bytes |
Structs§
- Vox0
DagNode - 16-Byte POD Node Record for Sparse Voxel Octrees and DAGs.
- Voxel
Section Mini Header - 64-Byte POD Mini Header for SectionType::VoxelLattice (22).
Enums§
- Voxel
Section Error - Errors during voxel section encode/decode.
Constants§
- FLAG_
VOXEL_ COMPACT_ DAG - FLAG_
VOXEL_ HAS_ EXCAVATIONS - MAGIC_
VOX0 - VOX0_
NODE_ SIZE - VOXEL_
MINI_ HEADER_ SIZE - VOXEL_
SECTION_ VERSION
Functions§
- encode_
voxel_ section - Encode a voxel section into a caller-supplied fixed slice without heap allocation.
- parse_
voxel_ section - Zero-copy parse a voxel section from a byte slice.