OrientedBoundingBox

external class OrientedBoundingBox(var center: Cartesian3 = definedExternally, var halfAxes: Matrix3 = definedExternally)(source)

Creates an instance of an OrientedBoundingBox. An OrientedBoundingBox of some object is a closed and convex rectangular cuboid. It can provide a tighter bounding volume than BoundingSphere or AxisAlignedBoundingBox in many cases.

// Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
const center = new Cartesian3(1.0, 0.0, 0.0);
const halfAxes = Matrix3.fromScale(new Cartesian3(1.0, 3.0, 2.0), new Matrix3());

const obb = new OrientedBoundingBox(center, halfAxes);

See also

Constructors

Link copied to clipboard
constructor(center: Cartesian3 = definedExternally, halfAxes: Matrix3 = definedExternally)

Types

Link copied to clipboard

Properties

Link copied to clipboard

The center of the box. Default value - Cartesian3.ZERO

Link copied to clipboard

The three orthogonal half-axes of the bounding box. Equivalently, the transformation matrix, to rotate and scale a 2x2x2 cube centered at the origin. Default value - Matrix3.ZERO

Functions

Link copied to clipboard
fun clone(result: OrientedBoundingBox? = definedExternally): OrientedBoundingBox

Duplicates this OrientedBoundingBox instance.

Link copied to clipboard
fun computeCorners(result: ReadonlyArray<Cartesian3>? = definedExternally): ReadonlyArray<Cartesian3>

Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).

Link copied to clipboard
fun computePlaneDistances(position: Cartesian3, direction: Cartesian3, result: Interval? = definedExternally): Interval

The distances calculated by the vector from the center of the bounding box to position projected onto direction.

Link copied to clipboard

Computes a transformation matrix from an oriented bounding box.

Link copied to clipboard

Computes the estimated distance squared from the closest point on a bounding box to a point.

Link copied to clipboard

Determines which side of a plane the oriented bounding box is located.

Link copied to clipboard
fun isOccluded(occluder: Occluder): Boolean

Determines whether or not a bounding box is hidden from view by the occluder.