Skip to main content

RotateControl

class RotateControl extends Component implements CameraControl, OptionGetters<RotateControlOptions>

Model's rotation control that supports both mouse & touch

constructor

new RotateControl(view3D, options)

Create new RotateControl instance

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
view3DView3DAn instance of View3D
optionsRotateControlOptions✔️{}Options

Properties

enabled

readonly

Whether this control is enabled or not

Type: boolean

animating

readonly

Whether this control is animating the camera

Type: boolean

scale

Scale factor for rotation

Type: number

Default: 1

duration

Duration of the input animation (ms)

Type: number

Default: 300

easing

Easing function of the animation

Type: function

Default: EASING.EASE_OUT_CUBIC

See:

disablePitch

Disable X-axis(pitch) rotation

Type: boolean

Default: false

disableYaw

Disable Y-axis(yaw) rotation

Type: boolean

Default: false

Methods

destroy

Destroy the instance and remove all event listeners attached

Returns: void

reset

Reset internal values

Returns: void

update

Update control by given deltaTime

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
deltaTimenumberNumber of milisec to update

resize

Resize control to match target size

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

enable

Enable this input and add event listeners

Returns: void

disable

Disable this input and remove all event handlers

Returns: void

sync

Synchronize this control's state to given camera position

Returns: void