Skip to content

@tmrw-realityos/charmDocs


@tmrw-realityos/charm / OrbitControl

Class: OrbitControl

Orbit controller. Loosely inspired by threejs OrbitControls. Rotate: Mouse 1 or touch 1 Pan: Mouse 2 or touch 1+2 Dolly: Mouse 3 or pinch touch 1+2

Constructors

new OrbitControl()

new OrbitControl(camera, ...additionalCameras): OrbitControl

Needs at least one camera. Additional cameras can be given to synchronize multiple cameras.

Parameters

camera: Camera

• ...additionalCameras: Camera[]

Returns

OrbitControl

Defined in

packages/charm/src/helpers/orbitControl.ts:54

Properties

cameras

cameras: Camera[]

Defined in

packages/charm/src/helpers/orbitControl.ts:34


canvas?

optional canvas: HTMLCanvasElement

Defined in

packages/charm/src/helpers/orbitControl.ts:35


panSpeed

panSpeed: number = 1.0

Defined in

packages/charm/src/helpers/orbitControl.ts:32


rotateSpeed

rotateSpeed: number = 1.0

Defined in

packages/charm/src/helpers/orbitControl.ts:31


zoomSpeed

zoomSpeed: number = 1.0

Defined in

packages/charm/src/helpers/orbitControl.ts:33

Methods

disable()

disable(): void

Returns

void

Defined in

packages/charm/src/helpers/orbitControl.ts:82


enable()

enable(canvas): void

Parameters

canvas: HTMLCanvasElement

Returns

void

Defined in

packages/charm/src/helpers/orbitControl.ts:58

Events

cameraMoved

cameraMoved: ROSEvent<Callback>

Starts listening to when the camera changes position or direction.

Defined in

packages/charm/src/helpers/orbitControl.ts:48