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
Currently, there is no way to detect if anchors feature has been enabled for the session.
Some other APIs provide some way to detect a feature, e.g. plane-detection throws an exception when trying to access detectedPlanes property, which I've argued is not a good API design here: immersive-web/real-world-geometry#30
Regardless of anchors feature been enabled or not on the session, XRFrame has a property trackedAnchors that always returns a Set-like object.
For consistency across APIs, it would be best to not return Set, but either throw an exception as in plane-detection, or better to be null if the feature is not available on the session.
That way, the developer has a graceful way to detect if anchors feature is enabled or not.
The text was updated successfully, but these errors were encountered:
Currently, there is no way to detect if anchors feature has been enabled for the session.
This was discussed in immersive-web/webxr#952 - the spec describes a way to query the features that have been enabled on a session through Permissions API. Unfortunately, I don't think this is currently implemented in Chrome. ☹️ With that said, I wouldn't mind adding additional XRSession property that would contain features enabled for a session, but that would mean we have 2 ways of achieving the same thing, so I doubt it will end up happening.
At this point, changing how trackedAnchors behave would be a breaking change so I'd be very hesitant to adjust this, but I agree that detectedPlanes should behave consistently with them, thanks for catching this mismatch!
Currently, there is no way to detect if
anchors
feature has been enabled for the session.Some other APIs provide some way to detect a feature, e.g.
plane-detection
throws an exception when trying to accessdetectedPlanes
property, which I've argued is not a good API design here: immersive-web/real-world-geometry#30Regardless of
anchors
feature been enabled or not on the session,XRFrame
has a propertytrackedAnchors
that always returns a Set-like object.For consistency across APIs, it would be best to not return Set, but either throw an exception as in
plane-detection
, or better to benull
if the feature is not available on the session.That way, the developer has a graceful way to detect if
anchors
feature is enabled or not.The text was updated successfully, but these errors were encountered: