Skip to main content

BoxShape

From v4.2

A box centered at the origin, with faces aligned to the local axes.

Usageโ€‹

import {BoxShape} from '@math.gl/geometry/culling';

const shape = new BoxShape({size: [2, 1, 3]});

Constructorโ€‹

new BoxShape(options?)โ€‹

OptionDefaultDescription
size[1, 1, 1]Full X, Y, and Z lengths; each must be finite and positive.
matrixidentityOptional invertible affine local-to-world matrix.

Queriesโ€‹

Implements the Shape interface, including containment, distance, ray and plane intersection, transforms, cloning, and enclosing bounds.

Dimensions and defaults align with the glTF 2.1 draft shape specification.