Skip to content

Commit

Permalink
Define a notion of internal type
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed May 1, 2019
1 parent 1010984 commit 3bdecdc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.bs
Expand Up @@ -495,7 +495,7 @@ The <dfn attribute for="XRSession">environmentBlendMode</dfn> attribute returns

NOTE: Most Virtual Reality devices exhibit {{XREnvironmentBlendMode/opaque}} blending behavior. Augmented Reality devices that use transparent optical elements frequently exhibit {{XREnvironmentBlendMode/additive}} blending behavior, and Augmented Reality devices that use passthrough cameras frequently exhibit {{XREnvironmentBlendMode/alpha-blend}} blending behavior.

The <dfn attribute for="XRSession">viewerSpace</dfn> attribute is an {{XRSpace}} which tracks the pose of the [=viewer=].
The <dfn attribute for="XRSession">viewerSpace</dfn> attribute is an {{XRSpace}} which tracks the pose of the [=viewer=]. This space has an [=XRSpace/internal type=] of [=XRSpace/viewer space=].

NOTE: For any given {{XRFrame}} calling {{XRFrame/getPose()}} with the {{XRSession/viewerSpace}} and any {{XRReferenceSpace}} will return the same pose (without the {{views}} array) as calling {{XRFrame/getViewerPose()}} with the same {{XRReferenceSpace}}.

Expand Down Expand Up @@ -736,6 +736,8 @@ Each {{XRSpace}} has a <dfn for="XRSpace">native origin</dfn> that is tracked by

The [=effective origin=] of an {{XRSpace}} can only be observed in the coordinate system of another {{XRSpace}} as an {{XRPose}}, returned by an {{XRFrame}}'s {{XRFrame/getPose()}} method. The spatial relationship between {{XRSpace}}s MAY change between {{XRFrame}}s.

Each {{XRSpace}} has an <dfn for="XRSpace">internal type</dfn>, used to internally distinguish the various kinds of spaces. This value can be <dfn for="XRSpace">viewer space</dfn>, <dfn for="XRSpace">input target ray</dfn>, <dfn for="XRSpace">input grip</dfn>, or one of the variants of {{XRReferenceSpaceType}}.

<div class="algorithm" data-algorithm="populate-the-pose">

To <dfn>populate the pose</dfn> of a {{XRSpace}} |sourceSpace| in an {{XRSpace}} |destinationSpace| at the time represented by a {{XRFrame}} |frame| into an {{XRPose}} |pose|, the user agent MUST run the following steps:
Expand Down Expand Up @@ -776,7 +778,7 @@ interface XRReferenceSpace : XRSpace {
};
</pre>

Each {{XRReferenceSpace}} has a <dfn for="XRReferenceSpace">type</dfn>, which is an {{XRReferenceSpaceType}}.
The [=XRSpace/internal type=] of an {{XRReferenceSpace}} is one of the variants of {{XRReferenceSpaceType}}, chosen during construction..

An {{XRReferenceSpace}} is most frequently obtained by calling {{XRSession/requestReferenceSpace()}}, which creates an instance of an {{XRReferenceSpace}} or an interface extending it, determined by the {{XRReferenceSpaceType}} enum value passed into the call. The type indicates the tracking behavior that the reference space will exhibit:

Expand Down Expand Up @@ -806,7 +808,7 @@ When an {{XRReferenceSpace}} is requested, the user agent MUST <dfn>create a ref
1. Let |type| be set to the {{XRReferenceSpaceType}} passed to {{requestReferenceSpace()}}.
1. If |type| is {{bounded}}, let |referenceSpace| be a new {{XRBoundedReferenceSpace}}.
1. Else let |referenceSpace| be a new {{XRReferenceSpace}}.
1. Initialize |referenceSpace|'s [=XRReferenceSpace/type=] to be |type|.
1. Initialize |referenceSpace|'s [=XRSpace/internal type=] to be |type|.
1. Initialize [=XRSpace/session=] to be |session|.
1. Return |referenceSpace|.

Expand Down Expand Up @@ -1157,9 +1159,9 @@ The <dfn attribute for="XRInputSource">targetRayMode</dfn> attribute describes t

Note: Some input sources, like an {{XRInputSource}} with {{targetRayMode}} set to {{screen}}, will only be added to the session's [=list of active input sources=] immediately before the {{selectstart}} event, and removed from the session's [=list of active input sources=] immediately after the {{selectend}} event.

The <dfn attribute for="XRInputSource">targetRaySpace</dfn> attribute is an {{XRSpace}} that tracks the pose of the preferred pointing ray of the {{XRInputSource}}, as defined by the {{targetRayMode}}.
The <dfn attribute for="XRInputSource">targetRaySpace</dfn> attribute is an {{XRSpace}} that tracks the pose of the preferred pointing ray of the {{XRInputSource}}, as defined by the {{targetRayMode}}. Its [=XRSpace/internal type=] is [=XRSpace/input target ray=].

The <dfn attribute for="XRInputSource">gripSpace</dfn> attribute is an {{XRSpace}} that tracks the pose that should be used to render virtual objects such that they appear to be held in the user's hand. If the user were to hold a straight rod, this {{XRSpace}} places the origin at the centroid of their curled fingers and where the <code>-Z</code> axis points along the length of the rod towards their thumb. The <code>X</code> axis is perpendicular to the back of the hand being described, with back of the users right hand pointing towards <code>+X</code> and the back of the user's left hand pointing towards <code>-X</code>. The <code>Y</code> axis is implied by the relationship between the <code>X</code> and <code>Z</code> axis, with <code>+Y</code> roughly pointing in the direction of the user's arm.
The <dfn attribute for="XRInputSource">gripSpace</dfn> attribute is an {{XRSpace}} that tracks the pose that should be used to render virtual objects such that they appear to be held in the user's hand. Its [=XRSpace/internal type=] is [=XRSpace/input grip=]. If the user were to hold a straight rod, this {{XRSpace}} places the origin at the centroid of their curled fingers and where the <code>-Z</code> axis points along the length of the rod towards their thumb. The <code>X</code> axis is perpendicular to the back of the hand being described, with back of the users right hand pointing towards <code>+X</code> and the back of the user's left hand pointing towards <code>-X</code>. The <code>Y</code> axis is implied by the relationship between the <code>X</code> and <code>Z</code> axis, with <code>+Y</code> roughly pointing in the direction of the user's arm.

The {{gripSpace}} MUST be <code>null</code> if the input source isn't inherently trackable such as for input sources with a {{targetRayMode}} of {{XRTargetRayMode/gaze}} or {{XRTargetRayMode/screen}}.

Expand Down

0 comments on commit 3bdecdc

Please sign in to comment.