All Projects → playcanvas → Webvr

playcanvas / Webvr

Licence: mit
**Deprecated**: WebVR support for PlayCanvas WebGL Game Engine. WebVR is now supported in the PlayCanvas engine directly, this project is now considered legacy and should not be used in new projects.

Programming Languages

javascript
184084 projects - #8 most used programming language

Important: Deprecated

This project is now deprecated. WebVR support for PlayCanvas is now built directly into the engine. For more information see the developer documentation: http://developer.playcanvas.com/en/user-manual/vr/

This repository is kept for legacy reasons and should not be used in new projects.


WebVR Support for PlayCanvas

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.

Requirements

For Cardboard VR any modern mobile device should work. For Oculus and Vive support you require a special build of Chromium.

How to use

  1. Make sure input_hmd.js loads first, which can be changed in Editor Settings "Scripts Loading Order".
  2. On the Entity you wish to be your camera add vrCamera to script component.
  3. By default vrCamera will start the VR mode when you click or tap the canvas.

## Options

VrCamera has a few options that are exposed on the entity in the Editor.

  • enableOnClick - If disabled you must manually call enterVr() on the camera script to start VR rendering
  • alwaysAcceptInput - If enabled HMD position tracking will be applied to the camera even if the camera is no "in VR".

Known Issues

  • Currently WebVR is a moving target, so APIs are changing often. This library now implements the WebVR 1.0 Spec.
  • Please raise an issue on this project if you encounter problems

## Attribution

input_hmd.js contains a version of the WebVR Polyfill by Boris Smus.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].