Index: content/common/vr_service.mojom |
diff --git a/content/common/vr_service.mojom b/content/common/vr_service.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2d81ec70a11571e6758028b0ea075ffeb7f726d0 |
--- /dev/null |
+++ b/content/common/vr_service.mojom |
@@ -0,0 +1,73 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+module content; |
+ |
+struct VRVector3 { |
+ float x; |
+ float y; |
+ float z; |
+}; |
+ |
+struct VRVector4 { |
+ float x; |
+ float y; |
+ float z; |
+ float w; |
+}; |
+ |
+struct VRRect { |
+ int32 x; |
+ int32 y; |
+ int32 width; |
+ int32 height; |
+}; |
+ |
+// A field of view, given by 4 degrees describing the view from a center point. |
+struct VRFieldOfView { |
+ float upDegrees; |
+ float downDegrees; |
+ float leftDegrees; |
+ float rightDegrees; |
+}; |
+ |
+// A sensor's position, orientation, velocity, and acceleration state at the |
+// given timestamp. |
+struct VRSensorState { |
+ double timestamp; |
+ uint32 frameIndex; |
+ VRVector4? orientation; |
+ VRVector3? position; |
+ VRVector3? angularVelocity; |
+ VRVector3? linearVelocity; |
+ VRVector3? angularAcceleration; |
+ VRVector3? linearAcceleration; |
+}; |
+ |
+// Information about the optical properties for an eye in an HMD. |
+struct VREyeParameters { |
+ VRFieldOfView minimumFieldOfView; |
+ VRFieldOfView maximumFieldOfView; |
+ VRFieldOfView recommendedFieldOfView; |
+ VRVector3 eyeTranslation; |
+ VRRect renderRect; |
+}; |
+ |
+// Information pertaining to Head Mounted Displays. |
+struct VRHMDInfo { |
+ VREyeParameters leftEye; |
+ VREyeParameters rightEye; |
+}; |
+ |
+struct VRDeviceInfo { |
+ uint32 index; |
+ string deviceName; |
+ VRHMDInfo? hmdInfo; |
+}; |
+ |
+interface VRService { |
+ GetDevices() => (array<VRDeviceInfo> devices); |
+ GetSensorState(uint32 index) => (VRSensorState state); |
+ ResetSensor(uint32 index); |
+}; |