Skip to content

Commit

Permalink
Update spec for new eye params interface
Browse files Browse the repository at this point in the history
  • Loading branch information
vvuk committed Feb 11, 2015
1 parent ae26908 commit b5c0863
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 83 deletions.
40 changes: 20 additions & 20 deletions webvr.bs
Original file line number Diff line number Diff line change
Expand Up @@ -117,32 +117,32 @@ interface VRDevice {
The {{HMDVRDevice}} interface represents a {{VRDevice}} for a head-mounted display. It contains configuration and information about the HMD.

<pre class="idl">
interface HMDVRDevice : VRDevice {
/* The translation that should be applied to the view matrix for rendering each eye */
DOMPoint getEyeTranslation(VREye whichEye);

// the FOV that the HMD was configured with
VRFieldOfView getCurrentEyeFieldOfView(VREye whichEye);

// the recommended FOV, per eye.
VRFieldOfView getRecommendedEyeFieldOfView(VREye whichEye);
interface EyeParameters {
/* These values are expected to be static per-device/per-user */
readonly attribute VRFieldOfView minimumFieldOfView;
readonly attribute VRFieldOfView maximumFieldOfView;
readonly attribute VRFieldOfView recommendedFieldOfView;
readonly attribute DOMPoint eyeTranslation;

/* These values will vary after a FOV has been set */
readonly attribute VRFieldOfView currentFieldOfView;
readonly attribute DOMRect renderRect;
};

// the maximum FOV, per eye. Above this, rendering will look broken.
VRFieldOfView getMaximumEyeFieldOfView(VREye whichEye);
interface HMDVRDevice : VRDevice {
/* Return the parameters for the given eye */
EyeParameters getEyeParameters(VREye whichEye);

// Set a field of view. If either of the fields of view is null,
// or if their values are all zeros, then the recommended field of view
// for that eye will be used.
/* Set a field of view for both eyes. If either of the fields of view is null,
* or if their values are all zeros, then the recommended field of view
* for that eye will be used.
*
* zNear and zFar configure the depth range for CSS-based rendering.
*/
void setFieldOfView(optional VRFieldOfViewInit leftFOV,
optional VRFieldOfViewInit rightFOV,
optional double zNear = 0.01,
optional double zFar = 10000.0);

// return a recommended rect for this eye. Only useful for Canvas rendering,
// the x/y coordinates will be the location in the canvas where this eye should
// begin, and the width/height are the dimensions. Any canvas in the appropriate
// ratio will work.
DOMRect getRecommendedEyeRenderRect(VREye whichEye);
};
</pre>

Expand Down
Loading

0 comments on commit b5c0863

Please sign in to comment.