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
3 // found in the LICENSE file.
8 #include "public/platform/WebCommon.h"
9 #include "public/platform/WebString.h"
11 #if BLINK_IMPLEMENTATION
12 #include "wtf/Assertions.h"
26 int x
, y
, width
, height
;
29 // A field of view, given by 4 degrees describing the view from a center point.
30 struct WebVRFieldOfView
{
37 // Bit flags to indicate which fields of an WebHMDSensorState are valid.
38 enum WebVRSensorStateFlags
{
39 WebVRSensorStateOrientation
= 1 << 1,
40 WebVRSensorStatePosition
= 1 << 2,
41 WebVRSensorStateAngularVelocity
= 1 << 3,
42 WebVRSensorStateLinearVelocity
= 1 << 4,
43 WebVRSensorStateAngularAcceleration
= 1 << 5,
44 WebVRSensorStateLinearAcceleration
= 1 << 6,
45 WebVRSensorStateComplete
= (1 << 7) - 1 // All previous states combined.
48 // A bitfield of WebVRSensorStateFlags.
49 typedef int WebVRSensorStateMask
;
51 // A sensor's position, orientation, velocity, and acceleration state at the
53 struct WebHMDSensorState
{
56 WebVRSensorStateMask flags
;
57 WebVRVector4 orientation
;
58 WebVRVector3 position
;
59 WebVRVector3 angularVelocity
;
60 WebVRVector3 linearVelocity
;
61 WebVRVector3 angularAcceleration
;
62 WebVRVector3 linearAcceleration
;
65 // Information about the optical properties for an eye in an HMD.
66 struct WebVREyeParameters
{
67 WebVRFieldOfView minimumFieldOfView
;
68 WebVRFieldOfView maximumFieldOfView
;
69 WebVRFieldOfView recommendedFieldOfView
;
70 WebVRVector3 eyeTranslation
;
74 // Information pertaining to Head Mounted Displays.
76 WebVREyeParameters leftEye
;
77 WebVREyeParameters rightEye
;
80 // Bit flags to indicate what type of data a WebVRDevice describes.
81 enum WebVRDeviceTypeFlags
{
82 WebVRDeviceTypePosition
= 1 << 1,
83 WebVRDeviceTypeHMD
= 1 << 2
86 // A bitfield of WebVRDeviceTypeFlags.
87 typedef int WebVRDeviceTypeMask
;
89 // Describes a single VR hardware unit. May describe multiple capabilities,
90 // such as position sensors or head mounted display metrics.
92 // Index for this hardware unit.
94 // Friendly device name.
96 // Identifies the capabilities of this hardware unit.
97 WebVRDeviceTypeMask flags
;
98 // Will only contain valid data if (flags & HasHMDDevice).