Skip to main content

Interface: IViewerApp

Core-API.IViewerApp

Hierarchy

Implemented by

Methods

addEventListener

addEventListener(type, listener): void

Adds a listener to an event type.

Parameters

NameTypeDescription
type"update" | "preRender" | "postRender" | "preFrame" | "postFrame" | "dispose" | "addPlugin"The type of event to listen to.
listener(event: IEvent<"update" | "preRender" | "postRender" | "preFrame" | "postFrame" | "dispose" | "addPlugin">) => voidThe function that gets called when the event is fired.

Returns

void

Inherited from

IEventDispatcher.addEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:14


hasEventListener

hasEventListener(type, listener): boolean

Checks if listener is added to an event type.

Parameters

NameTypeDescription
type"update" | "preRender" | "postRender" | "preFrame" | "postFrame" | "dispose" | "addPlugin"The type of event to listen to.
listener(event: IEvent<"update" | "preRender" | "postRender" | "preFrame" | "postFrame" | "dispose" | "addPlugin">) => voidThe function that gets called when the event is fired.

Returns

boolean

Inherited from

IEventDispatcher.hasEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:21


removeEventListener

removeEventListener(type, listener): void

Removes a listener from an event type.

Parameters

NameTypeDescription
type"update" | "preRender" | "postRender" | "preFrame" | "postFrame" | "dispose" | "addPlugin"The type of the listener that gets removed.
listener(event: IEvent<"update" | "preRender" | "postRender" | "preFrame" | "postFrame" | "dispose" | "addPlugin">) => voidThe listener function that gets removed.

Returns

void

Inherited from

IEventDispatcher.removeEventListener

Defined in

webgi/src/helpers/EventDispatcher.ts:28


dispatchEvent

dispatchEvent(event): void

Fire an event type.

Parameters

NameType
eventIEvent<"update" | "preRender" | "postRender" | "preFrame" | "postFrame" | "dispose" | "addPlugin">

Returns

void

Inherited from

IEventDispatcher.dispatchEvent

Defined in

webgi/src/helpers/EventDispatcher.ts:34


toJSON

toJSON(meta?): any

Parameters

NameType
meta?any

Returns

any

Inherited from

IJSONSerializable.toJSON

Defined in

webgi/src/interfaces.ts:442


fromJSON

fromJSON(data, meta?): null | IViewerApp | Promise<null | IViewerApp>

Parameters

NameType
dataany
meta?any

Returns

null | IViewerApp | Promise<null | IViewerApp>

Inherited from

IJSONSerializable.fromJSON

Defined in

webgi/src/interfaces.ts:443


addPlugin

addPlugin<T>(plugin): Promise<T>

Type parameters

NameType
Textends IViewerPlugin<IViewerApp, T>

Parameters

NameType
pluginT

Returns

Promise<T>

Defined in

webgi/src/interfaces.ts:458

addPlugin<T>(plugin, ...args): Promise<T>

Type parameters

NameType
Textends IViewerPlugin<IViewerApp, T>

Parameters

NameType
pluginClass<T>
...argsany[]

Returns

Promise<T>

Defined in

webgi/src/interfaces.ts:459


removePlugin

removePlugin(plugin): Promise<void>

Parameters

NameType
pluginIViewerPlugin<IViewerApp>

Returns

Promise<void>

Defined in

webgi/src/interfaces.ts:462


getPlugin

getPlugin<T>(type): undefined | T

Type parameters

NameType
Textends IViewerPlugin<IViewerApp, T>

Parameters

NameType
typeClass<T>

Returns

undefined | T

Defined in

webgi/src/interfaces.ts:465


getPluginByType

getPluginByType<T>(type): undefined | T

Type parameters

NameType
Textends IViewerPlugin<IViewerApp, T>

Parameters

NameType
typestring

Returns

undefined | T

Defined in

webgi/src/interfaces.ts:466


setDirty

setDirty(): void

Returns

void

Defined in

webgi/src/interfaces.ts:468


createCamera

createCamera(cameraObject): ICamera<ICameraOptions, any, any>

Parameters

NameType
cameraObjectany

Returns

ICamera<ICameraOptions, any, any>

Defined in

webgi/src/interfaces.ts:470


setBackgroundColor

setBackgroundColor(color): void

Parameters

NameType
colorany

Returns

void

Defined in

webgi/src/interfaces.ts:472


setBackground

setBackground(asset): void

Parameters

NameType
assetnull | string | number | ITexture<any>

Returns

void

Defined in

webgi/src/interfaces.ts:473


getBackground

getBackground(raw?): null | string | number | ITexture<any>

Parameters

NameType
raw?boolean

Returns

null | string | number | ITexture<any>

Defined in

webgi/src/interfaces.ts:474


resetCamera

resetCamera(options?): void

Parameters

NameType
options?AnyOptions

Returns

void

Defined in

webgi/src/interfaces.ts:476


alert

alert(message?): Promise<void>

Parameters

NameType
message?string

Returns

Promise<void>

Defined in

webgi/src/interfaces.ts:478


confirm

confirm(message?): Promise<boolean>

Parameters

NameType
message?string

Returns

Promise<boolean>

Defined in

webgi/src/interfaces.ts:479


prompt

prompt(message?, _default?, cancel?): Promise<null | string>

Parameters

NameType
message?string
_default?string
cancel?boolean

Returns

Promise<null | string>

Defined in

webgi/src/interfaces.ts:480

Properties

state

state: ViewerState

Defined in

webgi/src/interfaces.ts:447


renderer

renderer: IRenderer

Defined in

webgi/src/interfaces.ts:448


scene

scene: IScene<any, ICamera<ICameraOptions, any, any>>

Defined in

webgi/src/interfaces.ts:449


plugins

Readonly plugins: Record<string, IViewerPlugin<IViewerApp>>

Defined in

webgi/src/interfaces.ts:450


container

container: HTMLElement

Defined in

webgi/src/interfaces.ts:451


canvas

canvas: HTMLCanvasElement

Defined in

webgi/src/interfaces.ts:452


useRgbm

useRgbm: boolean

Defined in

webgi/src/interfaces.ts:454


useGBufferDepth

useGBufferDepth: boolean

Defined in

webgi/src/interfaces.ts:455


isAntialiased

isAntialiased: boolean

Defined in

webgi/src/interfaces.ts:456