HybridScreenSpacePanCameraController

A contextual camera controller that combines screenspace map panning and screenspace elevator panning. The controller automatically switches between the two based on the camera's angle relative to nadir. If the camera is looking mostly down (within angleThreshold of nadir), ScreenSpaceMapCameraController is used. If the camera is looking towards the horizon (beyond angleThreshold from nadir), the ScreenSpaceElevatorCameraController is used.

viewer.scene.screenSpaceCameraController.enableInputs = false;
viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;

const hybridController = new HybridScreenSpacePanCameraController();
viewer.addController(hybridController);

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The angle threshold in radians that determines which controller is used. If the camera is looking within this angle of nadir, the map controller is used. Otherwise, the elevator controller is used.

Link copied to clipboard

The controller that is used when the camera is looking more horizontally (beyond angleThreshold from nadir).

Link copied to clipboard
open override var enabled: Boolean

Determines if the controller is enabled and should be updated by the host scene.

Link copied to clipboard

The controller that is used when the camera is looking mostly down (within angleThreshold of nadir).

Functions

Link copied to clipboard
open override fun connectedCallback(element: HTMLElement)

Invoked when the controller is added to the DOM. Implement connectedCallback to set up any DOM event listeners.

Link copied to clipboard
open override fun disconnectedCallback(element: HTMLElement)

Invoked when the controller is removed from the DOM. Implement disconnectedCallback to tear down any DOM event listeners.

Link copied to clipboard
open override fun firstUpdate(scene: Scene, time: JulianDate)

Invoked when the controller is being updated the first time, immediately before update is called. Implement firstUpdate to perform one-time work after the relevant scene has begun its render loop. Some examples might include initializing simulation time values or adding a primitive to the scene.

Link copied to clipboard
open override fun update(scene: Scene, time: JulianDate)

Invoked once per frame. Implement update to modify the camera or other parts of the scene.