summaryrefslogtreecommitdiffstats
path: root/content/common/vr_service.mojom
blob: 2d81ec70a11571e6758028b0ea075ffeb7f726d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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);
};