Skip to main content

Module grid_view

Module grid_view 

Source
Expand description

Per-frame voxel-world borrow shape.

Wraps the (vsid, slab_buf, column_offsets, mip_base_offsets) tuple that [crate::opticast] and crate::scalar_rasterizer::ScalarRasterizer both need. Today always represents a single chunk so callers building from a roxlap_formats::vxl::Vxl keep the existing flat-world semantics byte-identically.

Substage S4B.0 introduced the shape as a pure rename — opticast drove a single flat world behind a typed borrow. Subsequent S4B.x sub-substages grow this into a multi-chunk view:

  • S4B.1 — carry the camera’s chunk index alongside the borrow.
  • S4B.2.a — chunk_size_xy field + chunk_at_xy method. Today’s single-chunk callers set chunk_size_xy = vsid and the lookup only succeeds for [0, 0].
  • S4B.2.b — grouscan column-step calls chunk_at_xy and swaps active per-chunk (slab_buf, column_offsets) when (cx, cy) crosses a chunk boundary. Single-chunk goldens byte-identical.
  • S4B.2.c.1 (this file) — ChunkGrid backend so chunk_at_xy can resolve real per-chunk borrows. Pure infrastructure; no caller integration yet.
  • S4B.2.c.2 — scene-side multi-chunk constructor + 32×32 ground seam test.
  • S4B.3 — chunk-z extent + handoff for cross-chunk-Z rays.

See project_s4_b_plan.md for the full sub-substage plan.

Structs§

ChunkGrid
S4B.2.c.1: chunk-grid metadata for multi-chunk GridView lookups.
GridView

Constants§

CHUNK_SIZE_Z
Per-frame world borrow that opticast + the rasterizer share.