Skip to main content

TranslateControl

class TranslateControl extends Component implements CameraControl, OptionGetters<TranslateControlOptions>

Model's translation control that supports both mouse & touch

constructor

new TranslateControl(view3D, options)

Create new TranslateControl instance

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
view3DView3DAn instance of View3D
optionsTranslateControlOptions✔️{}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 translation

Type: number

Default: 1

See:

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:

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 the camera position

Returns: void