Skip to content

Commit 652fdac

Browse files
committed
Explicitly specify how the views array is populated
1 parent 9f0c5c6 commit 652fdac

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

index.bs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ enum XREnvironmentBlendMode {
389389

390390
Each {{XRSession}} has a <dfn for="XRSession">mode</dfn>, which is one of the values of {{XRSessionMode}}.
391391

392+
The {{XRSession/viewerSpace}} on an {{XRSession}} has a <dfn for="XRSession/viewerSpace">list of views</dfn>, which is a [=/list=] of [=view=]s corresponding to the views provided by the underlying device.
393+
392394
<div class="algorithm" data-algorithm="initialize-session">
393395

394396
To <dfn>initialize the session</dfn>, given |session| and |mode|, the user agent MUST run the following steps:
@@ -687,6 +689,16 @@ When the <dfn method for="XRFrame">getViewerPose(|referenceSpace|)</dfn> method
687689
1. If |frame|'s [=animationFrame=] boolean is <code>false</code>, throw an {{InvalidStateError}} and abort these steps.
688690
1. Let |pose| be a new {{XRViewerPose}} object.
689691
1. [=Populate the pose=] of |session|'s {{XRSession/viewerSpace}} in |referenceSpace| at the time represented by |frame| into |pose|.
692+
1. If |pose| is <code>null</code> return <code>null</code>.
693+
1. Let |xrviews| be an empty [=/list=].
694+
1. For each [=view=] |view| in the [=XRSession/viewerSpace/list of views=] on the {{XRSession/viewerSpace}} of {{XRFrame/session}}, perform the following steps:
695+
1. Let |xrview| be a new {{XRView}} object.
696+
1. Initialize |xrview|'s {{XRView/eye}} to the appropriate eye the |view| is expected to render to. For views that have no such associated eye, this defaults to {{XREye/left}}.
697+
1. Initialize |xrview|'s {{XRView/projectionMatrix}} to a [=matrix=] describing the projection to be used when rendering the [=view=], provided by the underlying XR system.
698+
1. Let |offset| be an {{XRRigidTransform}} equal to the [=view offset=] of |view|
699+
1. Set |xrview|'s {{XRView/transform}} property to the result of [=multiply transforms|multiplying=] the |offset| transform by the {{XRViewerPose}}'s {{XRPose/transform}}
700+
1. [=list/Append=] |xrview| to |xrviews|
701+
1. Set |pose|'ss {{XRViewerPose/views}} to |xrviews|
690702
1. Return |pose|.
691703

692704
</div>
@@ -877,7 +889,11 @@ Views {#views}
877889
XRView {#xrview-interface}
878890
------
879891

880-
An {{XRView}} describes a single <dfn>view</dfn> into an XR scene. Each [=view=] corresponds to a display or portion of a display used by an XR device to present imagery to the user. They are used to retrieve all the information necessary to render content that is well aligned to the [=view=]'s physical output properties, including the field of view, eye offset, and other optical properties. [=Views=] may cover overlapping regions of the user's vision. No guarantee is made about the number of [=views=] any XR device uses or their order, nor is the number of [=views=] required to be constant for the duration of an {{XRSession}}.
892+
An {{XRView}} describes a single <dfn>view</dfn> into an XR scene for a given frame.
893+
894+
Each [=view=] corresponds to a display or portion of a display used by an XR device to present imagery to the user. They are used to retrieve all the information necessary to render content that is well aligned to the [=view=]'s physical output properties, including the field of view, eye offset, and other optical properties. [=Views=] may cover overlapping regions of the user's vision. No guarantee is made about the number of [=views=] any XR device uses or their order, nor is the number of [=views=] required to be constant for the duration of an {{XRSession}}.
895+
896+
A [=view=] has an associated internal <dfn>view offset</dfn>, which is an {{XRRigidTransform}} describing the position and orientation of the [=view=] in the {{XRSession/viewerSpace}}'s [=coordinate system=].
881897

882898
NOTE: Many HMDs will request that content render two [=views=], one for the left eye and one for the right, while most magic window devices will only request one [=view=], but applications should never assume a specific view configuration. For example: A magic window device may request two views if it is capable of stereo output, but may revert to requesting a single view for performance reasons if the stereo output mode is turned off. Similarly, HMDs may request more than two views to facilitate a wide field of view or displays of different pixel density.
883899

0 commit comments

Comments
 (0)