Skip to main content

Class: ThreePlugin<ResultT>

@geenee/bodyrenderers-three.ThreePlugin

Generic plugin for ThreeRenderer

Extends ScenePlugin for the three.js rendering engine. ThreePlugin is an abstract generic class simplifying library's API, it doesn't implement any logic and can be used as basis for actual render plugins. It should be parameterized by type of processing results to build a plugin for the implementation of Processor.

Type parameters

NameTypeDescription
ResultTextends Object = {}Type of processing results

Hierarchy

Constructors

constructor

new ThreePlugin<ResultT>()

Type parameters

NameType
ResultTextends Object = {}

Inherited from

ScenePlugin<ResultT, three.Scene>.constructor

Properties

loaded

loaded: boolean

Loaded state

Inherited from

ScenePlugin.loaded


scene

Protected Optional scene: Scene

Inherited from

ScenePlugin.scene

Methods

dispose

dispose(): void

Dispose render plugin

Returns

void

Inherited from

ScenePlugin.dispose


load

load(scene?): Promise<void>

Initialize plugin

Prepares or modifies the attached node if required. Reference to the scene object is cached and used by plugin on update() and unload(). You need to reload plugin if you want to change scene it's attached to. Overridden by derived classes for particular task.

Parameters

NameTypeDescription
scene?SceneScene this plugin is attached to

Returns

Promise<void>

Promise resolving when initialization is finished

Inherited from

ScenePlugin.load


unload

unload(): void

Reset plugin

Releases all resources/instances created in load(). Overridden by derived classes for particular task.

Returns

void

Inherited from

ScenePlugin.unload


update

update(result, stream): Promise<void>

Update the scene node

Main method implementing the logic of the plugin. Updates the node according to provided results. Overridden by derived classes for particular task.

Parameters

NameTypeDescription
resultResultTResults of video processing
streamHTMLCanvasElementCaptured video frame

Returns

Promise<void>

Promise resolving when update is finished

Inherited from

ScenePlugin.update