2
0
Эх сурвалжийг харах

Mesh: Simplified updateMorphTargets().

Mr.doob 9 жил өмнө
parent
commit
e02ff94251

+ 5 - 3
src/objects/Mesh.js

@@ -56,15 +56,17 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 
 	updateMorphTargets: function () {
 	updateMorphTargets: function () {
 
 
-		if ( this.geometry.morphTargets !== undefined && this.geometry.morphTargets.length > 0 ) {
+		var morphTargets = this.geometry.morphTargets;
+
+		if ( morphTargets !== undefined && morphTargets.length > 0 ) {
 
 
 			this.morphTargetInfluences = [];
 			this.morphTargetInfluences = [];
 			this.morphTargetDictionary = {};
 			this.morphTargetDictionary = {};
 
 
-			for ( var m = 0, ml = this.geometry.morphTargets.length; m < ml; m ++ ) {
+			for ( var m = 0, ml = morphTargets.length; m < ml; m ++ ) {
 
 
 				this.morphTargetInfluences.push( 0 );
 				this.morphTargetInfluences.push( 0 );
-				this.morphTargetDictionary[ this.geometry.morphTargets[ m ].name ] = m;
+				this.morphTargetDictionary[ morphTargets[ m ].name ] = m;
 
 
 			}
 			}