Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/richardanaya/aframe-webvr-controller

A component for quickly attaching objects to webvr controllers in a-frame
https://github.com/richardanaya/aframe-webvr-controller

Last synced: 9 days ago
JSON representation

A component for quickly attaching objects to webvr controllers in a-frame

Awesome Lists containing this project

README

        

# aframe-webvr-controller
A-Frame ( http://aframe.io ) is a library made by Mozilla to make VR experiences in the web.
This is a component for quickly attaching objects to WebVR controllers in a-frame. This library works perfectly fine with HTC-Vive using WebVR enabled versions of chrome and is the primary reason I made this library! For more information, check out http://webvr.info

Check out demo here: http://richardanaya.github.io/aframe-webvr-controller/examples/02_vibration/index.html

Features
* Position tracking
* Simple button events
* Vibration
* Events on triggering while interesected

Notes
* You may have to build the latest master branch of aframe to get it to recognize your HTC Vive can go into VR mode ( or just copy mine from examples )

# Installing

```
npm install aframe-webvr-controller
```

# Usage
Using this component is simple. Pass in the index of the controller you wish to use. Please make sure you have an a-camera at position <0,0,0>, otherwise strange offsetting of the controllers may occur!

```html




```

Let's add some button events. There are several buttons your webvrcontroller may have. For HTC Vive:
* webvrcontrollerbutton0pressed/webvrcontrollerbutton0released - circle button
* webvrcontrollerbutton1pressed/webvrcontrollerbutton1released - trigger button
* webvrcontrollerbutton2pressed/webvrcontrollerbutton2released - grip button
* webvrcontrollerbutton3pressed/webvrcontrollerbutton3released - menu button

```html










```

Now lets add some vibration.










You can also pass in a number in millseconds to represent a delay (the default delay is 100). Setting the property to false or 0 will turn off vibration.

Now lets add some events for when a user presses a button while they are intersecting a component