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): void
import { instancesBox } from '@driftengine/core';

Parameters

ParameterTypeDescription
dataMeshInstances
localBounds
outFloat32Array

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.