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
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
view3D | View3D | An instance of View3D | ||
options | TranslateControlOptions | ✔️ | {} | Options |
Properties
enabled
Whether this control is enabled or not
Type: boolean
animating
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
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
deltaTime | number | Number of milisec to update |
resize
Resize control to match target size
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
size | object | New size to apply | ||
size.width | number | ✔️ | New width | |
size.height | number | ✔️ | 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