Skip to main content

SphereShape

From v4.2

A sphere centered at the local origin.

Usageโ€‹

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

const shape = new SphereShape({radius: 1});

Constructorโ€‹

new SphereShape(options?)โ€‹

OptionDefaultDescription
radius0.5Finite positive radius.
matrixidentityOptional invertible affine local-to-world matrix.

Non-uniform scaling produces an ellipsoid for containment and intersection queries; distance estimates retain the shared transform limitations.

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.