Mugen87 пре 5 година
родитељ
комит
b3257d20ee
2 измењених фајлова са 28 додато и 10 уклоњено
  1. 14 5
      examples/js/loaders/GLTFLoader.js
  2. 14 5
      examples/jsm/loaders/GLTFLoader.js

+ 14 - 5
examples/js/loaders/GLTFLoader.js

@@ -17,7 +17,11 @@ THREE.GLTFLoader = ( function () {
 		this.ddsLoader = null;
 
 		this.pluginCallbacks = [];
-		this.register( function ( parser ) { return new GLTFMaterialsClearcoatExtension( parser ); } );
+		this.register( function ( parser ) {
+
+			return new GLTFMaterialsClearcoatExtension( parser );
+
+		} );
 
 	}
 
@@ -117,7 +121,7 @@ THREE.GLTFLoader = ( function () {
 
 		register: function ( callback ) {
 
-			if ( this.pluginCallbacks.indexOf( callback ) === -1 ) {
+			if ( this.pluginCallbacks.indexOf( callback ) === - 1 ) {
 
 				this.pluginCallbacks.push( callback );
 
@@ -129,7 +133,7 @@ THREE.GLTFLoader = ( function () {
 
 		unregister: function ( callback ) {
 
-			if ( this.pluginCallbacks.indexOf( callback ) !== -1 ) {
+			if ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) {
 
 				this.pluginCallbacks.splice( this.pluginCallbacks.indexOf( callback ), 1 );
 
@@ -468,7 +472,7 @@ THREE.GLTFLoader = ( function () {
 
 	}
 
-	GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( materialIndex ) {
+	GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( /* materialIndex */ ) {
 
 		return THREE.MeshPhysicalMaterial;
 
@@ -1469,10 +1473,15 @@ THREE.GLTFLoader = ( function () {
 		// Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
 		// expensive work of uploading a texture to the GPU off the main thread.
 		if ( this.useImageBitmap ) {
+
 			this.textureLoader = new THREE.ImageBitmapLoader( this.options.manager );
+
 		} else {
+
 			this.textureLoader = new THREE.TextureLoader( this.options.manager );
+
 		}
+
 		this.textureLoader.setCrossOrigin( this.options.crossOrigin );
 
 		this.fileLoader = new THREE.FileLoader( this.options.manager );
@@ -2236,7 +2245,7 @@ THREE.GLTFLoader = ( function () {
 
 	};
 
-	GLTFParser.prototype.getMaterialType = function ( materialIndex ) {
+	GLTFParser.prototype.getMaterialType = function ( /* materialIndex */ ) {
 
 		return THREE.MeshStandardMaterial;
 

+ 14 - 5
examples/jsm/loaders/GLTFLoader.js

@@ -82,7 +82,11 @@ var GLTFLoader = ( function () {
 		this.ddsLoader = null;
 
 		this.pluginCallbacks = [];
-		this.register( function ( parser ) { return new GLTFMaterialsClearcoatExtension( parser ); } );
+		this.register( function ( parser ) {
+
+			return new GLTFMaterialsClearcoatExtension( parser );
+
+		} );
 
 	}
 
@@ -182,7 +186,7 @@ var GLTFLoader = ( function () {
 
 		register: function ( callback ) {
 
-			if ( this.pluginCallbacks.indexOf( callback ) === -1 ) {
+			if ( this.pluginCallbacks.indexOf( callback ) === - 1 ) {
 
 				this.pluginCallbacks.push( callback );
 
@@ -194,7 +198,7 @@ var GLTFLoader = ( function () {
 
 		unregister: function ( callback ) {
 
-			if ( this.pluginCallbacks.indexOf( callback ) !== -1 ) {
+			if ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) {
 
 				this.pluginCallbacks.splice( this.pluginCallbacks.indexOf( callback ), 1 );
 
@@ -533,7 +537,7 @@ var GLTFLoader = ( function () {
 
 	}
 
-	GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( materialIndex ) {
+	GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( /* materialIndex */ ) {
 
 		return MeshPhysicalMaterial;
 
@@ -1534,10 +1538,15 @@ var GLTFLoader = ( function () {
 		// Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
 		// expensive work of uploading a texture to the GPU off the main thread.
 		if ( this.useImageBitmap ) {
+
 			this.textureLoader = new ImageBitmapLoader( this.options.manager );
+
 		} else {
+
 			this.textureLoader = new TextureLoader( this.options.manager );
+
 		}
+
 		this.textureLoader.setCrossOrigin( this.options.crossOrigin );
 
 		this.fileLoader = new FileLoader( this.options.manager );
@@ -2301,7 +2310,7 @@ var GLTFLoader = ( function () {
 
 	};
 
-	GLTFParser.prototype.getMaterialType = function ( materialIndex ) {
+	GLTFParser.prototype.getMaterialType = function ( /* materialIndex */ ) {
 
 		return MeshStandardMaterial;