fromPoints

fun fromPoints(positions: ReadonlyArray<Cartesian3>? = definedExternally, result: OrientedBoundingBox? = definedExternally): OrientedBoundingBox(source)

Computes an instance of an OrientedBoundingBox of the given positions. This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis). Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf

// Compute an object oriented bounding box enclosing two points.
const box = OrientedBoundingBox.fromPoints([new Cartesian3(2, 0, 0), new Cartesian3(-2, 0, 0)]);

Return

The modified result parameter or a new OrientedBoundingBox instance if one was not provided.

Parameters

positions

List of Cartesian3 points that the bounding box will enclose.

result

The object onto which to store the result.

See also