Header menu logo Mibo

CellGrid3D<'T> Type

A dense, flat 3D grid optimized for spatial locality and minimal GC pressure. Uses 'voption' (struct option) to avoid heap allocations for empty cells. Best suited for voxel-like layouts, 3D maps, or dense spatial data. For sparse data over huge coordinates, consider a chunked system instead.

Axis Convention: - X = width (left/right) - Y = height (up/down) - Z = depth (forward/back)

Record fields

Record Field Description

CellSize

Full Usage: CellSize

Field type: Vector3

The dimensions of a single cell in world units. Used for hit-testing and rendering calculations.

Field type: Vector3

Cells

Full Usage: Cells

Field type: 'T voption[]

The raw backing store as a flat array. Indexed as: x + y * Width + z * Width * Height Direct access is discouraged; use 'get'/'set' for bounds safety.

Field type: 'T voption[]

Depth

Full Usage: Depth

Field type: int
Field type: int

Height

Full Usage: Height

Field type: int
Field type: int

Origin

Full Usage: Origin

Field type: Vector3

The world-space coordinate corresponding to (0,0,0) of the grid index. Used for translating grid indices to game world positions.

Field type: Vector3

Width

Full Usage: Width

Field type: int
Field type: int

Type something to start searching.