Browse Source

Updated examples builds.

Mr.doob 3 năm trước cách đây
mục cha
commit
9117a63a3d
2 tập tin đã thay đổi với 11 bổ sung11 xóa
  1. 1 1
      examples/js/loaders/GLTFLoader.js
  2. 10 10
      examples/js/loaders/LDrawLoader.js

+ 1 - 1
examples/js/loaders/GLTFLoader.js

@@ -2006,7 +2006,7 @@
 			this.nodeNamesUsed = {}; // Use an THREE.ImageBitmapLoader if imageBitmaps are supported. Moves much of the
 			// expensive work of uploading a texture to the GPU off the main thread.
 
-			if ( typeof createImageBitmap !== 'undefined' && /Firefox/.test( navigator.userAgent ) === false ) {
+			if ( typeof createImageBitmap !== 'undefined' && /Firefox|Safari/.test( navigator.userAgent ) === false ) {
 
 				this.textureLoader = new THREE.ImageBitmapLoader( this.options.manager );
 

+ 10 - 10
examples/js/loaders/LDrawLoader.js

@@ -917,6 +917,7 @@
 				currentMatrix: new THREE.Matrix4(),
 				matrix: new THREE.Matrix4(),
 				type: 'Model',
+				groupObject: null,
 				// If false, it is a root material scope previous to parse
 				isFromParse: true,
 				faces: [],
@@ -1366,18 +1367,9 @@
 
 								case '!LDRAW_ORG':
 									type = lp.getToken();
-									currentParseScope.type = type;
-									const isRoot = ! parentParseScope.isFromParse;
-
-									if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
-
-										currentParseScope.groupObject = new THREE.Group();
-										currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
-
-									} // If the scale of the object is negated then the triangle winding order
+									currentParseScope.type = type; // If the scale of the object is negated then the triangle winding order
 									// needs to be flipped.
 
-
 									if ( currentParseScope.matrix.determinant() < 0 && ( scope.separateObjects && isPrimitiveType( type ) || ! scope.separateObjects ) ) {
 
 										currentParseScope.inverted = ! currentParseScope.inverted;
@@ -1697,6 +1689,14 @@
 			currentParseScope.subobjects = subobjects;
 			currentParseScope.numSubobjects = subobjects.length;
 			currentParseScope.subobjectIndex = 0;
+			const isRoot = ! parentParseScope.isFromParse;
+
+			if ( isRoot || scope.separateObjects && ! isPrimitiveType( type ) ) {
+
+				currentParseScope.groupObject = new THREE.Group();
+				currentParseScope.groupObject.userData.startingConstructionStep = currentParseScope.startingConstructionStep;
+
+			}
 
 		}