瀏覽代碼

fix VRControls onError

Jeffrey Zitelli 9 年之前
父節點
當前提交
1e99bc4578
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      examples/js/controls/VRControls.js

+ 5 - 1
examples/js/controls/VRControls.js

@@ -21,7 +21,11 @@ THREE.VRControls = function ( object, onError ) {
 
 		}
 
-		if ( onError ) onError( 'HMD not available' );
+		if ( vrInputs.length === 0 ) {
+
+			if ( onError ) onError( 'PositionSensorVRDevice not available' );
+
+		}
 
 	}