Explorar o código

reduce use of maps where possible in favor of arrays.

Ben Houston %!s(int64=10) %!d(string=hai) anos
pai
achega
a33524773a
Modificáronse 2 ficheiros con 6 adicións e 4 borrados
  1. 2 2
      src/animation/AnimationClip.js
  2. 4 2
      src/animation/AnimationMixer.js

+ 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 );
 
 			}