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

XrAnchors - Availability flag #5879

Merged
merged 2 commits into from
Dec 5, 2023
Merged

Conversation

Maksims
Copy link
Collaborator

@Maksims Maksims commented Dec 5, 2023

For the consistency across the API and avoiding slight edge cases that can be present between different WebXR Specs implementations by vendors, this PR introduces available flag like on other WebXR APIs, that if false will not try to update underlying anchors data and other functions will not be available.

This also fixes #5843 although should mention that Emulator is misbehaving because of incorrect specs implementation (polyfill). But this PR overcomes that nevertheless.

New APIs:

// pc.XrAnchors
anchors.available // true of false depending on availability of the API and if session was started with Anchors feature requested
anchors.on('available', () => { }); // when session starts, if anchors are supported and were requested for the session, this will trigger
anchors.on('unavailable', () => { }); // if anchors were available and session ended, this will trigger

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@mvaligursky mvaligursky added the area: xr XR related issue label Dec 5, 2023
@mvaligursky mvaligursky merged commit 21bfe7f into playcanvas:main Dec 5, 2023
7 checks passed
@Maksims Maksims deleted the webxr-anchors-fix branch January 22, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: xr XR related issue
Projects
None yet
2 participants