Skip to main content

Interface: InputProvider

Defined in: provider.ts:34

The one interface an engine adapter must implement to feed input into the Reality Collective extension families.

Pull-based by design: consumers call sample (and sampleHints) exactly once per host frame, so providers never need their own timers and stay trivially testable.

Methods

getCapabilities()

getCapabilities(): InputCapabilities;

Defined in: provider.ts:36

Current negotiated capabilities (derived from the LIVE session).

Returns

InputCapabilities


getHeadPose()?

optional getHeadPose(): HeadPose;

Defined in: provider.ts:51

Head pose, when capabilities.headPose is true.

Returns

HeadPose


onCapabilitiesChanged()

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

Defined in: provider.ts:38

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

Parameters

ParameterType
listener(capabilities: InputCapabilities) => void

Returns

Unsubscribe


onSourcesChanged()

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

Defined in: provider.ts:42

Source connect/disconnect.

Parameters

ParameterType
listener() => void

Returns

Unsubscribe


pulse()?

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

Defined in: provider.ts:62

Fire a haptic pulse on a source, when capabilities.haptics is true and the source reports hapticsAvailable. Returns false when the pulse could not be delivered. Intensity 0..1, duration in ms.

Parameters

ParameterType
sourceIdstring
intensitynumber
durationMsnumber

Returns

boolean


sample()

sample(): readonly InputSourceSnapshot[];

Defined in: provider.ts:49

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[]


sampleHints()?

optional sampleHints(): readonly InputHitHint[];

Defined in: provider.ts:56

Pre-resolved targeting hints for this frame (optional - providers with their own targeting pipelines only). Consumed alongside sample.

Returns

readonly InputHitHint[]


setPresenceModality()?

optional setPresenceModality(mode: PresenceModality): boolean;

Defined in: provider.ts:78

Choose which visuals represent the user (hands, controllers, or let the runtime decide). Only meaningful when capabilities.presence is true. Returns false when the request could not be delivered, exactly as pulse does.

Parameters

ParameterType
modePresenceModality

Returns

boolean


setPresenceVisible()?

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

Defined in: provider.ts:71

Show or hide the user's own hand/controller visuals, for one side or for all of them. A target of "none" names no side: providers change nothing and only report whether presence is available at all. Only meaningful when capabilities.presence is true. Returns false when the request could not be delivered, exactly as pulse does.

Parameters

ParameterType
targetHandedness | "all"
visibleboolean

Returns

boolean