瀏覽代碼

Mesh: Simplified updateMorphTargets().

Mr.doob 9 年之前
父節點
當前提交
e02ff94251
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/objects/Mesh.js

+ 5 - 3
src/objects/Mesh.js

@@ -56,15 +56,17 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 	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.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.morphTargetDictionary[ this.geometry.morphTargets[ m ].name ] = m;
+				this.morphTargetDictionary[ morphTargets[ m ].name ] = m;
 
 			}