Skip to main content

CameraAnimation

Since version 4.0.0

Animation of the Camera

class CameraAnimation

Properties

Duration of the animation

Easing function of the animation

Methods

Return a promise that resolved on animation end.

Update animation by given deltaTime.

Constructor

Create new instance
new CameraAnimation(camera: Camera, from: CameraPose, to: CameraPose, options: { duration: undefined | number; easing: undefined | ((x: number) => number) }): CameraAnimation

Parameters

camera

Camera to animate

from

CameraPose

Start pose

to

CameraPose

End pose

options

{ duration: undefined | number; easing: undefined | ((x: number) => number) }

{}

Options

options.duration

undefined | number

Animation duration

options.easing

undefined | Function

Animation easing function

Properties

duration

>=4.0.0
duration

number

Duration of the animation

easing

>=4.0.0
easing

((x: number) => number)

Easing function of the animation

Methods

getFinishPromise

>=4.0.0
getFinishPromise

Promise<void>

getFinishPromise(): Promise<void>

Return a promise that resolved on animation end.

update

>=4.0.0
update

void

update(deltaTime: number): void

Update animation by given deltaTime.

Parameters

deltaTime

number

Number of milisec to update