Skip to main content

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

Constructors

constructor

new FacePlugin()

Inherited from

BabylonPlugin.constructor

Properties

loaded

loaded: boolean

Loaded state

Inherited from

BabylonPlugin.loaded


scene

Protected Optional scene: Scene

Inherited from

BabylonPlugin.scene

Methods

dispose

dispose(): void

Dispose render plugin

Returns

void

Inherited from

BabylonPlugin.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

BabylonPlugin.load


unload

unload(): void

Reset plugin

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

Returns

void

Inherited from

BabylonPlugin.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
resultFaceResultResults of video processing
streamHTMLCanvasElementCaptured video frame

Returns

Promise<void>

Promise resolving when update is finished

Inherited from

BabylonPlugin.update