forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvr_service.mojom
86 lines (74 loc) · 2.13 KB
/
vr_service.mojom
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
74
75
76
77
78
79
80
81
82
83
84
85
86
// 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 device;
// 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 display's position, orientation, velocity, and acceleration state at the
// given timestamp.
struct VRPose {
double timestamp;
array<float, 4>? orientation;
array<float, 3>? position;
array<float, 3>? angularVelocity;
array<float, 3>? linearVelocity;
array<float, 3>? angularAcceleration;
array<float, 3>? linearAcceleration;
// The poseIndex is a sequential ID that's incremented on each distinct
// getPose result, it may wrap around for long sessions.
uint32 poseIndex;
};
struct VRDisplayCapabilities {
bool hasOrientation;
bool hasPosition;
bool hasExternalDisplay;
bool canPresent;
};
// Information about the optical properties for an eye in a VRDisplay.
struct VREyeParameters {
VRFieldOfView fieldOfView;
array<float, 3> offset;
uint32 renderWidth;
uint32 renderHeight;
};
struct VRStageParameters {
array<float, 16> standingTransform;
float sizeX;
float sizeZ;
};
struct VRDisplay {
uint32 index;
string displayName;
VRDisplayCapabilities capabilities;
VRStageParameters? stageParameters;
VREyeParameters leftEye;
VREyeParameters rightEye;
};
struct VRLayerBounds {
float left;
float top;
float width;
float height;
};
interface VRService {
SetClient(VRServiceClient client);
GetDisplays() => (array<VRDisplay> displays);
[Sync]
GetPose(uint32 index) => (VRPose? pose);
ResetPose(uint32 index);
RequestPresent(uint32 index, bool secureOrigin) => (bool success);
ExitPresent(uint32 index);
SubmitFrame(uint32 index, VRPose? pose);
UpdateLayerBounds(uint32 index, VRLayerBounds leftBounds, VRLayerBounds rightBounds);
};
interface VRServiceClient {
OnDisplayChanged(VRDisplay display);
OnExitPresent(uint32 index);
OnDisplayConnected(VRDisplay display);
OnDisplayDisconnected(uint32 index);
};