| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module blink.mojom; | 5 module blink.mojom; |
| 6 | 6 |
| 7 struct VRVector3 { | |
| 8 float x; | |
| 9 float y; | |
| 10 float z; | |
| 11 }; | |
| 12 | |
| 13 struct VRVector4 { | |
| 14 float x; | |
| 15 float y; | |
| 16 float z; | |
| 17 float w; | |
| 18 }; | |
| 19 | |
| 20 struct VRRect { | |
| 21 int32 x; | |
| 22 int32 y; | |
| 23 int32 width; | |
| 24 int32 height; | |
| 25 }; | |
| 26 | |
| 27 // A field of view, given by 4 degrees describing the view from a center point. | 7 // A field of view, given by 4 degrees describing the view from a center point. |
| 28 struct VRFieldOfView { | 8 struct VRFieldOfView { |
| 29 float upDegrees; | 9 float upDegrees; |
| 30 float downDegrees; | 10 float downDegrees; |
| 31 float leftDegrees; | 11 float leftDegrees; |
| 32 float rightDegrees; | 12 float rightDegrees; |
| 33 }; | 13 }; |
| 34 | 14 |
| 35 // A sensor's position, orientation, velocity, and acceleration state at the | 15 // A display's position, orientation, velocity, and acceleration state at the |
| 36 // given timestamp. | 16 // given timestamp. |
| 37 struct VRSensorState { | 17 struct VRPose { |
| 38 double timestamp; | 18 double timestamp; |
| 39 uint32 frameIndex; | 19 array<float, 4>? orientation; |
| 40 VRVector4? orientation; | 20 array<float, 3>? position; |
| 41 VRVector3? position; | 21 array<float, 3>? angularVelocity; |
| 42 VRVector3? angularVelocity; | 22 array<float, 3>? linearVelocity; |
| 43 VRVector3? linearVelocity; | 23 array<float, 3>? angularAcceleration; |
| 44 VRVector3? angularAcceleration; | 24 array<float, 3>? linearAcceleration; |
| 45 VRVector3? linearAcceleration; | |
| 46 }; | 25 }; |
| 47 | 26 |
| 48 // Information about the optical properties for an eye in an HMD. | 27 struct VRDisplayCapabilities { |
| 49 struct VREyeParameters { | 28 bool hasOrientation; |
| 50 VRFieldOfView minimumFieldOfView; | 29 bool hasPosition; |
| 51 VRFieldOfView maximumFieldOfView; | 30 bool hasExternalDisplay; |
| 52 VRFieldOfView recommendedFieldOfView; | 31 bool canPresent; |
| 53 VRVector3 eyeTranslation; | |
| 54 VRRect renderRect; | |
| 55 }; | 32 }; |
| 56 | 33 |
| 57 // Information pertaining to Head Mounted Displays. | 34 // Information about the optical properties for an eye in a VRDisplay. |
| 58 struct VRHMDInfo { | 35 struct VREyeParameters { |
| 59 VREyeParameters leftEye; | 36 VRFieldOfView fieldOfView; |
| 60 VREyeParameters rightEye; | 37 array<float, 3> offset; |
| 38 uint32 renderWidth; |
| 39 uint32 renderHeight; |
| 61 }; | 40 }; |
| 62 | 41 |
| 63 struct VRDeviceInfo { | 42 struct VRStageParameters { |
| 43 array<float, 16> standingTransform; |
| 44 float sizeX; |
| 45 float sizeZ; |
| 46 }; |
| 47 |
| 48 struct VRDisplay { |
| 64 uint32 index; | 49 uint32 index; |
| 65 string deviceName; | 50 string displayName; |
| 66 VRHMDInfo? hmdInfo; | 51 VRDisplayCapabilities capabilities; |
| 52 VRStageParameters? stageParameters; |
| 53 VREyeParameters leftEye; |
| 54 VREyeParameters rightEye; |
| 67 }; | 55 }; |
| 68 | 56 |
| 69 interface VRService { | 57 interface VRService { |
| 70 GetDevices() => (array<VRDeviceInfo> devices); | 58 GetDisplays() => (array<VRDisplay> displays); |
| 71 [Sync] | 59 [Sync] |
| 72 GetSensorState(uint32 index) => (VRSensorState state); | 60 GetPose(uint32 index) => (VRPose pose); |
| 73 ResetSensor(uint32 index); | 61 ResetPose(uint32 index); |
| 74 }; | 62 }; |
| OLD | NEW |