EllipsoidalOccluder

open external class EllipsoidalOccluder(var ellipsoid: Ellipsoid, var cameraPosition: Cartesian3 = definedExternally)(source)

Determine whether or not other objects are visible or hidden behind the visible horizon defined by an Ellipsoid and a camera position. The ellipsoid is assumed to be located at the origin of the coordinate system. This class uses the algorithm described in the Horizon Culling blog post.

// Construct an ellipsoidal occluder with radii 1.0, 1.1, and 0.9.
const cameraPosition = new Cartesian3(5.0, 6.0, 7.0);
const occluderEllipsoid = new Ellipsoid(1.0, 1.1, 0.9);
const occluder = new EllipsoidalOccluder(occluderEllipsoid, cameraPosition);

See also

Constructors

Link copied to clipboard
constructor(ellipsoid: Ellipsoid, cameraPosition: Cartesian3 = definedExternally)

Properties

Link copied to clipboard

The coordinate of the viewer/camera. If this parameter is not specified, EllipsoidalOccluder.cameraPosition must be called before testing visibility.

Link copied to clipboard
external var ellipsoid: Ellipsoid

The ellipsoid to use as an occluder.

Functions

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

Computes a point that can be used for horizon culling from a list of positions. If the point is below the horizon, all of the positions are guaranteed to be below the horizon as well. The returned point is expressed in the ellipsoid-scaled space and is suitable for use with EllipsoidalOccluder.isScaledSpacePointVisible.

Link copied to clipboard
external fun computeHorizonCullingPointFromRectangle(rectangle: Rectangle, ellipsoid: Ellipsoid, result: Cartesian3? = definedExternally): Cartesian3

Computes a point that can be used for horizon culling of a rectangle. If the point is below the horizon, the ellipsoid-conforming rectangle is guaranteed to be below the horizon as well. The returned point is expressed in the ellipsoid-scaled space and is suitable for use with EllipsoidalOccluder.isScaledSpacePointVisible.

Link copied to clipboard
external fun computeHorizonCullingPointFromVertices(directionToPoint: Cartesian3, vertices: ReadonlyArray<JsDouble>, stride: Int? = definedExternally, center: Cartesian3? = definedExternally, result: Cartesian3? = definedExternally): Cartesian3

Computes a point that can be used for horizon culling from a list of positions. If the point is below the horizon, all of the positions are guaranteed to be below the horizon as well. The returned point is expressed in the ellipsoid-scaled space and is suitable for use with EllipsoidalOccluder.isScaledSpacePointVisible.

external fun computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(directionToPoint: Cartesian3, vertices: ReadonlyArray<JsDouble>, stride: Int? = definedExternally, center: Cartesian3? = definedExternally, minimumHeight: Double? = definedExternally, result: Cartesian3? = definedExternally): Cartesian3

Similar to EllipsoidalOccluder.computeHorizonCullingPointFromVertices except computes the culling point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable for use with EllipsoidalOccluder.isScaledSpacePointVisiblePossiblyUnderEllipsoid.

external fun computeHorizonCullingPointPossiblyUnderEllipsoid(directionToPoint: Cartesian3, positions: ReadonlyArray<Cartesian3>, minimumHeight: Double? = definedExternally, result: Cartesian3? = definedExternally): Cartesian3

Similar to EllipsoidalOccluder.computeHorizonCullingPoint except computes the culling point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable for use with EllipsoidalOccluder.isScaledSpacePointVisiblePossiblyUnderEllipsoid.

Link copied to clipboard
external fun isPointVisible(occludee: Cartesian3): Boolean

Determines whether or not a point, the occludee, is hidden from view by the occluder.

Link copied to clipboard
external fun isScaledSpacePointVisible(occludeeScaledSpacePosition: Cartesian3): Boolean

Determines whether or not a point expressed in the ellipsoid scaled space, is hidden from view by the occluder. To transform a Cartesian X, Y, Z position in the coordinate system aligned with the ellipsoid into the scaled space, call Ellipsoid.transformPositionToScaledSpace.

external fun isScaledSpacePointVisiblePossiblyUnderEllipsoid(occludeeScaledSpacePosition: Cartesian3): Boolean

Similar to EllipsoidalOccluder.isScaledSpacePointVisible except tests against an ellipsoid that has been shrunk by the minimum height when the minimum height is below the ellipsoid. This is intended to be used with points generated by EllipsoidalOccluder.computeHorizonCullingPointPossiblyUnderEllipsoid or EllipsoidalOccluder.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid.