Skip to content
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

Clarify when the reset event gets fired #637

Merged
merged 3 commits into from
May 14, 2019

Conversation

Manishearth
Copy link
Contributor

fixes #561

I'm unsure about the tracking loss example, and I've probably missed some other cases.

r? @NellWaliczek

index.bs Outdated
@@ -1654,7 +1654,7 @@ A user agent MUST dispatch a <dfn event for="XRSession">selectend</dfn> event on

A user agent MUST dispatch a <dfn event for="XRSession">select</dfn> event on an {{XRSession}} when one of its {{XRInputSource}}s has fully completed a [=primary action=]. The event MUST be of type {{XRInputSourceEvent}}.

A user agent MUST dispatch a <dfn event for="XRReferenceSpace">reset</dfn> event on an {{XRReferenceSpace}} when discontinuities of the origin occur. (That is, significant changes in the origin's position or orientation relative to the user's environment.) It also fires when the {{boundsGeometry}} changes for a {{XRBoundedReferenceSpace}}. The event MUST be of type {{XRReferenceSpaceEvent}}, and MUST be dispatched prior to the execution of any [=XR animation frame=]s that make use of the new origin.
A user agent MUST dispatch a <dfn event for="XRReferenceSpace">reset</dfn> event on an {{XRReferenceSpace}} when discontinuities of the [=native origin=] or [=effective origin=] occur, i.e. there are significant changes in the origins position or orientation relative to the users environment. This MUST happen when the {{boundsGeometry}} changes for a {{XRBoundedReferenceSpace}}. This can also happen after the user recalibrates their XR device, or if the XR device automatically shifts its origin after losing and regaining tracking. The event MUST be of type {{XRReferenceSpaceEvent}}, and MUST be dispatched prior to the execution of any [=XR animation frame=]s that make use of the new origin.
Copy link
Member

Choose a reason for hiding this comment

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

Feels a little weird to still have "significant changes" in here when the original issue that prompted this PR highlighted that phrase in particular as under defined. That said, I don't know of a better way of describing it either (I definitely don't think we should be defining exact thresholds here) so if this is just the most sensible wording then so be it. 😉

This can also happen after...

Given the "MUST" in the previous sentence, this feels like it could be stronger. What about something like the following?

This MUST also happen when the origin shifts due to user recalibration
or after losing and regaining tracking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah the goal here is mostly to add examples, and also to mention discontinuities.

I can add more MUSTs, I didn't because I wasn't sure if we required all this to work.

Copy link
Member

@toji toji May 13, 2019

Choose a reason for hiding this comment

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

In those particular cases I this we should require it, but you're right that those are just examples of the larger principle. They also don't apply to every platform.

I think your most recent commit is fine, but if you wanted to more explicitly frame it as an example I think that could be made clearer with a bit of reordering?

A user agent MUST dispatch a <dfn event for="XRReferenceSpace">reset</dfn>
event on an {{XRReferenceSpace}} when discontinuities of the [=native origin=]
or [=effective origin=] occur, i.e. there are significant changes in the origin’s
position or orientation relative to the user’s environment. For example, after
the user recalibrates their XR device or if the XR device automatically shifts its
origin after losing and regaining tracking. This event MUST be fired when the
{{boundsGeometry}} changes for a {{XRBoundedReferenceSpace}}. The event
MUST be of type {{XRReferenceSpaceEvent}}, and MUST be dispatched prior to
the execution of any [=XR animation frame=]s that make use of the new origin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, that's much better.

done, thanks

Copy link
Member

@toji toji left a comment

Choose a reason for hiding this comment

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

LGTM as-is, but I'd like Nell to take a look too.

Copy link
Member

@NellWaliczek NellWaliczek left a comment

Choose a reason for hiding this comment

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

Thanks for taking a stab at this, Manish! Given all the changes happening in #599, I suspect it would make more sense to land this change in the same PR... I tried to mention that, but perhaps wasn't super clear, in #559 (comment)

@@ -1654,7 +1654,7 @@ A user agent MUST dispatch a <dfn event for="XRSession">selectend</dfn> event on

A user agent MUST dispatch a <dfn event for="XRSession">select</dfn> event on an {{XRSession}} when one of its {{XRInputSource}}s has fully completed a [=primary action=]. The event MUST be of type {{XRInputSourceEvent}}.

A user agent MUST dispatch a <dfn event for="XRReferenceSpace">reset</dfn> event on an {{XRReferenceSpace}} when discontinuities of the origin occur. (That is, significant changes in the origin's position or orientation relative to the user's environment.) It also fires when the {{boundsGeometry}} changes for a {{XRBoundedReferenceSpace}}. The event MUST be of type {{XRReferenceSpaceEvent}}, and MUST be dispatched prior to the execution of any [=XR animation frame=]s that make use of the new origin.
A user agent MUST dispatch a <dfn event for="XRReferenceSpace">reset</dfn> event on an {{XRReferenceSpace}} when discontinuities of the [=native origin=] or [=effective origin=] occur, i.e. there are significant changes in the origins position or orientation relative to the users environment. For example, after the user recalibrates their XR device or if the XR device automatically shifts its origin after losing and regaining tracking. This MUST happen when the {{boundsGeometry}} changes for a {{XRBoundedReferenceSpace}}. The event MUST be of type {{XRReferenceSpaceEvent}}, and MUST be dispatched prior to the execution of any [=XR animation frame=]s that make use of the new origin.
Copy link
Member

Choose a reason for hiding this comment

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

or [=effective origin=]

This doesn't seem necessary. Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There have been a couple discussions in other PRs about making the origin offset something that different spaces can choose too (e.g. making the grip space an offsetted target ray space), in that case the UA may try to change the origin offset. I can remove this if you think it's unnecessary.

Copy link
Member

Choose a reason for hiding this comment

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

It's probably fine for now. @thetuvix, when you update the spec to cover tracking loss/recovery, please revisit this text to ensure it's remained accurate.

@Manishearth
Copy link
Contributor Author

I tried to mention that, but perhaps wasn't super clear, in #559 (comment)

Oh, I think I just didn't notice that comment in all the other review traffic that the PR was getting 😄 . @thetuvix can you take the language from here and integrate it? I can open a PR against yours if you want.

@toji
Copy link
Member

toji commented May 13, 2019

@NellWaliczek, if you're OK with the verbiage is there a reason why we wouldn't want to merge this now and let #559 rebase on top of it? (And expand it, if necessary?)

@cwilso cwilso added this to the May 2019 milestone May 13, 2019
@NellWaliczek NellWaliczek merged commit d444069 into immersive-web:master May 14, 2019
@AdaRoseCannon AdaRoseCannon added the ed:spec Include in newsletter, spec change label Jun 17, 2019
@Manishearth Manishearth deleted the reset-clarification branch August 13, 2019 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ed:spec Include in newsletter, spec change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarify "significant changes" for the reset event on XRReferenceSpace
5 participants