Navigation · interface

VoxelField

Walkable surfaces as spans, in columns on a horizontal grid.

Explained in Navigation.

interface VoxelField
import type { VoxelField } from '@driftengine/nav';

In depth

Structure of arrays and CSR columns, matching NavGraph in core: a span is three integers and a column is a slice, so building a region out of this walks memory in order and allocates nothing per span.

Properties

NameTypeDescription
widthreadonlynumber
depthreadonlynumber
cellSizereadonlynumber
cellHeightreadonlynumber
originreadonlyFloat64ArrayWorld position of cell (0, 0)'s minimum corner: x, y, z.
columnStartreadonlyUint32ArrayColumn x + z * width's spans are [columnStart[i], columnStart[i + 1]).
spansreadonlyInt32ArrayThree words per span. See SPAN_STRIDE.