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
Name | Type | Description |
---|---|---|
ResultT | extends Object = {} | Type of processing results |
Hierarchy
ScenePlugin
<ResultT
,three.Scene
>↳
ThreePlugin
↳↳
PosePlugin
↳↳
FacePlugin
Constructors
constructor
• new ThreePlugin<ResultT
>()
Type parameters
Name | Type |
---|---|
ResultT | extends 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
Name | Type | Description |
---|---|---|
scene? | Scene | Scene 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
Name | Type | Description |
---|---|---|
result | ResultT | Results of video processing |
stream | HTMLCanvasElement | Captured video frame |
Returns
Promise
<void
>
Promise resolving when update is finished
Inherited from
ScenePlugin.update