OrbitControl
class OrbitControl
Aggregation of RotateControl, TranslateControl, and ZoomControl.
constructor
new OrbitControl(view3D)
Create new OrbitControl instance
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
view3D | View3D | An instance of View3D |
Properties
rotate
Rotate(left-click) part of this control
Type: RotateControl
translate
Translation(right-click) part of this control
Type: TranslateControl
zoom
Zoom(mouse wheel) part of this control
Type: ZoomControl
controls
Base controls
Type: Array<CameraControl>
extraControls
Extra camera controls added, like AnimationControl
Type: Array<CameraControl>
animating
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
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
deltaTime | number | Number of milisec to update |
resize
Resize control to match target size
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
size | object | New size to apply | ||
size.width | number | ✔️ | New width | |
size.height | number | ✔️ | 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
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
control | CameraControl | Control to add |
remove
Remove extra control
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
control | CameraControl | Control to add |
updateCursor
Update cursor to current option
Returns: void