<commit_before># vr.js
An experimental NPAPI plugin for Chrome and Firefox that exposes fun VR devices.

`vr.js`, in conjunction with a required native browser plugin, exposes the
Oculus Rift and Razer Hydra to Javascript in a performant, easy-to-use way. The
library makes it simple to query the device values in just a few lines of code
but also handles more advanced things like computing all the math required for
rendering lens distorted scenes. If you want, it even has a slick API for easily
rendering the distored scene that should be easy to drop into any WebGL
application. There's also an example three.js wrapper under
[examples/js/effects/](https://github.com/benvanik/vr.js/tree/master/examples/js/effects) that works pretty well.

Oh, and though it's possible to use node and WebSockets to get the sensor data
I don't recommend it - the latency is simply too high (~10ms). This plugin
allows for a latency similar to if you were developing a native application
against the Oculus SDK and, when running on a correctly configured computer,
will be pretty darn good.

NOTE: the Oculus SDK doesn't like sharing devices - you must close other Oculus
apps before using this in your browser and must close your browser if you want
to run another Oculus app. Lame :(

If you want to see something really crazy, check out the [experimental pure Javascript driver for Chrome](https://github.com/benvanik/vr.js/tree/master/experimental/usb-driver). Pure Javascript device drivers, pretty insane, huh?!

![Screenshot](https://github.com/benvanik/vr.js/raw/master/docs/vrjs-threejs-boxes-demo.jpg "Screenshot of a vr.js demo")

## Supported Devices

* [Razer Hydra](http://www.razerzone.com/gaming-controllers/razer-hydra)
* [Oculus Rift Development Kit](https://www.oculusvr.com/)

## Supported Platforms

* Windows
  * Chrome 26+ (surprisingly good performance)
  * Firefox 20

OSX support coming soon!

If using the [experimental Chrome USB driver](https://github.com/benvanik/vr.js/tree/master/experimental/usb-driver) you can run on both OS X and Linux.

## Installing

* Download the [repository ZIP](https://github.com/benvanik/vr.js/archive/master.zip)
* Extract to some path
* Chrome:
  * Open Chrome to `chrome://extensions`
  * Check 'Developer mode' and click 'Load unpacked extension'
  * Select the `bin\` folder in the path you extracted the ZIP into
* Firefox:
  * Open an administrator command prompt
  * cd to `bin\` in the path you extracted the ZIP into
  * Run `install.bat`
  * You should see a successful message box

## Demos

You must have the plugin installed before they will run:
<commit_msg>Documentation for Mac support<commit_after># vr.js
An experimental NPAPI plugin for Chrome and Firefox that exposes fun VR devices.

`vr.js`, in conjunction with a required native browser plugin, exposes the
Oculus Rift and Razer Hydra to Javascript in a performant, easy-to-use way. The
library makes it simple to query the device values in just a few lines of code
but also handles more advanced things like computing all the math required for
rendering lens distorted scenes. If you want, it even has a slick API for easily
rendering the distored scene that should be easy to drop into any WebGL
application. There's also an example three.js wrapper under
[examples/js/effects/](https://github.com/benvanik/vr.js/tree/master/examples/js/effects) that works pretty well.

Oh, and though it's possible to use node and WebSockets to get the sensor data
I don't recommend it - the latency is simply too high (~10ms). This plugin
allows for a latency similar to if you were developing a native application
against the Oculus SDK and, when running on a correctly configured computer,
will be pretty darn good.

NOTE: the Oculus SDK doesn't like sharing devices - you must close other Oculus
apps before using this in your browser and must close your browser if you want
to run another Oculus app. Lame :(

If you want to see something really crazy, check out the [experimental pure Javascript driver for Chrome](https://github.com/benvanik/vr.js/tree/master/experimental/usb-driver). Pure Javascript device drivers, pretty insane, huh?!

![Screenshot](https://github.com/benvanik/vr.js/raw/master/docs/vrjs-threejs-boxes-demo.jpg "Screenshot of a vr.js demo")

## Supported Devices

* [Razer Hydra](http://www.razerzone.com/gaming-controllers/razer-hydra)
* [Oculus Rift Development Kit](https://www.oculusvr.com/)

## Supported Platforms

* Windows
  * Chrome 26+ (surprisingly good performance)
  * Firefox 20

* Mac OS X
  * Chrome 26+
  * Firefox 20
  * Safari 6

If using the [experimental Chrome USB driver](https://github.com/benvanik/vr.js/tree/master/experimental/usb-driver) you can run on both OS X and Linux.

## Installing

* Download the [repository ZIP](https://github.com/benvanik/vr.js/archive/master.zip)
* Extract to some path
* Mac OS X:
    * Run `bin/install.sh` to install the plugin.
* Windows:
    - Chrome:
        * Open Chrome to `chrome://extensions`
        * Check 'Developer mode' and click 'Load unpacked extension'
        * Select the `bin\` folder in the path you extracted the ZIP into
    - Firefox:
        * Open an administrator command prompt
        * cd to `bin\` in the path you extracted the ZIP into
        * Run `install.bat`
        * You should see a successful message box

## Demos

You must have the plugin installed before they will run:

{'fraction_non_alphanumeric': 0.07834441980783444, 'fraction_numerical': 0.003141167775314117, 'mean_word_length': 4.044734389561976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '694093', 'n_tokens_mistral': 1614, 'n_tokens_neox': 1482, 'n_words': 698}