Explorar o código

check if the window object is defined before starting the WebVRManager

Duncan Alexander %!s(int64=7) %!d(string=hai) anos
pai
achega
f122471c3a
Modificáronse 3 ficheiros con 20 adicións e 16 borrados
  1. 7 7
      build/three.js
  2. 7 7
      build/three.module.js
  3. 6 2
      src/renderers/webvr/WebVRManager.js

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 7 - 7
build/three.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 7 - 7
build/three.module.js


+ 6 - 2
src/renderers/webvr/WebVRManager.js

@@ -14,7 +14,7 @@ function WebVRManager( renderer ) {
 	var device = null;
 	var frameData = null;
 
-	if ( 'VRFrameData' in window ) {
+	if ( typeof window !== 'undefined' && 'VRFrameData' in window ) {
 
 		frameData = new window.VRFrameData();
 
@@ -62,7 +62,11 @@ function WebVRManager( renderer ) {
 
 	}
 
-	window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
+	if ( typeof window !== 'undefined' ) {
+
+		window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
+
+	}
 
 	//
 

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio