Skip to content

PosePlugin

Abstract plugin for PoseRenderer

Specializes the BabylonPlugin generic for @geenee/bodyprocessors!PoseResult. This’s abstract plugin that doesn’t implement any logic.

new PosePlugin(): PosePlugin

Constructor

PosePlugin

BabylonPlugin.constructor

loaded: boolean

Loaded state

BabylonPlugin.loaded


ordinal: number

Ordinal number

BabylonPlugin.ordinal


protected optional renderer: Renderer<PoseResult>

Renderer loaded the plugin

BabylonPlugin.renderer


protected optional scene: Scene

Reference to a scene instance

BabylonPlugin.scene

dispose(): void

Dispose video plugin

void

BabylonPlugin.dispose


load(renderer): 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.

Renderer<PoseResult>

Renderer this plugin is attached to

Promise<void>

Promise resolving when initialization is finished

BabylonPlugin.load


setupCamera(ratio, angle): void

Set camera parameters

Could be overridden to adjust plugin’s pipeline.

number

Aspect ration of input video

number

Vertical field of view in radians

void

BabylonPlugin.setupCamera


setupVideo(size): void

Set video size

Could be overridden to adjust plugin’s pipeline.

Size

Resolution of input video

void

BabylonPlugin.setupVideo


unload(): void

Reset plugin

Releases all resources allocated in load(). Deletes cached reference to the scene object.

void

BabylonPlugin.unload


update(result, stream): Promise<void>

Update

Main method implementing the logic of the plugin. Overridden by derived classes for particular task.

PoseResult

Results of video processing

HTMLCanvasElement

Captured video frame

Promise<void>

Promise resolving when update is finished

BabylonPlugin.update