Explorar o código

Fix handling material extensions when cloning

ShaderMaterial properties might be changed after cloning it, so it's important that a deep copy of extensions is created instead of just referencing the same extensions config object in the cloned material.
Olli Etuaho %!s(int64=5) %!d(string=hai) anos
pai
achega
307d5ebfcf
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/materials/ShaderMaterial.js

+ 1 - 1
src/materials/ShaderMaterial.js

@@ -109,7 +109,7 @@ ShaderMaterial.prototype.copy = function ( source ) {
 	this.morphTargets = source.morphTargets;
 	this.morphNormals = source.morphNormals;
 
-	this.extensions = source.extensions;
+	this.extensions = Object.assign( {}, source.extensions );
 
 	return this;