Skip to content

CellKey

Defined in: src/modules/spatial/projections.ts:13

World-space → grid-cell projection helpers.

These are pure functions: they project continuous coordinates onto an integer cell grid of a given cellSize. They do NOT touch any spatial structure — pair them with HashGrid2D or any other grid backend.

Floor semantics: cells are computed via Math.floor, so negative coordinates project to negative cells (e.g. with cellSize=10, x=-1 → cell -1, not 0).

readonly x: number

Defined in: src/modules/spatial/projections.ts:14


readonly y: number

Defined in: src/modules/spatial/projections.ts:15