Skip to content

Commit 0de9e9c

Browse files
jsantelldmarcos
authored andcommitted
Update WebVRPolyfill to 0.10.3 to fix Chrome devicemotion regression and unit change.
1 parent 9941383 commit 0de9e9c

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"style-attr": "^1.0.2",
4444
"three": "github:supermedium/three.js#r90fixPoseAndRaycaster",
4545
"three-bmfont-text": "^2.1.0",
46-
"webvr-polyfill": "^0.9.40"
46+
"webvr-polyfill": "^0.10.3"
4747
},
4848
"devDependencies": {
4949
"browserify": "^13.1.0",

‎src/index.js‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
// Check before the polyfill runs.
22
window.hasNativeWebVRImplementation = !!window.navigator.getVRDisplays || !!window.navigator.getVRDevices;
33

4-
window.WebVRConfig = window.WebVRConfig || {
4+
// WebVR polyfill
5+
var WebVRPolyfill = require('webvr-polyfill');
6+
window.webvrpolyfill = new WebVRPolyfill({
57
BUFFER_SCALE: 1,
68
CARDBOARD_UI_DISABLED: true,
7-
ROTATE_INSTRUCTIONS_DISABLED: true,
8-
TOUCH_PANNER_DISABLED: true,
9-
MOUSE_KEYBOARD_CONTROLS_DISABLED: true
10-
};
11-
12-
// WebVR polyfill
13-
require('webvr-polyfill');
9+
ROTATE_INSTRUCTIONS_DISABLED: true
10+
});
1411

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

@@ -83,7 +80,7 @@ require('./core/a-mixin');
8380
require('./extras/components/');
8481
require('./extras/primitives/');
8582

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

‎src/utils/device.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var vrDisplay;
22
var polyfilledVRDisplay;
3-
var POLYFILL_VRDISPLAY_ID = 'Cardboard VRDisplay (webvr-polyfill)';
3+
var POLYFILL_VRDISPLAY_ID = 'Cardboard VRDisplay';
44

55
if (navigator.getVRDisplays) {
66
navigator.getVRDisplays().then(function (displays) {

‎tests/node/test.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ suite('node acceptance tests', function () {
99
setup(function () {
1010
let _window = global.window = jsdom.jsdom().defaultView;
1111
global.navigator = _window.navigator;
12+
global.document = _window.document;
13+
global.screen = {};
1214
});
1315

1416
teardown(function () {
1517
delete global.window;
1618
delete global.navigator;
19+
delete global.document;
20+
delete global.screen;
1721
});
1822

1923
test('can run in node', function () {

0 commit comments

Comments
 (0)