p5.xr
p5.xr copied to clipboard
Refactor / p5xr consolidation / Fix AR mode
As discussed in #207, this PR consolidates common code between p5xr
and p5ar
into p5xr
in preparation for a more feature based approach. Initially I was looking to fix AR mode for the use with my Quest 3, but doing the refactor at the same time made the most sense.
Let me know if you would like me to squash the commits into a single one, or if you prefer "atomic commits".
Here are the changes in reverse chronological order:
- Hello cube AR example
- Fix tests for launching from constructor
- Consolidated common startsketch and request session into p5xr Removed p5.instance._decrementPreload as it was launching p5 in 2D mode for some reason
- Moved common requestSession code into p5xr from p5ar and p5vr
- Favour explicited WebXR modes
- Moved isImmersive to XR level, AR and VR can both be immersive
- Removed superfluous init functions, create buttons in constructors Removed button argument because it was always created and overloaded afer construction
- Removed deprecated navigator.getUserMedia() https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia