Browse Source

minor bug fixes.

Ben Houston 10 years ago
parent
commit
996879a6c8
2 changed files with 7 additions and 7 deletions
  1. 3 3
      src/animation/AnimationAction.js
  2. 4 4
      src/animation/AnimationMixer.js

+ 3 - 3
src/animation/AnimationAction.js

@@ -27,7 +27,7 @@ THREE.AnimationAction.prototype = {
 
 		//console.log( 'AnimationAction[' + this.clip.name + '].toAnimationClipTime( ' + time + ' )' );
 		this.time += deltaTime;
-		this.clipTime += deltaTime * this.getTimeScaleAt( time );
+		this.clipTime += deltaTime * this.getTimeScaleAt( this.time );
 
 		//console.log( '   clipTime: ' + clipTime );
 
@@ -37,12 +37,12 @@ THREE.AnimationAction.prototype = {
 
 			if( this.clipTime < 0 ) {
 
-				this.clipTime -= Math.floor( clipTime / duration ) * duration;
+				this.clipTime -= Math.floor( this.clipTime / duration ) * duration;
 				//console.log( '   clipTime: ' + clipTime );
 
 			}
 
-	   		this.clipTime = clipTime % duration;
+	   		this.clipTime = this.clipTime % duration;
 
 	   	}
 	   	else {

+ 4 - 4
src/animation/AnimationMixer.js

@@ -120,7 +120,7 @@ THREE.AnimationMixer.prototype = {
 
 	},
 
-	wrap: function( action, startTimeScale, endTimeScale, duration ) {
+	warp: function( action, startTimeScale, endTimeScale, duration ) {
 
 		var keys = [];
 		
@@ -129,7 +129,7 @@ THREE.AnimationMixer.prototype = {
 		
 		action.timeScale = new THREE.KeyframeTrack( "timeScale", keys );
 
-	}
+	},
 
 	crossFade: function( fadeOutAction, fadeInAction, duration, wrapTimeScales ) {
 
@@ -141,8 +141,8 @@ THREE.AnimationMixer.prototype = {
 			var startEndRatio = fadeOutAction.duration / fadeInAction.duration;
 			var endStartRatio = 1.0 / startEndRatio;
 
-			this.wrap( fadeOutAction, 1.0, startEndRatio, duration );
-			this.wrap( action, endStartRatio, 1.0, duration );
+			this.warp( fadeOutAction, 1.0, startEndRatio, duration );
+			this.warp( fadeInAction, endStartRatio, 1.0, duration );
 
 		}