Just as I kept posting here too, I found the root cause was:
this.context.input.convertScreenspaceToRaycastSpace(origin) on iOS WebXR Viewer returns ā0ā for this.context.domWidth and this.context.domHeight.
Changing those to window.innerWidth and window.innerHeight works correct for WebXR AR with Mozilla WebXR Viewer on iOS
Ah thank you for investigating! It āmakes senseā - I didnt think about that but i when debugging last time I noticed that Mozilla XR removed the canvas from the DOM - I thought it only did that falsely on exit AR but that would suggest itās removing the canvas on enter AR even
Will try this first thing tomorrow but I know for sure that workaround works in the local solution I posted in the git issue as I changed the code to do the same with local copies
I laid it out like this and it produces the NaN error again, reverting back to the example solution in my git issue fixed it again, it seems to be this line in engine_input.ts that needs to be changed:
ideally we dont have to think about it anymore and they just return the correct values based on the state of the app (innerwidth is not correct in some cases so i can not change that there e.g. when you dont have a fullscreen canvas)
Makes sense, I think usually AR is a full screen takeover luckily, might be a non issue if Apple eventually allow WebXR to run in Safari⦠almost all of the clients use iOS devices unfortunately
Do you have access to a test iPhone for testing btw? I feel like Iām always hitting weird issues just on iOS WebXR Mozilla when otherwise everything works great on Android Chrome
We regularly test on WebXR Viewer as well, but it has so many quirks that we donāt always find all of them - super happy that youāre testing this so diligently.
Thanks it really does feel like an abandoned web browser, I am sure there is some arbitrary Apple-only reason why it can exist on its own as a fully working browser that isnāt a reskinned Safari and support WebXR while other browsers donāt
Whatās interesting (and problematic) is that yes, it is abandoned, and they added a ton APIs that were in discussion ~2 years ago - some of which changed, some of which disappeared
Also interesting: if we were to fix things in this script I believe we could actually patch that JavaScript side of things in the WebXR Viewer (theyāre literally fetching that from a server at page request)