-
Notifications
You must be signed in to change notification settings - Fork 401
Consolidate reference space types and interfaces #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
index.bs
Outdated
An {{XRReferenceSpace}} is obtained by calling {{XRSession/requestReferenceSpace()}}, which creates an instance of an interface extending {{XRReferenceSpace}}, determined by the {{XRReferenceSpaceOptions/type}} value of the {{XRReferenceSpaceOptions}} dictionary passed into the call: | ||
An {{XRReferenceSpace}} is obtained by calling {{XRSession/requestReferenceSpace()}}, which creates an instance of an {{XRReferenceSpace}} or an interface extending it, determined by the {{XRReferenceSpaceOptions/type}} value of the {{XRReferenceSpaceOptions}} dictionary passed into the call. The {{XRReferenceSpaceOptions/type}} indicates the tracking behavior that the reference space will exhibit: | ||
|
||
- Passing a {{XRReferenceSpaceOptions/type}} of <dfn enum-value for="XRReferenceSpaceType">identity</dfn> creates an {{XRReferenceSpace}} instance. It represents a reference space without any tracking behavior. The {{XRPose/transform}} of any {{XRPose}} queried from an {{identity}} reference space MUST be an [=identity transform=] offset by the {{originOffset}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the discussion in #565 this characterization seems inaccurate? The pose queried changes based on the base space used, a more accurate characterization is that "getViewerPose" should always return the identity transform (potentially offset with originOffset).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworked this text, though I think it's going to need to be updated again when we land some of the planed changes re: describing these spaces in terms of the native origin as you've started looking at.
e6159ee
to
7a51b4e
Compare
a3341f2
to
6714aa2
Compare
7a51b4e
to
e8828d1
Compare
e8828d1
to
8c0b47e
Compare
Combined this PR with another one that I had in progress to consolidate the reference space type and subtype enums because @NellWaliczek and I both think these changes make the most sense when taken together. As a result this PR now fully fixes #514 and fixes #542. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on board with this approach. A few minor nits to fix and then I'll sign off!
index.bs
Outdated
|
||
- Passing a {{XRReferenceSpaceOptions/type}} of <dfn enum-value for="XRReferenceSpaceType">unbounded</dfn> creates an {{XRUnboundedReferenceSpace}} instance if supported by the [=/XR device=] and the {{XRSession}}. | ||
- Passing a type of <dfn enum-value for="XRReferenceSpaceType">eye-level</dfn> creates an {{XRReferenceSpace}} instance. It represents a tracking space with it's origin near the user's head at the time of creation. The exact position and orientation will be initialized based on the conventions of the underlying platform. When using this reference space the user is not expected to move beyond their initial position much, if at all, and tracking is optimized for that purpose. For devices with [=6DoF=] tracking, {{eye-level}} reference spaces should emphasize keeping the origin stable relative to the user's environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exact position and orientation will be initialized based on the conventions of the underlying platform.
Should we change this to say that the originOffset should be set such that the behavior is always the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually raises a good question about our understanding of the native origin: I guess I had been viewing it as the "base" origin for a reference space, regardless of if the UA had to apply some internal tweaks to get it there. This comment suggests you see the native origin as a function of the underlying XR backend and completely out of the UAs control, with origin offsets being applied in any case where the desired reference space does not already happen to match the platform-provided one. I'm fine with that interpretation, though if that's the case we should not land this PR until after #612 lands and removes the originOffset
attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been viewing it the same way (and in fact Nell's comment didn't initially make sense to me since I wasn't sure what the behavior was supposed to be the same to).
Her interpretation makes sense too, though it surprises me a bit.
I guess I'm unclear on when such a situation can occur.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it really strongly matters either way, but the term "native" origin implies to me that it's the origin as defined by the underlying tracking system...
1001365
to
ff5a111
Compare
Made a few tweaks in response to Nell's comments, but had an open question about the native origin/origin offset thing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that all my remaining comments would more appropriately be addressed in the next milestone when we fix #597, i'm good to merge as is.
@@ -766,21 +766,21 @@ Each {{XRReferenceSpace}} has a <dfn for="XRReferenceSpace">type</dfn>, which is | |||
|
|||
An {{XRReferenceSpace}} is 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: | |||
|
|||
- Passing a type of <dfn enum-value for="XRReferenceSpaceType">identity</dfn> creates an {{XRReferenceSpace}} instance. It represents a reference space where the [=viewer=] is always at the origin (prior to applying the {{originOffset}}). Only the {{XRSession/viewerSpace}} and {{XRInputSource/targetRaySpace}}'s of {{XRInputSource}}'s with an {{XRInputSource/targetRayMode}} of {{XRTargetRayMode/screen}} can be spatially related to an {{identity}} reference space. | |||
- Passing a type of <dfn enum-value for="XRReferenceSpaceType">identity</dfn> creates an {{XRReferenceSpace}} instance. It represents a reference space where the [=viewer=] is always at the [=native origin=]. Only the {{XRSession/viewerSpace}} and {{XRInputSource/targetRaySpace}}'s of {{XRInputSource}}'s with an {{XRInputSource/targetRayMode}} of {{XRTargetRayMode/screen}} can be spatially related to an {{identity}} reference space. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It represents a reference space where the [=viewer=] is always at the [=native origin=]
And that the [=native origin=] is a constant.. or doesn't vary.. or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that matter, in this case, if it can't relate to anything else?
- Passing a type of <dfn enum-value for="XRReferenceSpaceType">unbounded</dfn> creates an {{XRReferenceSpace}} instance if supported by the [=/XR device=] and the {{XRSession}}. It represents a tracking space where the user is expected to move freely around their environment, potentially even long distances from their starting point. Tracking in an {{unbounded}} reference space is optimized for stability around the user's current position, and as such the tracking origin may drift over time. | ||
- Passing a type of <dfn enum-value for="XRReferenceSpaceType">unbounded</dfn> creates an {{XRReferenceSpace}} instance if supported by the [=/XR device=] and the {{XRSession}}. It represents a tracking space where the user is expected to move freely around their environment, potentially even long distances from their starting point. Tracking in an {{unbounded}} reference space is optimized for stability around the user's current position, and as such the [=native origin=] may drift over time. | ||
|
||
Devices that support any of the following {{XRReferenceSpaceType}}s MUST support all three: {{XRReferenceSpaceType/position-disabled}}, {{XRReferenceSpaceType/eye-level}}, {{XRReferenceSpaceType/floor-level}}. The minimum sensor data necessary for supporting all three reference spaces is the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minimum sensor data necessary for supporting all three reference spaces is the same.
Not necessarily the case for the floor-level type, yes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "minimum" is doing a lot of lifting in that sentence. You can get an emulated floor-level with nothing but orientation data and a static offset.
Btw, I've rebased this over #612 in https://github.com/Manishearth/webxr/tree/consolidate, feel free to use. (I need this to start working on https://github.com/immersive-web/editor-collab/pull/38 ) |
Apologies, @Manishearth. I actually merged this in the opposite order (resolving the conflicts along the way.) Hopefully you can rebase your change onto the new master without much trouble? |
Oh, that's fine, I hadn't made any major changes yet :) |
Since #574 leaves XRStationaryReferenceSpace with nothing else in it, taking the opportunity to consolidate it and XRUnboundedReferenceSpace into XRReferenceSpace, as was discussed in #514.
Originally was part of #574 but separated the consolidation out at Nell's request.