spite / WebVR-Extension

Chrome DevTools extension to emulate WebVR API
MIT License
304 stars 43 forks source link

Provisional Gamepad Support #4

Open lollerbus opened 8 years ago

lollerbus commented 8 years ago

Hi @spite,

First off, fantastic work! I hope I'm not stepping on your toes, but I was considering adding an emulated HTC Vive controller in a fashion similar to your monkey-patching of navigator.getVRDisplays. Initially just something simple in terms of being able to position/orient it in space and depress buttons. Should I get something functional in a PR in order to discuss further?

Thanks, lollerbus

spite commented 8 years ago

Yes! It would work similarly, but for navigator.getGamepads() (and all the related methods, objects, events...)

To begin with, exposing two "controller-like" boxes that can get a pose like the hmd, and attach the TransformControls. Then it might make sense to refactor the code so it can be generalised for hmd, controllers ... and anything else that might come in the future.

Do you have any thoughts about how to handle buttons and touchpads?

Also, it might be interesting to not override all gamepads, in case a developer is also using a standard gamepad for whatever reason.