@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / placeInChunk
Function: placeInChunk() ​
ts
function placeInChunk(
field,
mask,
chunk,
perSquareMetre,
seed,
spacing?): Placement[];Defined in: terrain/FoliageSystem.ts:62
Where things go in one chunk (terrain space, metres): perSquareMetre tries per square metre, kept where the mask allows and at least spacing from the others. Deterministic, and in random order, so drawing the first N of them thins the chunk evenly.
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
field | Heightfield | undefined |
mask | FoliageMask | undefined |
chunk | { x0: number; z0: number; size: number; } | undefined |
chunk.x0 | number | undefined |
chunk.z0 | number | undefined |
chunk.size | number | undefined |
perSquareMetre | number | undefined |
seed | number | undefined |
spacing | number | 0 |

