OrbitLocationCameraController

A camera controller that supports orbital camera navigation around a stationary point in a SceneView. An orbit camera controller locks navigation around a target point. The camera can orbit around the target point but always focuses directly on the point. To activate the controller, set the controller on the SceneView.cameraController property. In this mode, the user can rotate around and zoom in and out from the target point. Once you have applied this camera controller to a SceneView, you cannot change the OrbitLocationCameraController.targetLocation nor the viewpoint of the scene view.

Since

200.1.0

See also

Constructors

Link copied to clipboard
constructor(targetPoint: Point, distance: Double)

Creates an orbit camera controller object with the given target point and distance from that point. The orbit camera controller locks navigation around a target point. When this camera controller is applied, using SceneView.cameraController, navigation interaction always focuses on the target point object. In this mode, the user can rotate around and zoom in and out from the point. Once specified, the target point cannot be changed.

constructor(targetPoint: Point, cameraPoint: Point)

Create an orbit camera controller object with a target point and a camera point. The orbit camera controller calculates the distance of the camera from the target point and locks navigation around that target point. When this camera controller is applied, using SceneView.cameraController, navigation interaction always focuses on the target point object. In this mode, the user can rotate around and zoom in and out from the point. Once specified, the target point cannot be changed.

Properties

Link copied to clipboard
val cameraDistance: StateFlow<Double>

The distance from the camera to the OrbitLocationCameraController.targetLocation, in meters. The camera position and orientation is derived from this distance plus any camera offsets.

Link copied to clipboard
val cameraHeadingOffset: StateFlow<Double>

The heading of the camera relative to the OrbitLocationCameraController.targetLocation, in degrees. The clockwise angle in the horizontal plane of the OrbitLocationCameraController.targetLocation starting from due south. Any angle in degrees is valid and will automatically be normalized between -180 to 180. Defaults to 0 degrees.

Link copied to clipboard
val cameraPitchOffset: StateFlow<Double>

The pitch of the camera relative to the OrbitLocationCameraController.targetLocation, in degrees. The anti-clockwise angle from the positive Z axis through the OrbitLocationCameraController.targetLocation to the target's horizontal plane. Any angle in degrees is valid and will automatically be normalized between 0 and 180. Defaults to 45 degrees.

Link copied to clipboard

True if the camera's distance to the OrbitLocationCameraController.targetLocation can be changed by a user zoom interaction, false otherwise. When enabled, the user can change the OrbitLocationCameraController.cameraDistance with a zoom interaction. Defaults to true.

Link copied to clipboard

True if the camera's heading relative to the OrbitLocationCameraController.targetLocation can be changed by a user horizontal pan interaction, false otherwise. When enabled, the user can change the OrbitLocationCameraController.cameraHeadingOffset with a horizontal pan interaction. Defaults to true.

Link copied to clipboard

True if the camera's pitch relative to the OrbitLocationCameraController.targetLocation can be changed by a user's vertical pan interaction, false otherwise. When enabled, the user can change the OrbitLocationCameraController.cameraPitchOffset with a vertical pan interaction. Defaults to true.

Link copied to clipboard

The maximum distance from the camera to the OrbitLocationCameraController.targetLocation, in meters. The value must be greater than OrbitLocationCameraController.minCameraDistance. Serves as the maximum value for OrbitLocationCameraController.cameraDistance. Animations and interactions obey this limit. No limit on this maximum distance.

Link copied to clipboard

The maximum camera heading offset relative to the OrbitLocationCameraController.targetLocation, in degrees. The value must be greater than OrbitLocationCameraController.minCameraHeadingOffset. Serves as the maximum value for OrbitLocationCameraController.cameraHeadingOffset. Animations and interactions obey this limit. Defaults to 180.

Link copied to clipboard

The maximum camera pitch offset relative to the OrbitLocationCameraController.targetLocation, in degrees. The value must be greater than OrbitLocationCameraController.minCameraPitchOffset but no greater than 90. Serves as the maximum value for OrbitLocationCameraController.cameraPitchOffset. Animations and interactions obey this limit. Defaults to 90.

Link copied to clipboard

The minimum distance from the camera to the OrbitLocationCameraController.targetLocation, in meters. The value cannot be negative. Serves as the minimum value for OrbitLocationCameraController.cameraDistance. Animations and interactions obey this limit. Defaults to 0.

Link copied to clipboard

The minimum camera heading offset relative to the OrbitLocationCameraController.targetLocation, in degrees. The value must be less than OrbitLocationCameraController.maxCameraHeadingOffset. Serves as the minimum value for OrbitLocationCameraController.cameraHeadingOffset. Animations and interactions obey this limit. Defaults to -180.

Link copied to clipboard

The minimum camera pitch offset relative to the OrbitLocationCameraController.targetLocation, in degrees. The value must be less than OrbitLocationCameraController.maxCameraPitchOffset but no less than -90. Serves as the minimum value for OrbitLocationCameraController.cameraPitchOffset. Animations and interactions obey this limit. Defaults to -90.

Link copied to clipboard

The location on which the camera focuses and around which it orbits. The target location is the focal point of the camera managed by the orbit camera controller. The position of the camera is determined by the OrbitLocationCameraController.cameraDistance, OrbitLocationCameraController.cameraHeadingOffset, and OrbitLocationCameraController.cameraPitchOffset relative to this location.

Functions

Link copied to clipboard
suspend fun moveCamera(distanceDelta: Double, headingDelta: Double, pitchDelta: Double, duration: Float): Result<Boolean>

Animates the camera to a new offset position relative to the target with the specified duration. The heading and pitch delta values may be greater than 360 degrees and the angle is not normalized. For example, a heading delta of 720 will make the camera do two circles around the target within the duration time.

Link copied to clipboard
fun setCameraDistance(cameraDistance: Double)

Sets the value of the cameraDistance StateFlow property.

Link copied to clipboard
fun setCameraHeadingOffset(cameraHeadingOffset: Double)

Sets the value of the cameraHeadingOffset StateFlow property.

Link copied to clipboard
fun setCameraPitchOffset(cameraPitchOffset: Double)

Sets the value of the cameraPitchOffset StateFlow property.