diff --git a/examples/js/controls/VRControls.js b/examples/js/controls/VRControls.js index d2624f99f538ec..ab1ff8a561a2dc 100755 --- a/examples/js/controls/VRControls.js +++ b/examples/js/controls/VRControls.js @@ -11,7 +11,9 @@ THREE.VRControls = function ( object, onError ) { var standingMatrix = new THREE.Matrix4(); - function gotVRDevices( devices ) { + function gotVRDevices ( devices ) { + + scope.displays = devices; for ( var i = 0; i < devices.length; i ++ ) { diff --git a/examples/js/effects/VREffect.js b/examples/js/effects/VREffect.js index 8d1068318b8f12..88e849144528bf 100644 --- a/examples/js/effects/VREffect.js +++ b/examples/js/effects/VREffect.js @@ -11,6 +11,8 @@ THREE.VREffect = function ( renderer, onError ) { + var scope = this; + var vrHMD; var isDeprecatedAPI = false; var eyeTranslationL = new THREE.Vector3(); @@ -18,7 +20,9 @@ THREE.VREffect = function ( renderer, onError ) { var renderRectL, renderRectR; var eyeFOVL, eyeFOVR; - function gotVRDevices( devices ) { + function gotVRDevices ( devices ) { + + scope.displays = devices; for ( var i = 0; i < devices.length; i ++ ) { @@ -62,8 +66,6 @@ THREE.VREffect = function ( renderer, onError ) { this.isPresenting = false; this.scale = 1; - var scope = this; - var rendererSize = renderer.getSize(); var rendererPixelRatio = renderer.getPixelRatio();