webvr-polyfill
Advanced tools
Comparing version 0.0.1 to 0.2.4
{ | ||
"name": "webvr-polyfill", | ||
"version": "0.0.1", | ||
"description": "Polyfill for WebVR, enables Cardboard and fallbacks to mobile/desktop.", | ||
"main": "main.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/borismus/webvr-polyfill.git" | ||
}, | ||
"version": "0.2.4", | ||
"homepage": "https://github.com/borismus/webvr-polyfill", | ||
"authors": [ | ||
"Boris Smus <boris@smus.com>" | ||
], | ||
"description": "Use WebVR today, on mobile or desktop, without requiring a special browser build.", | ||
"main": "build/webvr-polyfill.js", | ||
"keywords": [ | ||
"webvr", | ||
"vr", | ||
"polyfill", | ||
"webgl" | ||
"webvr" | ||
], | ||
"author": "Boris Smus <boris@smus.com> (http://smus.com)", | ||
"license": "Apache2", | ||
"bugs": { | ||
"url": "https://github.com/borismus/webvr-polyfill/issues" | ||
}, | ||
"homepage": "https://github.com/borismus/webvr-polyfill" | ||
"license": "Apache2" | ||
} |
# WebVR Polyfill | ||
This project provides a JavaScript implementation of the [WebVR | ||
spec][spec]. | ||
The goal of this project is two fold: | ||
1. Make it possible for developers to use WebVR today, without special | ||
browser builds. | ||
2. Provide good fallbacks for users that don't have VR hardware. | ||
1. Use WebVR today, without requiring a special browser build. | ||
2. View (mono) content without a virtual reality headset. | ||
[spec]: http://mozvr.github.io/webvr-spec/webvr.html | ||
## Implementation | ||
The polyfill decides which VRDevices to provide, depending on the configuration | ||
of your browser. Mobile devices provide both the FusedPositionSensorVRDevice and | ||
the CardboardHMDVRDevice. Desktop devices use the | ||
MouseKeyboardPositionSensorVRDevice. | ||
`CardboardHMDVRDevice` provides default parameters for Cardboard's | ||
interpupillary distance and headset. | ||
`GyroPositionSensorVRDevice` uses the DeviceMotionEvents (which map | ||
roughly to the gyroscope) to polyfill head-tracking on mobile devices. | ||
This is used both in Cardboard, and for Spotlight Stories-style | ||
experiences. | ||
`MouseKeyboardPositionSensorVRDevice` uses mouse events to allow you to do the | ||
equivalent of mouselook. It also uses keyboard arrows and WASD keys to look | ||
around the scene with the keyboard. | ||
`MouseKeyboardPositionSensorVRDevice` uses mouse events to allow you to | ||
do the equivalent of mouselook. It also uses keyboard arrows and WASD | ||
keys to look around the scene with the keyboard. | ||
`FusedPositionSensorVRDevice` uses DeviceMotionEvents and implements a | ||
complementary filter which does sensor fusion. This device also implements pose | ||
prediction, which greatly improves head tracking performance. | ||
**Deprecated**: `OrientationPositionSensorVRDevice` uses DeviceOrientationEvents | ||
to polyfill head-tracking on mobile devices. | ||
## Open issues | ||
**Experimental**: `WebcamPositionSensorVRDevice` uses your laptop's webcam in | ||
order to introduce translational degrees of freedom. | ||
- Provide a GUI to specify HMD parameters. Possibly a configuration UI | ||
for setting them for non-Cardboard devices. | ||
- Provide new types of tracking, perhaps using the web camera for 3 | ||
translational degrees of freedom, eg: <http://topheman.github.io/parallax/> | ||
[ss]: https://play.google.com/store/apps/details?id=com.motorola.avatar | ||
## Configuration | ||
The polyfill can be configured and debugged with various options. The following | ||
are supported: | ||
WebVRConfig = { | ||
// Forces availability of VR mode. | ||
//FORCE_ENABLE_VR: true, // Default: false. | ||
// Complementary filter coefficient. 0 for accelerometer, 1 for gyro. | ||
//K_FILTER: 0.98, // Default: 0.98. | ||
// How far into the future to predict during fast motion. | ||
//PREDICTION_TIME_S: 0.050, // Default: 0.050s. | ||
// Flag to disable touch panner. In case you have your own touch controls | ||
//TOUCH_PANNER_DISABLED: true, // Default: false. | ||
// Enable yaw panning only, disabling roll and pitch. This can be useful | ||
// for panoramas with nothing interesting above or below. | ||
//YAW_ONLY: true, // Default: false. | ||
// To disable keyboard and mouse controls. If you implement your own. | ||
//MOUSE_KEYBOARD_CONTROLS_DISABLED: true // Default: false | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
9528016
310
149364
59
1
2
3
49
18