Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/richardanaya/aframe-webvr-controller
- Owner: richardanaya
- License: mit
- Created: 2016-06-07T23:16:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-14T03:12:49.000Z (over 8 years ago)
- Last Synced: 2024-11-11T07:45:10.679Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 373 KB
- Stars: 24
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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.infoCheck 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 interesectedNotes
* 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