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

WebXR fix Hit Test providing multiple results #5778

Merged
merged 4 commits into from Nov 7, 2023

Conversation

Maksims
Copy link
Contributor

@Maksims Maksims commented Nov 1, 2023

Based on WebXR specs, it is possible to query hit test results for specific input sources, but it is done using profile array string. As left / right controllers have the same profile string, then hit test source can report information from various input sources. This PR fixes that, and ensures that HitTestSource fires result event only for the input source it is related to.

Additionally underlying systems can provide multiple results per hit test source as ray can pass through multiple planes. Previously only devices with a single result were present, so this PR updates that, and ensures that single (closest) result is returned. If there will be a need for returning multiple results, then additional PR with resultsAll callback probably can be made.

Example with AR Hit Test is updated to include additional input sources (screen taps, controllers and hands).

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

@Maksims Maksims mentioned this pull request Nov 1, 2023
Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a minor comments

@mvaligursky mvaligursky merged commit 063153f into playcanvas:main Nov 7, 2023
7 checks passed
@Maksims Maksims deleted the webxr-hit-test-fix branch November 7, 2023 11:19
@willeastcott willeastcott added the area: xr XR related issue label Nov 7, 2023
@slimbuck slimbuck mentioned this pull request Dec 7, 2023
@Maksims Maksims mentioned this pull request Dec 8, 2023
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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants