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

Nightly oculus touch #2446

Closed
wants to merge 16 commits into from
Closed

Conversation

machenmusik
Copy link
Contributor

@machenmusik machenmusik commented Mar 2, 2017

This PR adds support to #2513 for the different Oculus Touch controller mapping exhibited by the current Firefox Nightly build(s). Note that Nightly is currently NOT exposing capacitive touch events as Chromium does; therefore, some hand-controls poses are more cumbersome since buttons need to be fully actuated rather than merely touched.

Per discussion, this PR no longer includes #2423 in its entirety, as another approach has been agreed to fix #2379.

@dmarcos
Copy link
Member

dmarcos commented Mar 2, 2017

I don't understand why emulated is for and why it's needed. If I cannot understand it quickly by reading the docs myself that I wrote the original controls :) I bet there will be a lot of other people that will be confused.

@machenmusik
Copy link
Contributor Author

:)
Are you asking for docs change to provide a fuller explanation, or code change, or something else?

The reason why emulated is needed is because per some of our original discussions on how to support multiple types of controllers, the strategy employed is to speculatively pre-attach the various components that could be used (oculus-touch-controls and vive-controls), and they are supposed to do nothing if their respective controllers are not present. When #2314 committed changes to always attach event listeners, that broke the do-nothing contract, and so with both oculus-touch-controls and vive-controls attached, both components reacted to events that something like tracked-controls would generate, leading to e.g. double-event bug #2379. If applications perform non-idempotent operations as a result of getting tracked controller events, the effects can be more significant.

To fix #2379, the do-nothing-by-default contract is restored, but then emulation / replaying needs some other mechanism to indicate that the events should be acted upon even though the physical controller is not present. That is the emulated flag.

Although, actually it turns out that for replay examples like https://ngokevin.github.io/kframe/scenes/aincraft/?avatar-recording=recording.json
even #2314 was not really enough to allow correct functionality, because it is tracked-controls events that are actually being replayed, and tracked-controls was only injected when the controllers were physically present. (in the example, you would not see the hand pose change.) -- you need to explicitly have tracked-controls present (but it must not match any actual controller, to avoid collisions in events between actual and replay), and if either #2446 or #2423 is included, then you need to add emulated:true to whichever one of oculus-touch-controls or vive-controls you'd like the replay to use.

@machenmusik
Copy link
Contributor Author

(@ngokevin said this: #2423 (comment))

@machenmusik
Copy link
Contributor Author

I liked @ngokevin 's commentary so added something along those lines to the docs, to @dmarcos 's point.

Anything more you'd like to do with this? I think we can deprecate #2423 in favor of this one.

@machenmusik machenmusik force-pushed the nightly-oculus-touch branch 2 times, most recently from 11f1c7a to 0da4007 Compare March 24, 2017 20:50
@machenmusik
Copy link
Contributor Author

@dmarcos per discussion on #2513...

Note that Nightly is currently NOT exposing capacitive touch events as Chromium does; therefore, some hand-controls poses are more cumbersome since buttons need to be fully actuated rather than merely touched.

It appears that Nightly is currently exposing trigger as axis ONLY, so in order to generate typical button events (down/up, even if we ignore touch), there is no choice but to add some emulation code (see b2f803e)

@machenmusik
Copy link
Contributor Author

update: latest nightly builds appear broken, however the 3-22 build has oculus touch mapping as 6 buttons and 2 axes (albeit without touch) - as that is same as chromium, may be able to simplify the mapping again. closing this for now

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

Successfully merging this pull request may close these issues.

Controller events being emitted double (e.g., vive-controls gripup)
2 participants