stewdio / THREE.VRController

Support hand controllers for Oculus, Vive, Windows Mixed Reality, Daydream, GearVR, and more by adding VRController to your existing Three.js-based WebVR project.
https://stewdio.github.io/THREE.VRController/
MIT License
230 stars 33 forks source link

An unhandled exception may occur when expected buttons mismatch the actually reported ones #23

Open Artyom17 opened 5 years ago

Artyom17 commented 5 years ago

Just recently hit that issue: different browsers may report different number of buttons (and theoretically - axes) for the same controllers (even though the order of those, obviously, must be correct). If the number of expected buttons is greater than the number of buttons actually reported then VRController throws an exception (in line 187). For safety reasons I am adding if check for buttons and axes.