-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
WebXRController: add grip update event to WebXRController if enabled #32353
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
base: dev
Are you sure you want to change the base?
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
This reverts commit a889fe2.
…into xr-controller-gamepad
|
I've added the XRGamePad helper and example to complement the new event. |
|
I hope that design is acceptable. It seems the other method was an update event into just after this. Obtaining the inputSource from the motioncontroller. https://github.com/mrdoob/three.js/blob/dev/examples/jsm/webxr/XRControllerModelFactory.js#L95 |
|
I have some other controller features to submit for review including GripPointer util like the HandPointerModel which adds a line and cursor which seems to have to be duplicated everywhere. An intersection util to handle the different pointer models now it uses a common api like the HandPointerModel. A controller manager to handle all the different controllers and events. So it's universal. It's taking parts of my internal controller work including handling transient-pointer for Apple vision. I found it clunky to manage externally for both controllers. |
Add universal XRControllerManager
Add universal XRI{ntersections feature
Add GripPointerModel
Add GazePointerModel
Add example for XRControllerManager
|
I thought I would add these extra addons with the gamepad feature. A universal controller and intersections manager. The grip cursor and line is added into a pointer model so they can be handled the same way as the hand pointer model. |
add screenshot and update example
Related issue: #32350
Description
Adds a grip update event to the WebXRController to individually handle gamepad and input source for each controller. The event can be enabled / disabled easily so it's not being called all the time.
I found trying to handle gamepad inputs externally for each controller connected is clunky and should be handled in an event. I was forced to make a patched XRController to do this.
A gamepad helper can then use this event to handle gamepad inputs and dispatch specific events like in my patched XRController. Perhaps this can be added to the examples also.
https://github.com/danrossi/three-xr-controller/blob/main/src/XRController.js#L79
Usage