Skip to main content

Class: BabylonInputProvider

Defined in: babylon-interactions/src/provider.ts:86

Implements​

  • InputProvider

Constructors​

Constructor​

new BabylonInputProvider(options: BabylonProviderOptions): BabylonInputProvider;

Defined in: babylon-interactions/src/provider.ts:100

Parameters​

ParameterType
optionsBabylonProviderOptions

Returns​

BabylonInputProvider

Methods​

dispose()​

dispose(): void;

Defined in: babylon-interactions/src/provider.ts:417

Returns​

void


getCapabilities()​

getCapabilities(): InputCapabilities;

Defined in: babylon-interactions/src/provider.ts:241

Current negotiated capabilities (derived from the LIVE session).

Returns​

InputCapabilities

Implementation of​

InputProvider.getCapabilities

getHeadPose()​

getHeadPose(): HeadPose;

Defined in: babylon-interactions/src/provider.ts:350

Head pose, when capabilities.headPose is true.

Returns​

HeadPose

Implementation of​

InputProvider.getHeadPose

onCapabilitiesChanged()​

onCapabilitiesChanged(listener: (c: InputCapabilities) => void): Unsubscribe;

Defined in: babylon-interactions/src/provider.ts:245

Capability changes: session start/end, hands⇄controllers swap.

Parameters​

ParameterType
listener(c: InputCapabilities) => void

Returns​

Unsubscribe

Implementation of​

InputProvider.onCapabilitiesChanged

onSourcesChanged()​

onSourcesChanged(listener: () => void): Unsubscribe;

Defined in: babylon-interactions/src/provider.ts:250

Source connect/disconnect.

Parameters​

ParameterType
listener() => void

Returns​

Unsubscribe

Implementation of​

InputProvider.onSourcesChanged

pulse()​

pulse(
sourceId: string,
intensity: number,
durationMs: number
): boolean;

Defined in: babylon-interactions/src/provider.ts:365

Babylon routes haptics through the motion controller rather than the gamepad actuator, so a source with no motion controller cannot pulse even when the gamepad reports an actuator.

Parameters​

ParameterType
sourceIdstring
intensitynumber
durationMsnumber

Returns​

boolean

Implementation of​

InputProvider.pulse

sample()​

sample(): readonly InputSourceSnapshot[];

Defined in: babylon-interactions/src/provider.ts:257

Snapshot every live source. Called once per update tick.

The snapshots returned are the caller's to keep: the provider does not write to them after returning them (see InputSourceSnapshot).

Returns​

readonly InputSourceSnapshot[]

Implementation of​

InputProvider.sample

setPresenceModality()​

setPresenceModality(_mode: PresenceModality): boolean;

Defined in: babylon-interactions/src/provider.ts:403

Always false. Babylon picks the visual per input source - a controller gets its motion-controller model, a tracked hand gets the hand mesh - and exposes no switch between the two. IWSDK builds both families, so its adapter implements this.

Parameters​

ParameterType
_modePresenceModality

Returns​

boolean

Implementation of​

InputProvider.setPresenceModality

setPresenceVisible()​

setPresenceVisible(target: Handedness | "all", visible: boolean): boolean;

Defined in: babylon-interactions/src/provider.ts:383

Show or hide the visuals Babylon built for the targeted sides. Returns false when the target has nothing to show or hide. "none" targets no side, so it reports whether presence is usable at all without changing anything.

Parameters​

ParameterType
targetHandedness | "all"
visibleboolean

Returns​

boolean

Implementation of​

InputProvider.setPresenceVisible