-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Implement hit testing API #26171
Implement hit testing API #26171
Conversation
Heads up! This PR modifies the following files:
|
Opened new PR for upstreamable changes. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#22868. |
I haven't gone through all the tests but the reason we fail the refSpace one, for example, is both because of immersive-web/hit-test#86 and because of another bug in the test where it's assuming hit test results get duplicated |
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#22868. |
No upstreamable changes; closed existing PR. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#22868. |
Rebased over test updates that I landed upstream early. |
r? @asajeffrey |
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.
Mostly LGTM, we're generating a lot of objects per frame, but hey ho.
One thing I don't understand is how to do hit tests relative to a moving refererence, e.g. from the users's hands or eyes? Does this require generating a new ray each frame?
.hit_test_results | ||
.iter() | ||
.filter(|r| r.id == source.id()) | ||
.map(|r| XRHitTestResult::new(&self.global(), *r, self)) |
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.
Ouch, creating a new hit test result for each hit test, every frame? This might be putting strain on the GC?
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 don't see any other way to do it? Note that it's possible for a single hit test to have multiple results.
fn GetPose(&self, base: &XRSpace) -> Option<DomRoot<XRPose>> { | ||
let base = self.frame.get_pose(base)?; | ||
let pose = base.inverse().pre_transform(&self.result.space); | ||
Some(XRPose::new(&self.global(), pose.cast_unit())) |
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.
Ditto, creating a new XRPose
object every frame?
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.
We already do this with getPose in views
Needs a
|
Strangely I do not get that error locally |
That patch is also already applied here and on github. I suspect tc is doing something weird. (tc won't pass anyway until servo/webxr#149 lands) |
|
Implement support for hit testing, use in mock backend Servo side: servo/servo#26171 This adds support for all non-transient parts of he [WebXR Hit Test Module](https://immersive-web.github.io/hit-test), including mocking support. This has not yet been hooked up to script and is thus completely untested. r? @jdm
@bors-servo try |
Implements changes from immersive-web/hit-test#85
Ah, our webxr tests need to be updated for supportedModes |
@bors-servo r=asajeffrey |
📌 Commit 2a57966 has been approved by |
Implement hit testing API Depends on servo/webxr#149 , #26170 This implements non-transient hit tests. The tests that do not pass are due to web-platform-tests/wpt#22898 , web-platform-tests/wpt#22900, web-platform-tests/wpt#22901 , and immersive-web/hit-test#86
💔 Test failed - status-taskcluster |
@bors-servo retry |
☀️ Test successful - status-taskcluster |
Depends on servo/webxr#149 , #26170
This implements non-transient hit tests.
The tests that do not pass are due to web-platform-tests/wpt#22898 , web-platform-tests/wpt#22900, web-platform-tests/wpt#22901 , and immersive-web/hit-test#86