Skip to main content

AnimationControl

class AnimationControl implements CameraControl

Control that animates model without user input

constructor​

new AnimationControl(from, to, options, options.duration, options.easing)

Create new instance of AnimationControl

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
fromView3DStart pose
toPoseEnd pose
optionsobjectOptions
options.durationnumber✔️500Animation duration
options.easingfunction✔️(x: number) => 1 - Math.pow(1 - x, 3)Animation easing function

Properties​

enabled​

readonly

Whether this control is enabled or not

duration​

Duration of the animation

easing​

Easing function of the animation

animating​

readonly

Whether this control is animating the camera

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

enable​

Enable this input and add event listeners

Returns: void

disable​

Disable this input and remove all event handlers

Returns: void

onFinished​

Add callback which is called when animation is finished

Returns: void

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
callback(...args: any) => anyCallback that will be called when animation finishes

clearFinished​

Remove all onFinished callbacks

Returns: void