Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement hit testing API #26171
Implement hit testing API #26171
Conversation
highfive
commented
Apr 11, 2020
|
Heads up! This PR modifies the following files:
|
highfive
commented
Apr 11, 2020
|
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 |
|
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)) |
This comment has been minimized.
This comment has been minimized.
asajeffrey
Apr 15, 2020
Member
Ouch, creating a new hit test result for each hit test, every frame? This might be putting strain on the GC?
This comment has been minimized.
This comment has been minimized.
Manishearth
Apr 15, 2020
Author
Member
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())) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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 |
|
Ah, our webxr tests need to be updated for supportedModes |
|
@bors-servo r=asajeffrey |
|
|
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
|
|
|
@bors-servo retry |
|
|
Manishearth commentedApr 11, 2020
•
edited
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