Companion

Properties

Link copied to clipboard
open external override val packedLength: Int

The number of elements used to pack the object into an array.

Functions

Link copied to clipboard
external fun clone(sphere: BoundingSphere, result: BoundingSphere? = definedExternally): BoundingSphere

Duplicates a BoundingSphere instance.

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

The distances calculated by the vector from the center of the bounding sphere to position projected onto direction plus/minus the radius of the bounding sphere.

Link copied to clipboard
external fun distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): Double

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

Link copied to clipboard
external fun equals(left: BoundingSphere? = definedExternally, right: BoundingSphere? = definedExternally): Boolean

Compares the provided BoundingSphere componentwise and returns true if they are equal, false otherwise.

Link copied to clipboard
external fun expand(sphere: BoundingSphere, point: Cartesian3, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a bounding sphere by enlarging the provided sphere to contain the provided point.

Link copied to clipboard
external fun fromBoundingSpheres(boundingSpheres: ReadonlyArray<BoundingSphere>? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.

Link copied to clipboard
external fun fromCornerPoints(corner: Cartesian3? = definedExternally, oppositeCorner: Cartesian3? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere tightly and fully encompasses the box.

Link copied to clipboard
external fun fromEllipsoid(ellipsoid: Ellipsoid, result: BoundingSphere? = definedExternally): BoundingSphere

Creates a bounding sphere encompassing an ellipsoid.

Link copied to clipboard
external fun fromEncodedCartesianVertices(positionsHigh: ReadonlyArray<JsDouble>? = definedExternally, positionsLow: ReadonlyArray<JsDouble>? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.

Link copied to clipboard
external fun fromOrientedBoundingBox(orientedBoundingBox: OrientedBoundingBox, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.

Link copied to clipboard
external fun fromPoints(positions: ReadonlyArray<Cartesian3>? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points. The bounding sphere is computed by running two algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.

Link copied to clipboard
external fun fromRectangle2D(rectangle: Rectangle? = definedExternally, projection: MapProjection? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a bounding sphere from a rectangle projected in 2D.

Link copied to clipboard
external fun fromRectangle3D(rectangle: Rectangle? = definedExternally, ellipsoid: Ellipsoid? = definedExternally, surfaceHeight: Double? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.

Link copied to clipboard
external fun fromRectangleWithHeights2D(rectangle: Rectangle? = definedExternally, projection: MapProjection? = definedExternally, minimumHeight: Double? = definedExternally, maximumHeight: Double? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the object's minimum and maximum heights over the rectangle.

Link copied to clipboard
external fun fromTransformation(transformation: Matrix4, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a tight-fitting bounding sphere enclosing the provided affine transformation.

Link copied to clipboard
external fun fromVertices(positions: ReadonlyArray<JsDouble>? = definedExternally, center: Cartesian3? = definedExternally, stride: Int? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.

Link copied to clipboard
external fun intersectPlane(sphere: BoundingSphere, plane: Plane): Intersect

Determines which side of a plane a sphere is located.

Link copied to clipboard
external fun isOccluded(sphere: BoundingSphere, occluder: Occluder): Boolean

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

Link copied to clipboard
open external override fun pack(value: BoundingSphere, array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally): ReadonlyArray<JsDouble>

Stores the provided instance into the provided array.

Link copied to clipboard
external fun projectTo2D(sphere: BoundingSphere, projection: MapProjection? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.

Link copied to clipboard
external fun transform(sphere: BoundingSphere, transform: Matrix4, result: BoundingSphere? = definedExternally): BoundingSphere

Applies a 4x4 affine transformation matrix to a bounding sphere.

Link copied to clipboard
external fun transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result: BoundingSphere? = definedExternally): BoundingSphere

Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale The transformation matrix is not verified to have a uniform scale of 1. This method is faster than computing the general bounding sphere transform using BoundingSphere.transform.

Link copied to clipboard
external fun union(left: BoundingSphere, right: BoundingSphere, result: BoundingSphere? = definedExternally): BoundingSphere

Computes a bounding sphere that contains both the left and right bounding spheres.

Link copied to clipboard
open external override fun unpack(array: ReadonlyArray<JsDouble>, startingIndex: Int? = definedExternally, result: BoundingSphere? = definedExternally): BoundingSphere

Retrieves an instance from a packed array.