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

Add feature detection for hit test capability #68

Closed
bialpio opened this issue Dec 28, 2019 · 8 comments
Closed

Add feature detection for hit test capability #68

bialpio opened this issue Dec 28, 2019 · 8 comments

Comments

@bialpio
Copy link
Contributor

bialpio commented Dec 28, 2019

The spec draft does not provide any way to check for hit test support on an XR session.

One possible solution is to extend the definition of feature descriptor from the main spec to allow the apps to request a session that supports hit test. Additionally, we should probably extend XRSession as follows:

dictionary XRHitTestState {};

partial interface XRSession {
  readonly attribute XRHitTestState? hitTestState;
};

The hitTestState will be null if the session does not support hit test API or if it was not requested & is therefore unavailable.

In addition, we could specify that immersive-ar sessions must support hit test API so the request for immersive-ar session would always implicitly contain a hit test feature descriptor. immersive-vr sessions could still optionally support it (see #42).

@blairmacintyre
Copy link

I think extending the feature descriptor is the right approach. This will need to happen for other features being discusses (geospatial alignment, real-world geometry, camera access, image tracking, etc).

For any of these, they could be provided in required or optional features, and have the same behavior as the current features.

The hitTestState could be a way to go; we could also expose supportedFeatures and have it map to the combined set of requested required and optional features that the session actually supports. That seems preferable in the long run to scattering the session API with an ever-increasing set of flags.

@bialpio
Copy link
Contributor Author

bialpio commented Jan 6, 2020

The hitTestState could be a way to go; we could also expose supportedFeatures and have it map to the combined set of requested required and optional features that the session actually supports. That seems preferable in the long run to scattering the session API with an ever-increasing set of flags.

I really like this idea, especially sine we already know that there will be more features that will need it. @klausw - what do you think about this in context of DOM overlay?

@klausw
Copy link

klausw commented Jan 7, 2020

I'm in favor of a supportedFeatures exposed list. For DOM Overlay, the current draft spec exposes a DOMOverlayType in its state field which distinguishes "screen" vs "floating", so I'd likely be keeping the state field even if supportedFeatures were added.

@blairmacintyre
Copy link

We should consider if we want "supportedFeatures" to be a truthy set; a feature wouldn't be there if it isn't supported, and "domOverlay" could be have a value of DOMOverlayType if it's there.

@mounirlamouri
Copy link
Contributor

Given that we will add a feature descriptor and that the hit test request will reject if the feature isn't available in the case of an optional feature, would it make sense to close this? If hitTestState feels needed in the future, we could easily add it. If we believe supportedFeatures is required, that might be a better discussion on the core spec? WDYT?

@bialpio
Copy link
Contributor Author

bialpio commented Jan 17, 2020

Sounds good to me. In addition, this is also how XRSession.requestReferenceSpace() currently behaves, so it doesn't seem that we'd be surprising anyone if we took this approach.

@mounirlamouri
Copy link
Contributor

Should this be closed?

@bialpio
Copy link
Contributor Author

bialpio commented Jan 18, 2020

Closing, we can discuss ways to expose the information about supported optional features in the main repo (see the mention above).

@bialpio bialpio closed this as completed Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants