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

Several default profiles are ambiguous about the presence of a button #70

Closed
NellWaliczek opened this issue Jul 19, 2019 · 4 comments
Closed
Assignees

Comments

@NellWaliczek
Copy link
Member

While working on updating to the xr-gamepad-mappings library to match the latest spec text, I discovered a fairly annoying profile definition issue. I'm expecting to have the library updates posted shortly, but in the meantime I figured I'd get this issue filed for discussion.

The XRInputSource.getProfiles() call is designed such that developers can iterate over the list returned and select the best profile they know how to render and interpret. We've defined several default profiles to make this easier such as button-controller, thumbstick-controller, touchpad-controller, and touchpad-thumbstick-controller. The trouble is we defined the latter three to be ambiguous about whether or not a button is also present. In order to utilize this optional button or render its movement appropriately, developers must also check if the gamepad's mapping is xr-standard and potentially load/animate a different renderable model.

I know it's not ideal to have to define a bunch of additional default profile names (button-thumbstick-controller, button-touchpad-controller, button-touchpad-thumbstick-controller), but I'm not sure what other better approach there is. I'm super open to ideas though!

/cc @thetuvix

@NellWaliczek NellWaliczek self-assigned this Jul 31, 2019
@NellWaliczek NellWaliczek transferred this issue from immersive-web/webxr Aug 9, 2019
@thetuvix
Copy link
Contributor

thetuvix commented Aug 9, 2019

Has anyone done the exercise to produce the mappings from today's real-world controllers to the default profiles they can service? Perhaps in practice past a certain complexity controllers always end up having at least one button. I'm actually having trouble thinking of any controllers that have either a thumbstick or touchpad and no app buttons, and so we could define those default profiles to assume a button as well.

If such a controller really did come along down the line with those controls but no button, it's unlikely that today's content would have coded defensively to support it anyway, which is the whole point of being explicit about profiles - we can add a new profile then for sites that now have a real controller to reason about.

@NellWaliczek
Copy link
Member Author

I've got an artist building the assets for this repository right now. And we'd be fine with requiring a button be part of a controller that reports 'thumbstick-controller', 'touchpad-controller', or 'thumbstick-touchpad-controller'. The key thing is that we don't want controllers reporting one of those strings if no button is present which is something not clearly stated in the definition of those profiles.
And as you say, in the future we could add new profiles such as 'thumbstick-no-button-controller' if necessary.

@jacobcdewitt
Copy link

So in this case, does "touchpad-controller" mean a controller has a trigger button, grip button, and a pressable touchpad? I'm pretty sure we at least expect a trigger button regardless of what controller we are dealing with. However, src/profiles/touchpad-controller/profile.json only seems to specify a pressable touchpad but not trigger or grip buttons.

@NellWaliczek
Copy link
Member Author

Based on this information, I've opted to be more specific about the content of generic profiles. This is now covered in pr #78.

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

No branches or pull requests

3 participants