Skip to content

Commit

Permalink
Update WebVRPolyfill to 0.10.3 to fix Chrome devicemotion regression …
Browse files Browse the repository at this point in the history
…and unit change.
  • Loading branch information
jsantell committed Mar 15, 2018
1 parent 9941383 commit 1002e1e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"style-attr": "^1.0.2",
"three": "github:supermedium/three.js#r90fixPoseAndRaycaster",
"three-bmfont-text": "^2.1.0",
"webvr-polyfill": "^0.9.40"
"webvr-polyfill": "^0.10.3"
},
"devDependencies": {
"browserify": "^13.1.0",
Expand Down
15 changes: 6 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
// Check before the polyfill runs.
window.hasNativeWebVRImplementation = !!window.navigator.getVRDisplays || !!window.navigator.getVRDevices;

window.WebVRConfig = window.WebVRConfig || {
// WebVR polyfill
var WebVRPolyfill = require('webvr-polyfill');
window.webvrpolyfill = new WebVRPolyfill({
BUFFER_SCALE: 1,
CARDBOARD_UI_DISABLED: true,
ROTATE_INSTRUCTIONS_DISABLED: true,
TOUCH_PANNER_DISABLED: true,
MOUSE_KEYBOARD_CONTROLS_DISABLED: true
};

// WebVR polyfill
require('webvr-polyfill');
ROTATE_INSTRUCTIONS_DISABLED: true
});

var utils = require('./utils/');

Expand Down Expand Up @@ -83,7 +80,7 @@ require('./core/a-mixin');
require('./extras/components/');
require('./extras/primitives/');

console.log('A-Frame Version: 0.8.1 (Date 2018-03-14, Commit #5ead860)');
console.log('A-Frame Version: 0.8.1 (Date 2018-03-15, Commit #9941383)');
console.log('three Version:', pkg.dependencies['three']);
console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);

Expand Down
2 changes: 1 addition & 1 deletion src/utils/device.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var vrDisplay;
var polyfilledVRDisplay;
var POLYFILL_VRDISPLAY_ID = 'Cardboard VRDisplay (webvr-polyfill)';
var POLYFILL_VRDISPLAY_ID = 'Cardboard VRDisplay';

if (navigator.getVRDisplays) {
navigator.getVRDisplays().then(function (displays) {
Expand Down
4 changes: 4 additions & 0 deletions tests/node/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ suite('node acceptance tests', function () {
setup(function () {
let _window = global.window = jsdom.jsdom().defaultView;
global.navigator = _window.navigator;
global.document = _window.document;
global.screen = {};
});

teardown(function () {
delete global.window;
delete global.navigator;
delete global.document;
delete global.screen;
});

test('can run in node', function () {
Expand Down

0 comments on commit 1002e1e

Please sign in to comment.