I can’t find any event to handle sleep and wake-up state transitions of the VR headset. Tried Babylon.js documentation, WebXR specification, Google)
It’s a common task for XR, I guess, to stop some process (video player, game, etc.) while taking off the headset. And to resume the process after putting on the headset.
That’s a very good question! As far as I know, there are no events that are triggered when the headset is in rest mode or comes out of it. I’m also pretty sure that in the case of the oculus quest, code stop executing the second the headset is removed (but I’m not 100% sure here).
If you want, you can submit a github ticket and I’ll investigate it further when I have the time to dive into that.