Skip to main content

Module: @geenee/bodyrenderers-common

Classes

Interfaces

Type Aliases

SegmentationResult

Ƭ SegmentationResult: PoseResult | FaceResult | MaskResult

Tracking results having segmentation mask

Functions

DelayPlugin

DelayPlugin<PluginT, ResultT>(plugin, delay?): PluginT & { delay: number ; results: ResultT[] }

Factory function adding delay to a plugin

In delayed plugin update() method is called with detection results from one of the previous iterations of the tracking engine. This way we achieve effect of object following its controller with some delay. Delay may be used in combination with various twin plugins to achieve less artificial behaviour of twins that will repeat user movements without absolute synchronization in time and thus look more natural.

Type parameters

NameTypeDescription
PluginTextends Plugin<ResultT>Type of plugin
ResultTextends Object = Type of processing results

Parameters

NameTypeDefault valueDescription
pluginPluginTundefinedPlugin to introduce delay to
delaynumber0Number of updates to delay

Returns

PluginT & { delay: number ; results: ResultT[] }

Plugin with delay added


getMaskBuf

getMaskBuf(result): undefined | BodyMask

Extract mask buffer from processing results

Parameters

NameTypeDescription
resultSegmentationResultProcessing/tracking results

Returns

undefined | BodyMask

Segmentation mask buffer


getMaskObj

getMaskObj(result): undefined | Mask

Extract detected object with segmentation mask

Parameters

NameTypeDescription
resultSegmentationResultProcessing/tracking results

Returns

undefined | Mask

Detcted object with segmentation mask


getMaskTex

getMaskTex(result): undefined | BodyMaskTexture

Extract mask texture from processing results

Parameters

NameTypeDescription
resultSegmentationResultProcessing/tracking results

Returns

undefined | BodyMaskTexture

Segmentation mask texture


maskRectUniform

maskRectUniform(b): [number, number, number, number]

Convert segmentation mask box to rect shader uniform

Parameters

NameTypeDescription
bBoxMask box

Returns

[number, number, number, number]

Mask rect shader uniform