소스 검색

GLTFLoader: Pass materialIndex argument to getMaterialType()

Takahiro 5 년 전
부모
커밋
879f28f93c
2개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  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 );
 
 			} );