diff --git a/dom/vr/VRDisplay.cpp b/dom/vr/VRDisplay.cpp index edaa34fa49b2..3bd87aed1d24 100644 --- a/dom/vr/VRDisplay.cpp +++ b/dom/vr/VRDisplay.cpp @@ -246,7 +246,9 @@ void VRPose::GetPosition(JSContext* aCx, JS::MutableHandle aRetval, SetFloat32Array( aCx, aRetval, mPosition, mVRState.pose.position, 3, !mPosition && - bool(mVRState.flags & gfx::VRDisplayCapabilityFlags::Cap_Position), + (bool(mVRState.flags & gfx::VRDisplayCapabilityFlags::Cap_Position) || + bool(mVRState.flags & + gfx::VRDisplayCapabilityFlags::Cap_PositionEmulated)), aRv); } diff --git a/gfx/vr/external_api/moz_external_vr.h b/gfx/vr/external_api/moz_external_vr.h index e3e688f3cbff..8b8c1ffeadca 100644 --- a/gfx/vr/external_api/moz_external_vr.h +++ b/gfx/vr/external_api/moz_external_vr.h @@ -34,7 +34,7 @@ enum class GamepadCapabilityFlags : uint16_t; #endif // MOZILLA_INTERNAL_API namespace gfx { -static const int32_t kVRExternalVersion = 6; +static const int32_t kVRExternalVersion = 7; // We assign VR presentations to groups with a bitmask. // Currently, we will only display either content or chrome. @@ -159,10 +159,15 @@ enum class VRDisplayCapabilityFlags : uint16_t { * user is wearing the device. */ Cap_MountDetection = 1 << 8, + /** + * Cap_PositionEmulated is set if the VRDisplay is capable of setting a + * emulated position (e.g. neck model) even if still doesn't support 6DOF tracking. + */ + Cap_PositionEmulated = 1 << 9, /** * Cap_All used for validity checking during IPC serialization */ - Cap_All = (1 << 9) - 1 + Cap_All = (1 << 10) - 1 }; #ifdef MOZILLA_INTERNAL_API