Class: ThreeWorldSensingPort
Defined in: threejs-environment/src/world-sensing-port.ts:96
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 ThreeWorldSensingPort(renderer: XrRendererLike, options?: ThreeWorldSensingPortOptions): ThreeWorldSensingPort;
Defined in: threejs-environment/src/world-sensing-port.ts:110
Parameters
| Parameter | Type |
|---|---|
renderer | XrRendererLike |
options | ThreeWorldSensingPortOptions |
Returns
ThreeWorldSensingPort
Methods
createAnchor()
createAnchor(pose: WorldPose): Promise<string | null>;
Defined in: threejs-environment/src/world-sensing-port.ts:213
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
| Parameter | Type |
|---|---|
pose | WorldPose |
Returns
Promise<string | null>
Implementation of
dispose()
dispose(): void;
Defined in: threejs-environment/src/world-sensing-port.ts:280
Returns
void
Implementation of
observe()
observe(host: WorldSensingPortHost): () => void;
Defined in: threejs-environment/src/world-sensing-port.ts:116
Parameters
| Parameter | Type |
|---|---|
host | WorldSensingPortHost |
Returns
() => void
Implementation of
removeAnchor()
removeAnchor(id: string): void;
Defined in: threejs-environment/src/world-sensing-port.ts:245
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Implementation of
setDetection()
setDetection(detection:
| ResolvedWorldDetection
| null): void;
Defined in: threejs-environment/src/world-sensing-port.ts:123
Turn detection on or off. null means stop everything.
Parameters
| Parameter | Type |
|---|---|
detection | | ResolvedWorldDetection | null |
Returns
void
Implementation of
startHitTest()
startHitTest(request: HitTestRequest): void;
Defined in: threejs-environment/src/world-sensing-port.ts:171
Start a standing hit test.
A hand ray is cast from the INPUT SOURCE, not from the head. WebXR binds a
hit-test source to a space, and the space for a hand or controller is that
source's targetRaySpace - so this looks the source up by handedness and
binds to it. Input sources come and go (a hand leaves the view, a
controller wakes up), so a request that cannot be bound yet stays pending
and is retried on every frame, and one whose source disappears is unbound
and rebound rather than left aiming at nothing.
Parameters
| Parameter | Type |
|---|---|
request | HitTestRequest |
Returns
void
Implementation of
stopHitTest()
stopHitTest(id: string): void;
Defined in: threejs-environment/src/world-sensing-port.ts:205
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Implementation of
update()
update(): void;
Defined in: threejs-environment/src/world-sensing-port.ts:254
Called from the director's update; this is where a port polls its host.
Returns
void