Skip to main content

Interface: WorldSensingPort

Defined in: world-sensing-director.ts:57

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.

Methods

createAnchor()?

optional createAnchor(pose: WorldPose): Promise<string | null>;

Defined in: world-sensing-director.ts:68

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.

Parameters

ParameterType
poseWorldPose

Returns

Promise<string | null>


dispose()?

optional dispose(): void;

Defined in: world-sensing-director.ts:72

Returns

void


observe()

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

Defined in: world-sensing-director.ts:58

Parameters

ParameterType
hostWorldSensingPortHost

Returns

void | (() => void)


removeAnchor()?

optional removeAnchor(id: string): void;

Defined in: world-sensing-director.ts:69

Parameters

ParameterType
idstring

Returns

void


setDetection()?

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

Defined in: world-sensing-director.ts:60

Turn detection on or off. null means stop everything.

Parameters

ParameterType
detectionResolvedWorldDetection | null

Returns

void


startHitTest()?

optional startHitTest(request: HitTestRequest): void;

Defined in: world-sensing-director.ts:61

Parameters

ParameterType
requestHitTestRequest

Returns

void


stopHitTest()?

optional stopHitTest(id: string): void;

Defined in: world-sensing-director.ts:62

Parameters

ParameterType
idstring

Returns

void


update()?

optional update(deltaMs: number): void;

Defined in: world-sensing-director.ts:71

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

Parameters

ParameterType
deltaMsnumber

Returns

void