Large worlds · function

cellsInRadius

Every cell within radius of a point, appended to out.

Explained in Coordinates and units.

function cellsInRadius(x: number, y: number, z: number, radius: number, size: number, out: number[]): number
import { cellsInRadius } from '@driftengine/core';

Parameters

ParameterTypeDescription
xnumber
ynumber
znumber
radiusnumber
sizenumber
outnumber[]

In depth

Symmetric about the centre and conservative: a cell the sphere merely touches is included, because the cost of an extra cell is a wasted load and the cost of a missing one is a hole.