Skip to content

Commit

Permalink
Updating webvr-polyfill because of breaking change on DeviceMotionEve…
Browse files Browse the repository at this point in the history
…nt.rotationRate
  • Loading branch information
irealva committed Oct 3, 2018
1 parent 007754e commit b2416ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 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": "^0.87.0",
"three-bmfont-text": "^2.1.0",
"webvr-polyfill": "^0.10.3"
"webvr-polyfill": "0.10.3"
},
"devDependencies": {
"browserify": "^13.1.0",
Expand Down
13 changes: 5 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,20 @@ window.Promise = window.Promise || require('promise-polyfill');
// 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
};
ROTATE_INSTRUCTIONS_DISABLED: true
});

// Workaround for iOS Safari canvas sizing issues in stereo (webvr-polyfill/issues/102).
// Only for iOS on versions older than 10.
if (utils.device.isIOSOlderThan10(window.navigator.userAgent)) {
window.WebVRConfig.BUFFER_SCALE = 1 / window.devicePixelRatio;
}

// WebVR polyfill
require('webvr-polyfill');

require('present'); // Polyfill `performance.now()`.

// CSS.
Expand Down

0 comments on commit b2416ac

Please sign in to comment.