Controller

abstract external class Controller(source)

An interface for a camera controller that can be registered with the scene to handle input events, camera animations, and other interactions. Implementations of this interface are expected to be registered with the scene via a ControllerHost. This type describes an interface and is not intended to be instantiated directly.

See also

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract var enabled: Boolean

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

Functions

Link copied to clipboard
abstract 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
abstract 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
abstract 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
abstract fun update(scene: Scene, time: JulianDate)

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