Skip to main content

Class: GestureRecognitionOptions

Defined in: src/input/gestures/GestureRecognitionOptions.ts:28

Constructors

Constructor

new GestureRecognitionOptions(options?): GestureRecognitionOptions

Defined in: src/input/gestures/GestureRecognitionOptions.ts:63

Parameters

options?
enable?

() => GestureRecognitionOptions

enabled?

boolean = false

Master switch for the gesture recognition block.

gestures?

{ fist?: { enabled?: boolean; threshold?: number; }; open-palm?: { enabled?: boolean; threshold?: number; }; pinch?: { enabled?: boolean; threshold?: number; }; point?: { enabled?: boolean; threshold?: number; }; spread?: { enabled?: boolean; threshold?: number; }; thumbs-up?: { enabled?: boolean; threshold?: number; }; } = ...

Default gesture catalogue.

gestures.fist?

{ enabled?: boolean; threshold?: number; }

gestures.fist.enabled?

boolean

gestures.fist.threshold?

number

Optional override for gesture-specific score thresholds. For distance based gestures this is treated as a maximum distance; for confidence based gestures it is treated as a minimum score.

gestures.open-palm?

{ enabled?: boolean; threshold?: number; }

gestures.open-palm.enabled?

boolean

gestures.open-palm.threshold?

number

Optional override for gesture-specific score thresholds. For distance based gestures this is treated as a maximum distance; for confidence based gestures it is treated as a minimum score.

gestures.pinch?

{ enabled?: boolean; threshold?: number; }

gestures.pinch.enabled?

boolean

gestures.pinch.threshold?

number

Optional override for gesture-specific score thresholds. For distance based gestures this is treated as a maximum distance; for confidence based gestures it is treated as a minimum score.

gestures.point?

{ enabled?: boolean; threshold?: number; }

gestures.point.enabled?

boolean

gestures.point.threshold?

number

Optional override for gesture-specific score thresholds. For distance based gestures this is treated as a maximum distance; for confidence based gestures it is treated as a minimum score.

gestures.spread?

{ enabled?: boolean; threshold?: number; }

gestures.spread.enabled?

boolean

gestures.spread.threshold?

number

Optional override for gesture-specific score thresholds. For distance based gestures this is treated as a maximum distance; for confidence based gestures it is treated as a minimum score.

gestures.thumbs-up?

{ enabled?: boolean; threshold?: number; }

gestures.thumbs-up.enabled?

boolean

gestures.thumbs-up.threshold?

number

Optional override for gesture-specific score thresholds. For distance based gestures this is treated as a maximum distance; for confidence based gestures it is treated as a minimum score.

minimumConfidence?

number = 0.6

Minimum confidence score to emit gesture events. Different providers map to different score domains so this value is normalised to [0-1].

provider?

GestureProvider = 'heuristics'

Backing provider that extracts gesture information.

  • 'heuristics': WebXR joint heuristics only (no external ML dependency).
  • 'mediapipe': MediaPipe Hands running via Web APIs / wasm.
  • 'tfjs': TensorFlow.js hand-pose-detection models.
setGestureEnabled?

(name, enabled) => GestureRecognitionOptions

updateIntervalMs?

number = 33

Optional throttle window for expensive providers.

Returns

GestureRecognitionOptions

Properties

enabled

enabled: boolean = false

Defined in: src/input/gestures/GestureRecognitionOptions.ts:30

Master switch for the gesture recognition block.


gestures

gestures: Record<BuiltInGestureName, GestureConfiguration>

Defined in: src/input/gestures/GestureRecognitionOptions.ts:54

Default gesture catalogue.


minimumConfidence

minimumConfidence: number = 0.6

Defined in: src/input/gestures/GestureRecognitionOptions.ts:44

Minimum confidence score to emit gesture events. Different providers map to different score domains so this value is normalised to [0-1].


provider

provider: GestureProvider = 'heuristics'

Defined in: src/input/gestures/GestureRecognitionOptions.ts:38

Backing provider that extracts gesture information.

  • 'heuristics': WebXR joint heuristics only (no external ML dependency).
  • 'mediapipe': MediaPipe Hands running via Web APIs / wasm.
  • 'tfjs': TensorFlow.js hand-pose-detection models.

updateIntervalMs

updateIntervalMs: number = 33

Defined in: src/input/gestures/GestureRecognitionOptions.ts:49

Optional throttle window for expensive providers.

Methods

enable()

enable(): GestureRecognitionOptions

Defined in: src/input/gestures/GestureRecognitionOptions.ts:76

Returns

GestureRecognitionOptions


setGestureEnabled()

setGestureEnabled(name, enabled): GestureRecognitionOptions

Defined in: src/input/gestures/GestureRecognitionOptions.ts:84

Convenience helper to toggle specific gestures.

Parameters

name

BuiltInGestureName

enabled

boolean

Returns

GestureRecognitionOptions