Interface: WorldHit
Defined in: packages/webxr-environment/src/world-sensing.ts:142
Where a ray met the world.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
distance | readonly | number | null | Metres from where the ray started, or null when the host will not say. This is the one field here whose availability differs, and it is worth knowing why: it needs the ray's ORIGIN as well as its hit, and not every host exposes one. Raw WebXR does - the hit-test source is bound to a space, and that space can be posed - so the three.js adapter fills it. IWSDK moves a target entity to the hit and keeps the ray to itself, so it reports null there rather than guessing from the head, which would be a different number wearing the same name. An app that needs it everywhere can compute its own from a pose it already has; an app that just wants "ignore anything past three metres" should check for null and treat it as "unknown", not as zero. | packages/webxr-environment/src/world-sensing.ts:161 |
pose | readonly | WorldPose | - | packages/webxr-environment/src/world-sensing.ts:145 |
sourceId | readonly | string | The id of the HitTestRequest this answers. | packages/webxr-environment/src/world-sensing.ts:144 |