Offset XRSession.requestHitTestSource() with user input to raycast XR Ray hits?

I’ve been breaking down how the WebXR.ts script works in Needle and trying to make XR Hit Tests fire from user input by touching the screen at a location to fire a ray. I started constructing an XRRay as an offset ray for the xrSession.requestHitTestSource, but found on Mozilla Firefox/XR Viewer, the XRRay is not supported. Is it possible to hackily offset the XR Ray cast to the user’s input on screen relative to the main camera another way?

Really struggling with this one due to shoddy browser support of these XR APIs that even Mozilla document then don’t support in their own browsers…

Original Post on Discord

by user 103054507105067008

I was trying this: this.offsetRay = new XRRay(this.rigidTransform, new Vector3(0, 0, -1).applyMatrix4(this.context.mainCamera.matrixWorld));

by user 103054507105067008