I have a recent issue reported and I would like to be able to fix it upstream (in react-babylonjs
), but it doesn’t look like there are any hooks/observables available for me to automatically detect this emulator being activated in a session. Keep in mind that I am not creating the session myself (I have no access to XRSessionManager instance). When I say fix upstream then I need a way to detect this emulator and put in my own shim.
The issue is here:
{ whenVisibleOnly: true } breaks Meta’s “Immersive Web Emulator” extension · Issue #310 · react-babylonjs
I was thinking that if I could detect when an XR session was initiated (via an observable on scene/engine) then I could add my own enter/exit observables when detecting that specific emulator is being used. It would seem that Meta extension is doing something to the canvas to make it appear off screen (the feature reported to conflict uses an IntersectionObserver on the canvas to pause rendering).
I could potentially accomplish with scene onNewCameraAddedObservable, but I think it would be a hacky solution. Likely there is something more obvious that I am not aware of…