Skip to main content

Abstract Class: AnimationLoopTemplate

Defined in: modules/engine/src/animation-loop/animation-loop-template.ts:22

Minimal class that represents a "componentized" rendering life cycle (resource construction, repeated rendering, resource destruction)

Note​

A motivation for this class compared to the raw animation loop is that it simplifies TypeScript code by allowing resources to be typed unconditionally since they are allocated in the constructor rather than in onInitialized

Note​

Introduced in luma.gl v9

Example​

AnimationLoopTemplate is intended to be subclassed,
but the subclass should not be instantiated directly. Instead the subclass
(i.e. the constructor of the subclass) should be used
as an argument to create an AnimationLoop.

Constructors​

Constructor​

new AnimationLoopTemplate(animationProps?): AnimationLoopTemplate

Defined in: modules/engine/src/animation-loop/animation-loop-template.ts:23

Parameters​

animationProps?​

AnimationProps

Returns​

AnimationLoopTemplate

Methods​

onFinalize()​

abstract onFinalize(animationProps): void

Defined in: modules/engine/src/animation-loop/animation-loop-template.ts:28

Parameters​

animationProps​

AnimationProps

Returns​

void


onInitialize()​

onInitialize(animationProps): Promise<unknown>

Defined in: modules/engine/src/animation-loop/animation-loop-template.ts:24

Parameters​

animationProps​

AnimationProps

Returns​

Promise<unknown>


onRender()​

abstract onRender(animationProps): unknown

Defined in: modules/engine/src/animation-loop/animation-loop-template.ts:27

Parameters​

animationProps​

AnimationProps

Returns​

unknown