KEMBAR78
Add XRSession.viewerSpace and tidy XRSpace explanations by NellWaliczek · Pull Request #491 · immersive-web/webxr · GitHub
Skip to content

Conversation

@NellWaliczek
Copy link
Member

@NellWaliczek NellWaliczek commented Jan 22, 2019

This PR addresses a few related things I noticed now that the getPose() changes have landed

  1. We were missing a section that focused on the descriptions of XRSpace and XRPose themselves. I added this to spatial-tracking-explainer.md and moved the XRRigidTransform and XRRay types to be together in that document's idl section
  2. Having an XRSpace representing the viewer would be really handy for a few reasons. First, it would allow pose data to be queried relative to the viewer, such as "where are the hands relative to the headset?", without having to do extra matrix math. Second, it's easier to describe the consistent targetRaySpace for 'gaze' based input sources. Third, it becomes one of the XRSpaces from which hit testing can be done (See PR Adding an explainer for real-world hit testing #493).
  3. With both of the above changes in the spatial-tracking-explainer.md, it made sense to move some of the smaller subsections around so content was grouped in a more sensible manner.
  4. Added a check on the results of getPose() in the explainer sample code
  5. While I was at it, this fixes How does the identity reference space relate to any other space? #478 in the explainer, though the actual spec will still need updating.
  6. Fixed a few typos, too.

@toji
Copy link
Member

toji commented Jan 23, 2019

I think the addition of the viewer space is a good, really straightforward addition that will both help with hit testing and also clarify a couple of annoying edge cases. (Such as how one gets the viewer pose in input events. Restricting getViewerPose() entirely is cleaner than the "sometimes you get views, sometimes you don't logic previously.)

If we get a few more people voicing support for this prior to the F2F I'm inclined to merge it, otherwise we'll likely take a straw poll at the F2F and merge it if that comes out favorably.

Copy link
Contributor

@cvan cvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comments for only formatting and conventions.

nice work! 👍

### Relating between XRReferenceSpaces
There are several circumstances in which developers may choose to relate content in different reference spaces.

#### Inline to Immersive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be consistent with the headings elsewhere, Immersive should probably be immersive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to leave this one since it's a concept being referred to. The next section "Unbounded to Bounded" is the same.

## Practical Usage Guidelines

### Inline Sessions
Inline sessions, by definition, do not require a user gesture or user permission to create, and as a result there must be strong limitations on the pose data that can be reported for privacy and security reasons. Requests for `identity` reference spaces will always succeed. Requests for an `XRBoundedReferenceSpace` or an `XRUnboundedReferenceSpace` will always be rejected on inline sessions. Requests for an `XRStationaryReferenceSpace` may succeed, but may also be rejected if the UA is unable provide any tracking information such as for an inline session on a desktop PC or a 2D browser window in a headset. The UA is also allowed to request the users consent prior to returning an `XRStationaryReferenceSpace`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are user gesture and user permission the same?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should inline be backticked or wrapped in quotation marks?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: may succeed, but may also -> may succeed but may also

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

users consent -> user's consent

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are user gesture and user permission the same?

Nope. User gestures are clicks/taps/etc. A user permission is a permission dialog that the user accepted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should inline be backticked or wrapped in quotation marks?

I think in this case it's ok because we're referring to the concept.

During the F2F we realized that this was an inadequate fix.
"Screen" XRInputSources will need getPose with identity reference spaces
@NellWaliczek NellWaliczek merged commit fbab4e2 into master Feb 4, 2019
@toji toji deleted the adding-viewerSpace branch May 2, 2019 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How does the identity reference space relate to any other space?

3 participants