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

reduce use of maps where possible in favor of arrays.

Ben Houston 10 жил өмнө
parent
commit
a33524773a

+ 2 - 2
src/animation/AnimationClip.js

@@ -17,7 +17,7 @@ THREE.AnimationClip = function ( name, duration, tracks ) {
 	this.trim();
 	this.optimize();
 
-	this.results = {};
+	this.results = [];
 	
 };
 
@@ -33,7 +33,7 @@ THREE.AnimationClip.prototype = {
 
 			var track = this.tracks[ i ];
 
-			this.results[ track.name ] = track.getAt( clipTime );
+			this.results[ i ] = track.getAt( clipTime );
 
 		}
 

+ 4 - 2
src/animation/AnimationMixer.js

@@ -178,9 +178,11 @@ THREE.AnimationMixer.prototype = {
 
 			if( action.weight <= 0 || ! action.enabled ) continue;
 
-			for( var name in actionResults ) {
+			for( var j = 0; j < actionResults.length; j ++ ) {
 
-				this.propertyBindings[name].accumulate( actionResults[name], weight );
+				var name = action.clip.tracks[j].name;
+
+				this.propertyBindings[name].accumulate( actionResults[j], weight );
 
 			}