Skip to content

judax/OculusMobileSDKHeadTrackingWebVR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OculusMobileSDKHeadTrackingWebVR

This project aims to provide a WebVR API 1.0 (and the deprecated API version) shim/polyfill implementation that uses the OculusMobileSDKHeadTracking implementation of a native Crosswalk extension or Cordova plugin.

Folder Structure

  • js: The main library code: OculusMobileSDKHeadTrackingWebVR.js a shim of the WebVR API that uses the OculusMobileSDKHeadTracking native binding through a crosswalk extension or a cordova plugin.
  • examples: Some examples that use the library.

How to use it

The OculusMobileSDKHeadTrackingXWalkViewExtension project includes a test that automatically injects this file when a web page is being loaded. You can read on how to use the libray/test.

If you would like to create your own app, you could choose one of the following options:

  1. Inject the JS code yourself (similar to the test)
  2. Include the JS file in your web app before any other script.
<script src="OculusMovileSDKHeadTrackingWebVR.js"></script>

The polyfill does not override any pre-existing WebVR API by default. Check the Configuration section down below.

Configuration

The polyfill can be configured and debugged with various options. The following are supported:

WebVRConfig = {
  // This polyfill is active only if the WebVR API is not already present by default. This flag overrides any pre-existing WebVR API and forces the injection of the WebVR API using the native OculusMobileSDKHeadTracking extension object.
  FORCE_ENABLE_VR: true, // Default: false.
  // Enabled the deprecated WebVR API that still some code out there might need to use.
  ENABLE_DEPRECATED_API: true, // Default: false.
}

Future work, improvements and random ideas

  • Add barrel distortion to the WebVR polyfill.

Related Projects

About

The WebVR API implementation that uses the OculusMobileSDKHeadTracking implementation of any native extension (crosswalk, cordova, etc)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published