Skip to content

Commit 403f2e5

Browse files
authored
Merge pull request #1058 from Manishearth/pose-null
Various changes around null and emulated poses
2 parents a3b9ce4 + 6758a5b commit 403f2e5

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

index.bs

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,11 @@ When this method is invoked, the user agent MUST run the following steps:
713713

714714
1. Let |promise| be [=a new Promise=] in the [=relevant realm=] of this {{XRSession}}.
715715
1. Run the following steps [=in parallel=]:
716-
1. [=Create a reference space=], |referenceSpace|, with the {{XRReferenceSpaceType}} |type|.
717-
1. If |referenceSpace| is <code>null</code>, [=queue a task=] to [=reject=] |promise| with a {{NotSupportedError}} and abort these steps.
718-
1. [=Queue a task=] to [=/resolve=] |promise| with |referenceSpace|.
716+
1. If the result of running [=reference space is supported=] for |type| and |session| is <code>false</code>, [=queue a task=] to [=reject=] |promise| with a {{NotSupportedError}} and abort these steps.
717+
1. Set up any platform resources required to track reference spaces of type |type|.
718+
1. [=Queue a task=] to run the following steps:
719+
1. [=Create a reference space=], |referenceSpace|, with |type| and |session|.
720+
1. [=/Resolve=] |promise| with |referenceSpace|.
719721
1. Return |promise|.
720722

721723
</div>
@@ -760,6 +762,8 @@ When any previously added <dfn for="XRSession" lt="remove input source">[=XR inp
760762
1. [=list/Remove=] each {{XRInputSource}} in |removed| from |session|'s [=list of active XR input sources=].
761763
1. Fire an {{XRInputSourcesChangeEvent}} named {{inputsourceschange!!event}} on |session| with {{XRInputSourcesChangeEvent/removed}} set to |removed|.
762764

765+
Note: The user agent MAY fire this event when an input source temporarily loses both position and orientation tracking. It is recommended that this only be done for physical handheld controller input sources. It is not recommended that this event be fired when this happens for tracked hand input sources, because this will happen often, nor is it recommended when this happens for tracker object input sources, since this makes it harder for the application to maintain a notion of identity.
766+
763767
</div>
764768

765769
<div class="algorithm" data-algorithm="on-input-source-change">
@@ -1032,7 +1036,7 @@ When this method is invoked, the user agent MUST run the following steps:
10321036
1. Let |session| be |frame|'s {{XRFrame/session}} object.
10331037
1. If |frame|'s [=animationFrame=] boolean is <code>false</code>, throw an {{InvalidStateError}} and abort these steps.
10341038
1. Let |pose| be a [=new=] {{XRViewerPose}} object in the [=relevant realm=] of |session|.
1035-
1. [=Populate the pose=] of |session|'s [=XRSession/viewer reference space=] in |referenceSpace| at the time represented by |frame| into |pose|.
1039+
1. [=Populate the pose=] of |session|'s [=XRSession/viewer reference space=] in |referenceSpace| at the time represented by |frame| into |pose|, with <code>force emulation</code> set to <code>true</code>.
10361040
1. If |pose| is <code>null</code> return <code>null</code>.
10371041
1. Let |xrviews| be an empty [=/list=].
10381042
1. For each [=view=] |view| in the [=XRSession/viewer reference space/list of views=] on the[=XRSession/viewer reference space=] of {{XRFrame/session}}, perform the following steps:
@@ -1100,7 +1104,7 @@ The [=effective origin=] of an {{XRSpace}} can only be observed in the coordinat
11001104

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

1103-
To <dfn>populate the pose</dfn> of an {{XRSpace}} |space| in an {{XRSpace}} |baseSpace| at the time represented by an {{XRFrame}} |frame| into an {{XRPose}} |pose|, the user agent MUST run the following steps:
1107+
To <dfn>populate the pose</dfn> of an {{XRSpace}} |space| in an {{XRSpace}} |baseSpace| at the time represented by an {{XRFrame}} |frame| into an {{XRPose}} |pose|, with an optional |force emulation| flag, the user agent MUST run the following steps:
11041108

11051109
1. If |frame|'s [=active=] boolean is <code>false</code>, throw an {{InvalidStateError}} and abort these steps.
11061110
1. Let |session| be |frame|'s {{XRFrame/session}} object.
@@ -1121,12 +1125,12 @@ To <dfn>populate the pose</dfn> of an {{XRSpace}} |space| in an {{XRSpace}} |bas
11211125
<dd> Set |transform|'s {{XRRigidTransform/position}} to the tracking system's best estimate of the position of |space|'s [=effective origin=] in |baseSpace|'s [=coordinate system=]. This MAY include a computed offset such as a neck or arm model. If a position estimate is not available, the last known position MUST be used.
11221126
<dd> Set |pose|'s {{XRPose/emulatedPosition}} to <code>true</code>.
11231127

1124-
<dt> Else if |space|'s pose relative to |baseSpace| has been determined in the past:
1128+
<dt> Else if |space|'s pose relative to |baseSpace| has been determined in the past and |force emulation| is <code>true</code>:
11251129
<dd> Set |transform|'s {{XRRigidTransform/position}} to the last known position of |space|'s [=effective origin=] in |baseSpace|'s [=coordinate system=].
11261130
<dd> Set |transform|'s {{XRRigidTransform/orientation}} to the last known orientation of |space|'s [=effective origin=] in |baseSpace|'s [=coordinate system=].
11271131
<dd> Set |pose|'s {{XRPose/emulatedPosition}} boolean to <code>true</code>.
11281132

1129-
<dt> Else if |space|'s pose relative to |baseSpace| has never been determined:
1133+
<dt> Otherwise:
11301134
<dd> Set |pose| to <code>null</code>.
11311135
</dl>
11321136

@@ -1180,22 +1184,18 @@ The <dfn attribute for="XRReferenceSpace">onreset</dfn> attribute is an [=Event
11801184

11811185
<div class="algorithm" data-algorithm="create-reference-space">
11821186

1183-
When an {{XRReferenceSpace}} is requested, the user agent MUST <dfn>create a reference space</dfn> by running the following steps:
1187+
When an {{XRReferenceSpace}} is requested with {{XRReferenceSpaceType}} |type| for {{XRSession}} |session|, the user agent MUST <dfn>create a reference space</dfn> by running the following steps:
11841188

1185-
1. Let |session| be the {{XRSession}} object that requested creation of a reference space.
1186-
1. Let |type| be set to the {{XRReferenceSpaceType}} passed to {{requestReferenceSpace()}}.
1187-
1. If the [=reference space is supported=] for |type| and |session|, run the following steps:
1188-
1. Initialize |referenceSpace| as follows:
1189-
<dl class="switch">
1190-
<dt> If |type| is {{bounded-floor}}
1191-
<dd> Let |referenceSpace| be a [=new=] {{XRBoundedReferenceSpace}} in the [=relevant realm=] of |session|.
1192-
<dt> Otherwise
1193-
<dd> Let |referenceSpace| be a [=new=] {{XRReferenceSpace}} in the [=relevant realm=] of |session|.
1194-
</dl>
1195-
1. Initialize |referenceSpace|'s [=XRReferenceSpace/type=] to |type|.
1196-
1. Initialize |referenceSpace|'s [=XRSpace/session=] to |session|.
1197-
1. Return |referenceSpace|
1198-
1. Return <code>null</code>.
1189+
1. Initialize |referenceSpace| as follows:
1190+
<dl class="switch">
1191+
<dt> If |type| is {{bounded-floor}}
1192+
<dd> Let |referenceSpace| be a [=new=] {{XRBoundedReferenceSpace}} in the [=relevant realm=] of |session|.
1193+
<dt> Otherwise
1194+
<dd> Let |referenceSpace| be a [=new=] {{XRReferenceSpace}} in the [=relevant realm=] of |session|.
1195+
</dl>
1196+
1. Initialize |referenceSpace|'s [=XRReferenceSpace/type=] to |type|.
1197+
1. Initialize |referenceSpace|'s [=XRSpace/session=] to |session|.
1198+
1. Return |referenceSpace|.
11991199

12001200
</div>
12011201

@@ -2300,8 +2300,7 @@ When based on sensor data, {{XRPose}} and {{XRViewerPose}} will expose [=sensiti
23002300

23012301
To determine if <dfn>poses may be reported</dfn> to an {{XRSession}} |session|, the user agent MUST run the following steps:
23022302

2303-
1. Let |document| be |session|'s [=relevant global object=]'s [=associated document=].
2304-
1. If |document| is [=hidden=] return <code>false</code>.
2303+
1. If |session|'s [=relevant global object=] is not the [=current global object=], return <code>false</code>.
23052304
1. If |session|'s {{XRSession/visibilityState}} in not {{XRVisibilityState/"visible"}}, return <code>false</code>.
23062305
1. Determine if the pose data can be returned as follows:
23072306
<dl class="switch">
@@ -2315,12 +2314,11 @@ To determine if <dfn>poses may be reported</dfn> to an {{XRSession}} |session|,
23152314
<dd> Return <code>false</code>.
23162315
</dl>
23172316

2318-
</div>
2319-
2320-
Note: The requirement for document visibility is based on [[DEVICE-ORIENTATION]].
23212317

23222318
Note: The method by which a user agent determines that poses do not expose fingerprintable data is left to the user agent's discretion.
23232319

2320+
</div>
2321+
23242322
The primary difference between {{XRViewerPose}} and {{XRPose}} is the inclusion of {{XRView}} information. When more than one view is present and the physical relationship between these views is configurable by the user, the relationship between these views is considered [=sensitive information=] as it can be used to fingerprint or profile the user.
23252323

23262324
If the relationship between {{XRView}}s could uniquely identify the [=/XR device=], then the user agent MUST anonymize the {{XRView}} data to prevent fingerprinting. The method of anonymization is at the discretion of the user agent.
@@ -2350,10 +2348,14 @@ To determine if <dfn>poses must be limited</dfn> between two spaces, |space| and
23502348

23512349
1. If either |space| or |baseSpace| are an {{XRBoundedReferenceSpace}} and the other space's [=native origin=]'s falls further outside the [=native bounds geometry=] than a reasonable distance determined by the user agent, return true.
23522350
1. If either |space| or |baseSpace| are an {{XRReferenceSpace}} with a [=XRReferenceSpace/type=] of {{XRReferenceSpaceType/"local"}} or {{XRReferenceSpaceType/"local-floor"}} and the distance between the spaces' [=native origin=]'s is greater than a reasonable distance determined by the user agent, return <code>true</code>.
2353-
1. Return false.
2351+
1. Let |document| be |space|'s [=relevant global object=]'s [=associated document=].
2352+
1. If |document| is [=hidden=] return <code>true</code>.
2353+
1. Return <code>false</code>.
23542354

23552355
</div>
23562356

2357+
Note: The requirement for document visibility is based on [[DEVICE-ORIENTATION]].
2358+
23572359
Note: Is is suggested that poses reported relative to a {{XRReferenceSpaceType/"local"}} or {{XRReferenceSpaceType/"local-floor"}} reference space be [=limiting|limited=] to a distance of 15 meters from the {{XRReferenceSpace}}'s [=native origin=].
23582360

23592361
Note: Is is suggested that poses reported relative to a {{XRBoundedReferenceSpace}} be [=limiting|limited=] to a distance of 1 meter outside the {{XRBoundedReferenceSpace}}'s [=native bounds geometry=].

0 commit comments

Comments
 (0)