Skip to main content

OrbitControl

class OrbitControl

Aggregation of RotateControl, TranslateControl, and ZoomControl.

constructor

new OrbitControl(view3D)

Create new OrbitControl instance

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
view3DView3DAn instance of View3D

Properties

rotate

readonly

Rotate(left-click) part of this control

Type: RotateControl

translate

readonly

Translation(right-click) part of this control

Type: TranslateControl

zoom

readonly

Zoom(mouse wheel) part of this control

Type: ZoomControl

controls

readonly

Base controls

Type: Array<CameraControl>

extraControls

readonly

Extra camera controls added, like AnimationControl

Type: Array<CameraControl>

animating

readonly

Whether one of the controls is animating at the moment

Type: boolean

Methods

destroy

Destroy the instance and remove all event listeners attached
This also will reset CSS cursor to intial

Returns: void

update

Update control by given deltaTime

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
deltaTimenumberNumber of milisec to update

resize

Resize control to match target size

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
sizeobjectNew size to apply
size.widthnumber✔️New width
size.heightnumber✔️New height

enable

Enable this control and add event listeners

Returns: void

disable

Disable this control and remove all event handlers

Returns: void

sync

Synchronize this control's state to current camera position

Returns: void

add

Add extra control

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
controlCameraControlControl to add

remove

Remove extra control

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
controlCameraControlControl to add

updateCursor

Update cursor to current option

Returns: void