Skip to content

FlyControls

Defined in: addons/src/controls/FlyControls.ts:31

Listeners by event type, as the DOM’s EventTarget has them, for any object.

new FlyControls(camera, domElement): FlyControls

Defined in: addons/src/controls/FlyControls.ts:46

Camera

HTMLElement

FlyControls

EventDispatcher.constructor

enabled: boolean = true

Defined in: addons/src/controls/FlyControls.ts:32


movementSpeed: number = 1

Defined in: addons/src/controls/FlyControls.ts:34

The speed of a key, in scene units a second.


rotationSpeed: number = 0.0025

Defined in: addons/src/controls/FlyControls.ts:36

The turn of a drag, in radians for each pixel.

get moving(): boolean

Defined in: addons/src/controls/FlyControls.ts:69

Whether the view is changing: a pointer is down or a movement key is held.

boolean

addEventListener<K>(type, listener): void

Defined in: radiance/src/core/EventDispatcher.ts:5

K extends keyof FlyControlsEvents

K

(event) => void

void

EventDispatcher.addEventListener


dispatchEvent<K>(type, event): void

Defined in: radiance/src/core/EventDispatcher.ts:15

K extends keyof FlyControlsEvents

K

FlyControlsEvents[K]

void

EventDispatcher.dispatchEvent


dispose(): void

Defined in: addons/src/controls/FlyControls.ts:115

Remove every listener.

void


removeEventListener<K>(type, listener): void

Defined in: radiance/src/core/EventDispatcher.ts:11

K extends keyof FlyControlsEvents

K

(event) => void

void

EventDispatcher.removeEventListener


reset(): void

Defined in: addons/src/controls/FlyControls.ts:83

Return to the saved view.

void


saveState(): void

Defined in: addons/src/controls/FlyControls.ts:74

Remember the camera’s place and look, for reset().

void


update(dt?): boolean

Defined in: addons/src/controls/FlyControls.ts:94

Move the camera for dt seconds of the keys held, and answer whether the camera’s place or look differs from the last call. The first call answers true.

number = ...

boolean