VRAppState lifecycle is broken
It seems that during the discussion in the Hub(1), it was found out that the VRAppState is in a bad state. Once attached, it won't cleanly detach anymore. As a matter of fact, the detach is not even implemented. VRAppState initializes in a way that makes it not possible to clean up later, and I suspect it's based on the JME implementation, not OpenVR or the low level libraries, as I did manage to make it work in one of my tests months ago in C++ (2).
It seems to me that VRAppState first initializes VR sure, but after that it goes changing quite a lot of stuff on JME, like grabbing the camera and controls. WASD works in VR once activated, but once detached, the WASD controls won't work anymore, even though Controls still do their thing and animations. Switching VR on again the second time makes both screens black, unsure if the whole scene is gone?
The dependencies I am using are, engine version: 3.6.0-beta1, artifacts: jme3-core, jme3-desktop, jme3-lwjgl3, jme3-vr.
1: https://hub.jmonkeyengine.org/t/how-to-properly-detach-vr-states/46419/13 2: https://github.com/raffaeleragni/test-vr/blob/master/desktop/src/application.cpp
I believe this should be fixed, so I'm filing it as an issue to see what can be done in the future.
Thank you for documenting this issue.
The jme3-VR module is being deprecated so I think this issue should be closed as won't fix.
For the record I was aware of this issue and when I wrote the user Library Tamarin that provides equivalent functionality I made sure that Tamarin didn't experience this problem; it can be detached safely