# Extension

Base class for all extensions. Extensions are created via createExtension method from the viewer instance.

#

Fields

viewer

#

Accessors

enabled inject

#

Methods

onEarlyUpdate onLateUpdate onRender onResize

#

Fields

# viewer

protected viewer: IViewer
1

All extensions hold a reference to the viewer implementation instance that spawned them

#

Accessors

# enabled

get enabled(): boolean
set enabled(value: boolean)
1
2

All extensions should implement enabling/disabling themselves

# inject

get inject(): Array<Constructor<Extension>>
1

Gets the list of extensions that need to get injected on creation time. This is how an extension declares that it needs other extensions injected. Injection is automatically done when calling createExtension



#

Methods

# onEarlyUpdate

onEarlyUpdate(deltaTime?: number)
1

Update function called before the viewer's update

# onLateUpdate

onLateUpdate(deltaTime?: number)
1

Update function called after the viewer's update

# onRender

onRender()
1

Render function called after the viewer's render

# onResize

onResize()
1

Called whenever a resize happens