Sfoglia il codice sorgente

GLTFLoader: Pass materialIndex argument to getMaterialType()

Takahiro 5 anni fa
parent
commit
879f28f93c
2 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 3 3
      examples/js/loaders/GLTFLoader.js
  2. 3 3
      examples/jsm/loaders/GLTFLoader.js

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

@@ -464,7 +464,7 @@ THREE.GLTFLoader = ( function () {
 
 	}
 
-	GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function () {
+	GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( materialIndex ) {
 
 		return THREE.MeshPhysicalMaterial;
 
@@ -2199,7 +2199,7 @@ THREE.GLTFLoader = ( function () {
 
 	};
 
-	GLTFParser.prototype.getMaterialType = function () {
+	GLTFParser.prototype.getMaterialType = function ( materialIndex ) {
 
 		return THREE.MeshStandardMaterial;
 
@@ -2272,7 +2272,7 @@ THREE.GLTFLoader = ( function () {
 
 			materialType = this._invokeOne( function ( ext ) {
 
-				return ext.getMaterialType && ext.getMaterialType();
+				return ext.getMaterialType && ext.getMaterialType( materialIndex );
 
 			} );
 

+ 3 - 3
examples/jsm/loaders/GLTFLoader.js

@@ -528,7 +528,7 @@ var GLTFLoader = ( function () {
 
 	}
 
-	GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function () {
+	GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( materialIndex ) {
 
 		return MeshPhysicalMaterial;
 
@@ -2263,7 +2263,7 @@ var GLTFLoader = ( function () {
 
 	};
 
-	GLTFParser.prototype.getMaterialType = function () {
+	GLTFParser.prototype.getMaterialType = function ( materialIndex ) {
 
 		return MeshStandardMaterial;
 
@@ -2336,7 +2336,7 @@ var GLTFLoader = ( function () {
 
 			materialType = this._invokeOne( function ( ext ) {
 
-				return ext.getMaterialType && ext.getMaterialType();
+				return ext.getMaterialType && ext.getMaterialType( materialIndex );
 
 			} );