Class: FacePlugin
@geenee/bodyrenderers-babylon.FacePlugin
Abstract plugin for FaceRenderer
Specializes the BabylonPlugin generic for FaceResult. This's abstract plugin that doesn't implement any logic.
Hierarchy
BabylonPlugin
<FaceResult
>↳
FacePlugin
Constructors
constructor
• new FacePlugin()
Inherited from
Properties
loaded
• loaded: boolean
Loaded state
Inherited from
scene
• Protected
Optional
scene: Scene
Inherited from
Methods
dispose
▸ dispose(): void
Dispose render plugin
Returns
void
Inherited from
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
unload
▸ unload(): void
Reset plugin
Releases all resources/instances created in load(). Overridden by derived classes for particular task.
Returns
void
Inherited from
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 | FaceResult | Results of video processing |
stream | HTMLCanvasElement | Captured video frame |
Returns
Promise
<void
>
Promise resolving when update is finished