Renderer · function
instancesBox
The world box around every instance's sphere, for testing a whole batch at once: (minX, minY,
minZ, maxX, maxY, maxZ) into out. A batch holding nothing writes a min above its max.
Explained in Hello world.
function instancesBox(data: MeshInstances, local: Bounds, out: Float32Array): voidimport { instancesBox } from '@driftengine/core';Parameters
| Parameter | Type | Description |
|---|---|---|
data | MeshInstances | |
local | Bounds | |
out | Float32Array |
In depth
A box, not a sphere, and the difference is the whole point for a flat batch. A region of props a hundred metres square has a sphere seventy metres deep underground, where nothing occludes it, so a sphere test never finds a region hidden. The box stays as flat as the props are.