You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make it so that the document visibility check can suppress poses without throwing an exception. Exceptions are for cases where the user's code is incorrect, not when stuff unpredictably changed from underneath the user. (partially addresses Reporting pose data depends on the state of the document? #1041)
Some spec language cleanups around reference space creation
For users, the main change here is that requestReferenceSpace() might have some delay involved in resolving the promise, but on the plus side getViewerPose() will never be null.
In the call today there seemed to be general consensus around allowing getPose() to be null for arbitrary spaces.
It was pointed out that for handheld input controllers we may wish to encourage them to never return null when the input source is active and instead trigger oninputsourceschange events. (Worth noting, you can still hold on to a reference to an old input source's space, and that should definitely return null in getPose()). I could potentially add language to that effect somewhere, though I'd rather wait for @toji to get in an initial review.
The point about getViewerPose() did not get discussed as much, however this PR fixes the main issues that caused contention in #674, so it feels like that change is fine.
Hmm, you're right. However, I think neither I nor @toji had a strong opinion on that, and my opinion has shifted towards Alex's original one of "getViewerPose() should never be null" now that getPose() is much more free to be null. The reason I felt that getViewerPose() should be allowed to be null was really that I felt that "populate a pose" should be null in more situations so that getPose() can be null.
Sorry it's taken me a while to comment on this. Wanted to hear the call discussion and then come back. I'm OK with everything here with the exception of blocking requestReferenceSpace() resolves so that getViewerPose() is never null. (That said, I do like the forced emulation bit once tracking have been established.)
My biggest concern is that a very common pattern in many apps is to wait for a reference space before spinning up the rAF loop, but in many cases the device will have already switched over to presenting the session's content as soon as the session is created. If there's a need for some action on the user's part to help establish tracking (as is commonly the case for mobile AR, where you want to wiggle your phone around) then having that rAF loop available as a point to ping the tracking state is useful, as well as offering a logical place to draw any helper dialogs with a more reliable (viewer?) space.
Oh, that's a fair point. I'll remove those changes and fix up the rest of the PR. You should leave a comment to that effect on the other issue, and perhaps we should reagenda it.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This contains changes to:
Force emulation in(Should requestReferenceSpace() wait until getViewerPose() won't be null? #674)getViewerPose()
, making it not possible to return null poses, and delayrequestReferenceSpace()
until tracking has been established.For users, the main change here is that
requestReferenceSpace()
might have some delay involved in resolving the promise, but on the plus sidegetViewerPose()
will never be null.Preview | Diff