Skip to main content

Class: XRBlocksWorldSensingPort

Defined in: xrblocks-environment/src/world-sensing-port.ts:40

What an adapter implements. Everything except observe is optional, because every host has a different subset and a missing method is reported rather than thrown.

Implements​

Constructors​

Constructor​

new XRBlocksWorldSensingPort(world: XBWorldLike): XRBlocksWorldSensingPort;

Defined in: xrblocks-environment/src/world-sensing-port.ts:49

Parameters​

ParameterType
worldXBWorldLike

Returns​

XRBlocksWorldSensingPort

Methods​

createAnchor()​

createAnchor(): Promise<string | null>;

Defined in: xrblocks-environment/src/world-sensing-port.ts:89

Ask the runtime to remember a point. Resolves to the anchor's id, or null when the runtime refused. Anchors then arrive through host.anchors like any other, so an app can treat its own and the system's the same way.

Returns​

Promise<string | null>

Implementation of​

WorldSensingPort.createAnchor


dispose()​

dispose(): void;

Defined in: xrblocks-environment/src/world-sensing-port.ts:105

Returns​

void

Implementation of​

WorldSensingPort.dispose


observe()​

observe(host: WorldSensingPortHost): () => void;

Defined in: xrblocks-environment/src/world-sensing-port.ts:53

Parameters​

ParameterType
hostWorldSensingPortHost

Returns​

() => void

Implementation of​

WorldSensingPort.observe


setDetection()​

setDetection(detection:
| ResolvedWorldDetection
| null): void;

Defined in: xrblocks-environment/src/world-sensing-port.ts:60

Turn detection on or off. null means stop everything.

Parameters​

ParameterType
detection| ResolvedWorldDetection | null

Returns​

void

Implementation of​

WorldSensingPort.setDetection


startHitTest()​

startHitTest(_request: HitTestRequest): void;

Defined in: xrblocks-environment/src/world-sensing-port.ts:81

Parameters​

ParameterType
_requestHitTestRequest

Returns​

void

Implementation of​

WorldSensingPort.startHitTest


update()​

update(): void;

Defined in: xrblocks-environment/src/world-sensing-port.ts:98

Called from the director's update; this is where a port polls its host.

Returns​

void

Implementation of​

WorldSensingPort.update