viewBoundingSphere

fun viewBoundingSphere(boundingSphere: BoundingSphere, offset: HeadingPitchRange? = definedExternally)(source)

Sets the camera so that the current view contains the provided bounding sphere.

The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. The heading and the pitch angles are defined in the local east-north-up reference frame. The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is zero, a range will be computed such that the whole bounding sphere is visible.

In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the target will be the range. The heading will be determined from the offset. If the heading cannot be determined from the offset, the heading will be north.

Parameters

boundingSphere

The bounding sphere to view, in world coordinates.

offset

The offset from the target in the local east-north-up reference frame centered at the target.

See also