-
-
Notifications
You must be signed in to change notification settings - Fork 0
GridTracer and Coverage
DESKTOP-5KM6RA3\david edited this page Apr 25, 2026
·
2 revisions
GridTracer is the utility layer that translates world-space shapes into grid-space coverage.
Several higher-level systems depend on the same answer:
"Which cells does this world-space region touch in this world?"
GridTracer exposes world-scoped entry points such as:
TraceLine(GridWorld world, Vector3d start, Vector3d end, ...)TraceLine(GridWorld world, Vector2d start, Vector2d end, ...)GetCoveredVoxels(GridWorld world, Vector3d boundsMin, Vector3d boundsMax, ...)GetCoveredScanCells(GridWorld world, Vector3d boundsMin, Vector3d boundsMax, ...)
world-space input
-> snap to voxel-aligned bounds or points
-> find candidate grids through GridWorld
-> enumerate covered voxels or scan cells
-> group or yield results
Coverage often crosses more than one grid. Returning grouped results preserves that reality.
GridVoxelSet keeps:
- the
VoxelGridthat owns the covered cells - the list of covered voxels for that grid
Blocker and BoundsBlocker delegate region-to-voxel logic to the tracer.
blocker bounds
-> GridTracer.GetCoveredVoxels(world, ...)
-> per-grid covered voxel sets
-> obstacle mutation on each covered voxel
This is one of the most important practical details:
-
GridVoxelSet.Voxelsis backed by pooled storage - the tracer releases those pooled lists after yielding each grouped result
Callers should treat grouped voxel lists as transient and consume them immediately inside the enumeration.