Skip to main content

PlaneShape

From v4.2

A surface in the local XZ plane facing +Y. The negative-Y half-space is inside.

Usageโ€‹

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

const shape = new PlaneShape({sizeX: 4, sizeZ: 3});

Constructorโ€‹

new PlaneShape(options?)โ€‹

OptionDefaultDescription
sizeXundefinedOptional finite positive width along X.
sizeZundefinedOptional finite positive width along Z.
matrixidentityOptional invertible affine local-to-world matrix.

The dimensions restrict ray hits on the surface, not the inside half-space. Omitted dimensions are unbounded. getAxisAlignedBoundingBox() and getBoundingSphere() return undefined, even when both surface dimensions are finite.

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.