Skip to main content

Interface: WorldHit

Defined in: world-sensing.ts:142

Where a ray met the world.

Properties

PropertyModifierTypeDescriptionDefined in
distancereadonlynumber | nullMetres 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.world-sensing.ts:161
posereadonlyWorldPose-world-sensing.ts:145
sourceIdreadonlystringThe id of the HitTestRequest this answers.world-sensing.ts:144