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
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
from | View3D | Start pose | ||
to | Pose | End pose | ||
options | object | Options | ||
options.duration | number | ✔️ | 500 | Animation duration |
options.easing | function | ✔️ | (x: number) => 1 - Math.pow(1 - x, 3) | Animation easing function |
Properties
enabled
Whether this control is enabled or not
duration
Duration of the animation
easing
Easing function of the animation
animating
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
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
deltaTime | number | Number 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
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
callback | (...args: any) => any | Callback that will be called when animation finishes |
clearFinished
Remove all onFinished callbacks
Returns: void