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.

Extends

Extended by

Constructors

new PosePlugin()

new PosePlugin(): PosePlugin

Constructor

Returns

PosePlugin

Inherited from

BabylonPlugin.constructor

Properties

loaded

loaded: boolean

Loaded state

Inherited from

BabylonPlugin.loaded


ordinal

ordinal: number

Ordinal number

Inherited from

BabylonPlugin.ordinal


renderer?

protected optional renderer: Renderer<PoseResult>

Renderer loaded the plugin

Inherited from

BabylonPlugin.renderer


scene?

protected optional scene: Scene

Reference to a scene instance

Inherited from

BabylonPlugin.scene

Methods

dispose()

dispose(): void

Dispose video plugin

Returns

void

Inherited from

BabylonPlugin.dispose


load()

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.

Parameters

renderer: Renderer<PoseResult>

Renderer this plugin is attached to

Returns

Promise<void>

Promise resolving when initialization is finished

Inherited from

BabylonPlugin.load


setupCamera()

setupCamera(ratio, angle): void

Set camera parameters

Could be overridden to adjust plugin’s pipeline.

Parameters

ratio: number

Aspect ration of input video

angle: number

Vertical field of view in radians

Returns

void

Inherited from

BabylonPlugin.setupCamera


setupVideo()

setupVideo(size): void

Set video size

Could be overridden to adjust plugin’s pipeline.

Parameters

size: Size

Resolution of input video

Returns

void

Inherited from

BabylonPlugin.setupVideo


unload()

unload(): void

Reset plugin

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

Returns

void

Inherited from

BabylonPlugin.unload


update()

update(result, stream): Promise<void>

Update

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

Parameters

result: PoseResult

Results of video processing

stream: HTMLCanvasElement

Captured video frame

Returns

Promise<void>

Promise resolving when update is finished

Inherited from

BabylonPlugin.update