diff --git a/examples/js/controls/VRControls.js b/examples/js/controls/VRControls.js index f06b74e4aa2bfa2035cce8e79630b8a3e1729201..a4a72d9a0725cc29cc752694c1e03e33e2ae2530 100644 --- a/examples/js/controls/VRControls.js +++ b/examples/js/controls/VRControls.js @@ -3,14 +3,13 @@ * @author mrdoob / http://mrdoob.com */ -THREE.VRControls = function ( object, callback ) { +THREE.VRControls = function ( object, onError ) { var scope = this; - // Allow for multiple VR input devices. var vrInputs = []; - var onVRDevices = function ( devices ) { + function gotVRDevices( devices ) { for ( var i = 0; i < devices.length; i ++ ) { @@ -24,27 +23,20 @@ THREE.VRControls = function ( object, callback ) { } - if ( callback !== undefined ) { - - callback( 'HMD not available' ); - - } + if ( onError ) onError( 'HMD not available' ); }; - if ( navigator.getVRDevices !== undefined ) { + if ( navigator.getVRDevices ) { - navigator.getVRDevices().then( onVRDevices ); - - } else if ( callback !== undefined ) { - - callback( 'Your browser is not VR Ready' ); + navigator.getVRDevices().then( gotVRDevices ); } // the Rift SDK returns the position in meters // this scale factor allows the user to define how meters // are converted to scene units. + this.scale = 1; this.update = function () { diff --git a/examples/js/effects/VREffect.js b/examples/js/effects/VREffect.js index 6ecd59e2d0b8266a9072225eae88fd8048af348a..3877ac11473d999364fa47f403b873a5e6f07a2e 100644 --- a/examples/js/effects/VREffect.js +++ b/examples/js/effects/VREffect.js @@ -2,25 +2,13 @@ * @author dmarcos / https://github.com/dmarcos * @author mrdoob / http://mrdoob.com * - * It handles stereo rendering - * If mozGetVRDevices and getVRDevices APIs are not available it gracefuly falls back to a - * regular renderer + * WebVR Spec: http://mozvr.github.io/webvr-spec/webvr.html * - * The HMD supported is the Oculus DK1 and The Web API doesn't currently allow - * to query for the display resolution (only the chrome API allows it). - * The dimensions of the screen are temporarly hardcoded (1280 x 800). - * - * For VR mode to work it has to be used with the Oculus enabled builds of Firefox or Chrome: - * - * Firefox: - * - * http://mozvr.com/downloads.html - * - * Chrome builds: - * - * https://drive.google.com/a/google.com/folderview?id=0BzudLt22BqGRbW9WTHMtOWMzNjQ&usp=sharing#list + * Firefox: http://mozvr.com/downloads/ + * Chromium: https://drive.google.com/folderview?id=0BzudLt22BqGRbW9WTHMtOWMzNjQ&usp=sharing#list * */ + THREE.VREffect = function ( renderer, onError ) { var vrHMD;