Maths · interface

Bounds

How big a piece of geometry is, and where it sits.

Explained in Coordinates and units.

interface Bounds
import type { Bounds } from '@driftengine/core';

In depth

Nothing in this engine knew either until now, which is why there has never been a frustum test: a renderer cannot decide whether a mesh is on screen without knowing what part of space it occupies. CAPABILITIES.md recorded the consequence — no draw culling at all, only backface — and every track on the roadmap that wants culling, level of detail, a broadphase or a bounding gizmo wants this object first.

Both a box and a sphere, because the two answer different questions cheaply. A sphere survives an arbitrary transform as a sphere, which makes it the right shape for a per-draw visibility test; a box is tighter and is what a physics broadphase and an editor's selection want.

Properties

NameTypeDescription
minreadonlyFloat32ArrayThe axis-aligned box, in the geometry's own space.
maxreadonlyFloat32Array
centrereadonlyFloat32ArrayThe box's midpoint, which is what the radius is measured from.
radiusnumberThe furthest vertex from centre. See boundsOfPositions for why not half the diagonal.