Sensor data coming in from [GAME_]ROTATION_VECTOR is a quaternion with the following axes:
- +X is Y dot Z (along the short axis for a rectangular phone, pointing right)
- +Y tangential to the device's screen, pointing upwards (along the long axis for a rectangular phone)
- +Z perpendicular to the device's screen, pointing outwards (towards the viewer when looking at a phone screen)
When the phone is held in "VR" orientation:
- it is rotated 90 degrees around the Z axis (to get it to landscape mode)
- it is rotated 90 degrees around the Y axis (to flip it upwards to be held directly in front of the eyes instead of flat)
The coordinate space that's desired when the phone is held in the VR orientation: