Răsfoiți Sursa

Updated JSM files.

Mr.doob 6 ani în urmă
părinte
comite
31723750f8
2 a modificat fișierele cu 8 adăugiri și 1 ștergeri
  1. 7 0
      examples/jsm/loaders/GLTFLoader.js
  2. 1 1
      examples/jsm/loaders/OBJLoader.js

+ 7 - 0
examples/jsm/loaders/GLTFLoader.js

@@ -1252,6 +1252,13 @@ var GLTFLoader = ( function () {
 
 		// Invalid URL
 		if ( typeof url !== 'string' || url === '' ) return '';
+		
+		// Host Relative URL
+		if ( /^https?:\/\//i.test( path ) && /^\//.test( url ) ) {
+
+			path = path.replace( /(^https?:\/\/[^\/]+).*/i , '$1' );
+
+		}
 
 		// Absolute URL http://,https://,//
 		if ( /^(https?:)?\/\//i.test( url ) ) return url;

+ 1 - 1
examples/jsm/loaders/OBJLoader.js

@@ -476,7 +476,7 @@ var OBJLoader = ( function () {
 								parseFloat( data[ 2 ] ),
 								parseFloat( data[ 3 ] )
 							);
-							if ( data.length === 8 ) {
+							if ( data.length >= 7 ) {
 
 								state.colors.push(
 									parseFloat( data[ 4 ] ),