-
Notifications
You must be signed in to change notification settings - Fork 4
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
poll: true breaks cardboard button usage #4
Comments
So, testing with the quest now, I see that grip buttons seem to count as 'double clicked'. I assume that applies to grip and trigger buttons, and that they're basically being caught by the poll + non-poll mechanisms now. This means the correct answer is probably fixing a bug in the polling code itself. The bug I was experiencing there was that a 'button down' for the gaze controller was firing as soon as I started an xrSession (started VR mode), but never a button up, and never any registered clicks after that point. I'll dig deeper on how to use that 'properly' and fix the real problem there, now that I understand how the code flow works here. |
This is clearly the problem. inputSource.gamepad is undefined. As a result, you just get what I described--these two buttons always locked on. This seems to be an unfinished code path with a dummy hard-coded value just thrown in. |
Alright, hacked in the update. I tested it with an oldschool gamepad in cardboard, with the 'cardboard button', and with the quest 2, seems to all work now. Will make a pull request. |
See: issue DougReeder#4 methodology: we still primarily rely on polling when poll=true, but we also add the `selectstart` and `selectend` listeners in and specifically listen for the `gaze` controller; when we detect those movements, we update a fake psuedo-controller record. `syntheticGamepad()` recognizes when it is getting an update from the cardboard-gaze controller, and instead of just pushing two hardcoded button values, it refers to this psuedo-controller record and passes that along--in this way, the psuedo-controller record is picked up within the polling loop like other controllers in this method.
See: issue DougReeder#4 methodology: we still primarily rely on polling when poll=true, but when poll=true we also add the `selectstart` and `selectend` listeners in and specifically listen for the `gaze` controller in those listeners; when we detect those events, we update a fake psuedo-controller record. `syntheticGamepad()` recognizes when it is getting an update from the cardboard-gaze controller, and instead of just pushing two hardcoded button values as it did before this update, it refers to this psuedo-controller record and passes that along--in this way, the psuedo-controller record is picked up within the polling loop like other controllers when poll=true.
Thanks for digging into this! I've seemed to of got it working here in a glitch - https://glitch.com/edit/#!/cardboard-button However I think there needs to be some logic changes to include a tick function for cardboard VR navigation right? I think we cannot add a tick function to that component whilst we're using play: and pause: Also worth noting, looks like Chrome / Android don't like A-Frame 1.1.0, it makes you go in/out of VR mode twice to get the display working. 1.2.0 don't have these problems. |
I'm currently back to using 1.0.4 in my project, as I had too many conflicts with various libraries when 1.2.0 was new. I do want the hand tracking functionality of 1.2.0, and I think many of those libraries have updates now, so eventually I do want to update. (There were some issues with 1.1.0, I recall, 1.2.0 came relatively quickly after it.) Cardboard VR button is working for me with this fork in my project in 1.0.4. I'm not sure what you mean by "cardboard VR navigation", but the story is:
|
Basically, when
I'm not sure what your point is here or why this matters. I haven't checked, but my intuition is definitely that |
Got it! Managed to get it working with a click button. Next up trying to figure out how to transverse across the scene whilst button is held down! |
https://github.com/n5ro/aframe-extras/tree/master/src/controls 'touch controls' implements this style of movement for non-cardboard mobile usage, btw. but it would also be pretty straightforward to implement this yourself--the component in the docs that is used to teached you how to use the tick handler to have something follow you shows how to approach the problem. Just adapt it to move the camera rig instead of some other object, and add an event listener for your new button, and voila. |
Nice, thanks for that! I managed to find a way to implement touch when on chrome VR without the library. Also added movement to the tick function to move in the direction of the camera. The only issue I'm seeing now is that it looks like when you use camera.object3D.position it then overrides the nav mesh constraint via movement-controls. If I can get this fixed it'll be the ideal work around for android users - https://glitch.com/edit/#!/nav-mesh-testing |
Probably more consistent to just call the existing 'move forward' function within movement-controls, firing upon your own custom event triggered by the cardboard button, imo. Then it should just 'play nice' with everything else, e.g. navmesh. But if you want to keep going that route, I'm sure you can find a way. |
And possibly other stuff too, though I haven't found any other issues yet somehow?
The problem is here:
Basically,
this.addSessionEventListeners()
never gets called--either at initialization, or upon entering VR. So, no listening for select-start and select-end happens, which is how the gaze psuedo-controller reports screen touch.I've added a manual call to
addSessionEventListeners();
and that does indeed make it work on cardboard with the cardboard button, but I don't know if that breaks anything else yet--I'll go test that now. After some more testing, I'll probably offer a pull request.The text was updated successfully, but these errors were encountered: