-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
Added "controllermove" event to WebXRController #20790
Conversation
Closed? |
I merged into it to #20720 source branch. Do you prefer to keep it in a separate PR? |
There's another PR enhancing WebXRManager: #20696 |
Ok, closing #20949 in favor of this one. |
Realistically, don't vr controllers move all the time? |
Yes @mrdoob, while they are active in the session they do move on every frame. In the context of XR support for TransformControls, I am trying to get XR controller input events, exactly like pointer and keyboard input. We already have events
Options 1 and 2 are not ideal because suddenly it requires internal animation loop to get user input. Option 3 is the other side of the same coin, it requires application to continuously I'm not that familiar with WebXR APIs but I find the design of the event system somewhat incomplete. We have some events for two primary (special) controller buttons - Ideally, I would love to be able to use XR Controllers and their GamePads exactly like mouse and keyboard, by attaching event listeners. Would that ever be possible? Was that discussed for the WebXR spec? Ping @toji |
I understand the motivation but continuously firing
I'm not sure this approach is right considering the difference in interaction between XR and classic mouse/keyboard and touch. To me, the concept of |
Yes @mrdoob, whenever they are being tracked. If turn off a controller or move it outside the tracking are it will stop emitting this event. This is similar behavior as pointer with stylus devices. Without this event, XR controls would need to either:
If event mechanism is not an option, personally I lean towards former. Closing due to no traction on this PR. |
Now that I'm trying to get DAT.GUI working inside VR I can see why this is needed 😇 |
I think I'm going to rename it to |
Thanks! |
Oh, hold on... Still not sure about this. |
I think it should work @mrdoob. Let me check... |
This is a requirement to make #20720 work in WebXR.
The problem it solves:
Right now WebXRControllers emit various events such as
select
,selectstart
,selectend
,squeeze
,squeezestart
,squeezeend
,pinchend
,pinchstart
,connected
anddisconnected
. But no event is fired when controllers move. The only way to get controller movement is to continuously pull transformation from rAF.I would like to be able to use controllers in a similar fashion as other input devices (mouse, touch, pen, keyboard...) strictly via event listeners. I think this PR will enable that at least for simple click (select) and drag gesture.