Class: InteractionRuntime
Defined in: runtime.ts:106
Constructors
Constructor
new InteractionRuntime(options: InteractionRuntimeOptions): InteractionRuntime;
Defined in: runtime.ts:122
Parameters
| Parameter | Type |
|---|---|
options | InteractionRuntimeOptions |
Returns
InteractionRuntime
Methods
dispose()
dispose(): void;
Defined in: runtime.ts:309
Returns
void
getBehaviour()
getBehaviour<T extends Behaviour = Behaviour>(interactableId: string, kind: string): T | undefined;
Defined in: runtime.ts:195
Reach a live behaviour instance for tuning (playground steppers).
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends Behaviour | Behaviour |
Parameters
| Parameter | Type |
|---|---|
interactableId | string |
kind | string |
Returns
T | undefined
getCapabilities()
getCapabilities(): InputCapabilities;
Defined in: runtime.ts:267
Returns
InputCapabilities
getInteractableIds()
getInteractableIds(): string[];
Defined in: runtime.ts:216
Returns
string[]
getProvider()
getProvider(): InputProvider;
Defined in: runtime.ts:271
Returns
InputProvider
getSource()
getSource(id: string): InputSourceSnapshot | undefined;
Defined in: runtime.ts:263
The last sample of one source, velocity included. Undefined before the first update, and once the source stops reporting.
The snapshot is the caller's to keep: it is never mutated after the frame it was sampled in, and it is not refreshed in place, so call again for a newer one.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
InputSourceSnapshot | undefined
getState()
getState(id: string): InteractableState | undefined;
Defined in: runtime.ts:200
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
InteractableState | undefined
onEvent()
onEvent(listener: InteractionEventListener): Unsubscribe;
Defined in: runtime.ts:222
Parameters
| Parameter | Type |
|---|---|
listener | InteractionEventListener |
Returns
Unsubscribe
onFeedback()
onFeedback(listener: FeedbackListener): Unsubscribe;
Defined in: runtime.ts:226
Parameters
| Parameter | Type |
|---|---|
listener | FeedbackListener |
Returns
Unsubscribe
onSample()
onSample(listener: (sources: readonly InputSourceSnapshot[]) => void): Unsubscribe;
Defined in: runtime.ts:251
This frame's sources, velocity included.
The snapshots are the provider's own objects for this frame and are
never written to again once delivered (the ownership rule on
InputSourceSnapshot), so a listener may keep one, or a tuple inside
it, across frames without copying.
Parameters
| Parameter | Type |
|---|---|
listener | (sources: readonly InputSourceSnapshot[]) => void |
Returns
Unsubscribe
onSourcesSampled()
onSourcesSampled(listener: (sources: readonly InputSourceSnapshot[]) => void): Unsubscribe;
Defined in: runtime.ts:239
Sampled sources for this frame - the UI Extensions pointer bridge hook.
Parameters
| Parameter | Type |
|---|---|
listener | (sources: readonly InputSourceSnapshot[]) => void |
Returns
Unsubscribe
Deprecated
Use onSample. Both deliver the same stream: since
@realitycollective/webxr-input 0.1.1 carries linearVelocity and
angularVelocity on InputSourceSnapshot, the two signatures are
identical and only one name is needed. This one is kept so existing
callers keep working and will be removed in a later major release.
registerInteractable()
registerInteractable(def: InteractableDescriptor, ports?: RegisterPorts): void;
Defined in: runtime.ts:142
Parameters
| Parameter | Type |
|---|---|
def | InteractableDescriptor |
ports | RegisterPorts |
Returns
void
setHitTester()
setHitTester(hitTester: HitTester | null): void;
Defined in: runtime.ts:190
Parameters
| Parameter | Type |
|---|---|
hitTester | HitTester | null |
Returns
void
setInteractableEnabled()
setInteractableEnabled(id: string, enabled: boolean): void;
Defined in: runtime.ts:179
Parameters
| Parameter | Type |
|---|---|
id | string |
enabled | boolean |
Returns
void
unregisterInteractable()
unregisterInteractable(id: string): void;
Defined in: runtime.ts:172
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
update()
update(dt: number): void;
Defined in: runtime.ts:277
Parameters
| Parameter | Type |
|---|---|
dt | number |
Returns
void