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

[3.x] Fix touch events when using smartphone AR with WebXR #56819

Merged
merged 1 commit into from
Jan 17, 2022

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Jan 15, 2022

After #55869, Control's on a CanvasLayer will actually be shown on the screen when using smartphone AR. However, the Controls don't recognize any screen touch or drag events.

This PR will generate InputEventScreenTouch and InputEventScreenDrag events when using smartphone AR, so the Controls will actually work!

To implement this, I needed to use a piece of information from WebXR (XRInputSource.targetRayMode) that I think would also be useful for game developers, so this also adds a new method to the API: WebXRInterface.get_controller_target_ray_mode()

Discussed briefly on RocketChat with @akien-mga that this could be done only for 3.x for now, until we're actually able to test WebXR on 4.x.

@dsnopek dsnopek requested a review from a team as a code owner January 15, 2022 18:22
@dsnopek dsnopek added this to the 3.5 milestone Jan 15, 2022
@dsnopek dsnopek requested a review from a team January 15, 2022 18:23
@dsnopek dsnopek added the bug label Jan 15, 2022
@dsnopek
Copy link
Contributor Author

dsnopek commented Jan 15, 2022

Ah, looks like my local 3.x branch was out-of-date. I'll rebase, test and force push in a little bit.

@dsnopek dsnopek force-pushed the webxr-ar-touch-events-squashed branch 2 times, most recently from a087247 to aadb1be Compare January 15, 2022 20:27
@dsnopek dsnopek force-pushed the webxr-ar-touch-events-squashed branch from aadb1be to e39f628 Compare January 15, 2022 20:55
@akien-mga akien-mga merged commit 64ef373 into godotengine:3.x Jan 17, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants