Skip to content

WebXRController: Add grip update event if enabled.#33118

Merged
Mugen87 merged 6 commits intomrdoob:devfrom
danrossi:xr-controller-gripupdate
Mar 5, 2026
Merged

WebXRController: Add grip update event if enabled.#33118
Mugen87 merged 6 commits intomrdoob:devfrom
danrossi:xr-controller-gripupdate

Conversation

@danrossi
Copy link
Contributor

@danrossi danrossi commented Mar 4, 2026

Related issue: #32353 #33118

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

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 359.27
85.31
359.27
85.31
+0 B
+0 B
WebGPU 630.13
174.94
630.13
174.94
+0 B
+0 B
WebGPU Nodes 628.72
174.69
628.72
174.69
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 491.03
119.72
491.13
119.74
+102 B
+26 B
WebGPU 703.7
189.99
703.8
190.02
+102 B
+27 B
WebGPU Nodes 652.93
177.41
653.03
177.44
+102 B
+26 B

@danrossi
Copy link
Contributor Author

danrossi commented Mar 4, 2026

It's done

@Mugen87 Mugen87 added this to the r184 milestone Mar 4, 2026
@Mugen87 Mugen87 changed the title WebXRController: add grip update event to WebXRController if enabled WebXRController: Add grip update event if enabled. Mar 4, 2026
@danrossi
Copy link
Contributor Author

danrossi commented Mar 5, 2026

Thanks for the refactored change. I have updated my gamepad feature on my side. https://github.com/danrossi/three-xr-controller-manager/blob/master/src/webxr/XRGamepad.js#L80

@Mugen87 Mugen87 merged commit 2655fa0 into mrdoob:dev Mar 5, 2026
10 checks passed
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.

2 participants