msfeldstein / three-vive-controller

Use Vive controllers in WebVR with a semantic event based api
17 stars 4 forks source link

Added new event for trigger level changes. #10

Closed patricknelson closed 7 years ago

patricknelson commented 7 years ago

I needed the ability to smoothly track trigger level changes. Since the controller already has event listeners and maintains its own state, I figured it'd be more efficient to track these changes and emit events from the controller instead of tracking this externally. Also figured other folks might find this useful 😄

I'm also now retaining controllerId from constructor so that the Vive controller can be identified by an integer instead of just via the this keyword. Makes it easier for indexing in case you track an event and you are interested in associating other data/objects/etc via that ID.

Other changes:

msfeldstein commented 7 years ago

Looks great thanks! I will push to npm when I get back from vacation in a few days