Voxel grid (linear-keyed) — mutated as the under-surface
region is OR'd into it. The same grid instance is returned in
NavSimplifyResult.grid.
Axis-aligned bounds of the voxel grid.
Size of each voxel in world units.
XZ dilation radius in world units. 0 disables dilation.
Reusable GPU dilation context. Required when dilation > 0.
Modified grid with under-surface regions filled.
Floor-fill via XZ dilate -> per-column upward walk -> XZ dilate -> OR.
Mirrors the shape of
fillExterior(dilate -> traverse -> dilate -> OR) but the traversal is a per-(lx, lz) upward walk through empty space instead of a 3D boundary BFS, and the dilations operate only in X and Z.Steps with
r = ceil(dilation / voxelResolution):S_xz = gpuDilate3(S, r, 0)closes any XZ holes in horizontal surfaces smaller than2 * r.y = 0upward throughS_xz. Mark each visited empty voxel intofoundEmpty. Stop on the first solid voxel ofS_xzor at the grid top.dilatedFound = gpuDilate3(foundEmpty, r, 0)spreads the found under-surface volume back out in XZ to cover the kernel halo.output = S | dilatedFoundadds the dilated under-surface region as solid on top of the original solids.Intended to run before
carve: it seals the under-side of the floor (and patches small XZ holes via the dilation), and the carve handles the remaining hole plugging via its 3D dilate + capsule BFS.With
r = 0the dilations are skipped and the algorithm degrades to "fill the under-side of every column up to the first solid", matching the original (pre-dilation)fillFloorbehavior.