blob: 1ef3d9e3f5dcf68b692ca11c51a860713ed0a005 [file] [log] [blame]
// 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;
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 {
enum CompositorType {
uint32 index;
string displayName;
CompositorType compositorType;
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);
GetPose(uint32 index) => (VRPose? pose);
ResetPose(uint32 index);
RequestPresent(uint32 index) => (bool success);
ExitPresent(uint32 index);
SubmitFrame(uint32 index, VRPose pose);
UpdateLayerBounds(uint32 index, VRLayerBounds leftBounds, VRLayerBounds rightBounds);
enum VRDisplayEventReason {
NONE = 0,
interface VRServiceClient {
OnDisplayChanged(VRDisplay display);
OnDisplayConnect(VRDisplay display);
OnDisplayDisconnect(uint32 index);
OnDisplayActivate(VRDisplay display, VRDisplayEventReason reason);
OnDisplayDeactivate(VRDisplay display, VRDisplayEventReason reason);
OnDisplayBlur(VRDisplay display);
OnDisplayFocus(VRDisplay display);
OnExitPresent(uint32 index);