├── LICENSE
├── README.md
├── examples
└── simple-scene
│ └── index.html
└── src
├── input_hmd.js
└── vr_camera.js
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014-2016 PlayCanvas Ltd
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DEPRECATED
2 |
3 | **This project is now deprecated. WebXR support for PlayCanvas is now built directly into the engine. For more information see the developer documentation: https://developer.playcanvas.com/en/user-manual/xr/**
4 |
5 | **This repository is kept for legacy reasons and should not be used in new projects.**
6 |
7 | ---
8 |
9 | ## WebVR Support for PlayCanvas
10 |
11 | The project contains scripts to run your PlayCanvas application in VR using either a Google Cardboard-style VR headset or (when using special builds of Chrome & Firefox) Oculus Rift and HTC Vive.
12 |
13 | ## Requirements
14 |
15 | For Cardboard VR any modern mobile device should work. For Oculus and Vive support you require a special build of [Chromium](http://webvr.info/).
16 |
17 | ## How to use
18 |
19 | 1. Make sure `input_hmd.js` loads first, which can be changed in Editor Settings "Scripts Loading Order".
20 | 2. On the Entity you wish to be your camera add `vrCamera` to script component.
21 | 3. By default `vrCamera` will start the VR mode when you click or tap the canvas.
22 |
23 | ## Options
24 |
25 | VrCamera has a few options that are exposed on the entity in the Editor.
26 |
27 | * enableOnClick - If disabled you must manually call `enterVr()` on the camera script to start VR rendering
28 | * alwaysAcceptInput - If enabled HMD position tracking will be applied to the camera even if the camera is no "in VR".
29 |
30 | ## Known Issues
31 |
32 | - Currently WebVR is a moving target, so APIs are changing often. This library now implements the WebVR 1.0 Spec.
33 | - Please raise an issue on this project if you encounter problems
34 |
35 | ## Attribution
36 |
37 | input_hmd.js contains a version of the [WebVR Polyfill](https://github.com/borismus/webvr-polyfill) by Boris Smus.
38 |
--------------------------------------------------------------------------------
/examples/simple-scene/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |