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

feat(XR): Handle WebXR XRInputSourceEvents #2221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tbirdso
Copy link
Contributor

@tbirdso tbirdso commented Jan 12, 2022

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Context

The WebXR API exposes a limited number of user input events, which we expose to the user here through RenderWindowInteractor alongside other typical browser events.

Note that the granularity offered through XR events does not match that of the XR gamepad API, through which we can query continuous values such as touchpad or joystick position through our updateXRGamepads method. Developers should take both approaches into account.

Changes

  • WebXR events are exposed through RenderWindowInteractor.

Results

Exposes six new events ("select"/start/end, "squeeze"/start/end) that developers can choose to handle.

Testing

  • All tests complete without errors on the following environment:
    • vtk.js: master
    • OS: Windows
    • Browser: Chrome 97.0.4692.71 (Windows 10)

@tbirdso tbirdso requested a review from floryst January 12, 2022 16:04
@tbirdso
Copy link
Contributor Author

tbirdso commented Jan 12, 2022

Note that XR events seem at the moment to be the best way to handle mobile AR events, which will usually be simpler (i.e. touching the screen). VR events may be more complicated due to different controller inputs/configurations.

Copy link
Collaborator

@floryst floryst left a comment

Choose a reason for hiding this comment

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

Looks good so far. Just a small comment on capitalization.

Comment on lines +62 to +67
'StartXrSelect',
'XrSelect',
'EndXrSelect',
'StartXrSqueeze',
'XrSqueeze',
'EndXrSqueeze',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think capitalizing the 'R' in 'XR' for consistency is a good idea here.

Copy link
Contributor

Choose a reason for hiding this comment

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

still relevant?

@floryst floryst added this to To do in vtk.js roadmap Jun 21, 2022
@tbirdso tbirdso mentioned this pull request Sep 9, 2022
46 tasks
@tbirdso
Copy link
Contributor Author

tbirdso commented Nov 15, 2023

Note that I do not expect to be able to revisit this PR. Will leave open in case others would like to take up this development, otherwise project maintainers are welcome to close it.

@bourdaisj
Copy link
Contributor

this PR is probably useful so we should just merge it someday imo

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

Successfully merging this pull request may close these issues.

None yet

3 participants