Browse Source

update: using cloned value if it is a color object

but0n 6 years ago
parent
commit
56672800a2
1 changed files with 1 additions and 18 deletions
  1. 1 18
      examples/js/loaders/GLTFLoader.js

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

@@ -842,24 +842,7 @@ THREE.GLTFLoader = ( function () {
 				for ( var i = 0, il = params.length; i < il; i ++ ) {
 
 					target[ params[ i ] ] = source[ params[ i ] ];
-
-				}
-
-				if ( source.color ) {
-
-					target.color = source.color.clone();
-
-				}
-
-				if ( source.specular ) {
-
-					target.specular = source.specular.clone();
-
-				}
-
-				if ( source.emissive ) {
-
-					target.emissive = source.emissive.clone();
+					target[ params[ i ] ] = value.isColor ? value.clone() : value;
 
 				}