Browse Source

fix bug in AnimationAction introduced in rewrite for LoopPingPong.

Ben Houston 10 years ago
parent
commit
8a0053f429
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/animation/AnimationAction.js

+ 5 - 4
src/animation/AnimationAction.js

@@ -49,14 +49,14 @@ THREE.AnimationAction.prototype = {
    		var previousActionTime = this.actionTime;
    		var previousActionTime = this.actionTime;
 
 
 		var duration = this.clip.duration;
 		var duration = this.clip.duration;
-
-		this.actionTime = this.actionTime + clipDeltaTime * this.timeScale;
+	
+		this.actionTime = this.actionTime + clipDeltaTime;
 	
 	
 		if( this.loop === THREE.LoopOnce ) {
 		if( this.loop === THREE.LoopOnce ) {
 
 
 			this.loopCount = 0;
 			this.loopCount = 0;
 			this.clipTime = Math.min( Math.max( this.actionTime, 0 ), duration );
 			this.clipTime = Math.min( Math.max( this.actionTime, 0 ), duration );
-
+	
 			// if time is changed since last time, see if we have hit a start/end limit
 			// if time is changed since last time, see if we have hit a start/end limit
 			if( this.clipTime !== previousClipTime ) {
 			if( this.clipTime !== previousClipTime ) {
 
 
@@ -79,9 +79,10 @@ THREE.AnimationAction.prototype = {
 		}
 		}
 		
 		
 		this.loopCount = Math.floor( this.actionTime / duration );
 		this.loopCount = Math.floor( this.actionTime / duration );
+	
 		var newClipTime = this.actionTime - this.loopCount * duration;
 		var newClipTime = this.actionTime - this.loopCount * duration;
 		newClipTime = newClipTime % duration;
 		newClipTime = newClipTime % duration;
-
+	
 		// if we are ping pong looping, ensure that we go backwards when appropriate
 		// if we are ping pong looping, ensure that we go backwards when appropriate
 		if( this.loop == THREE.LoopPingPong ) {
 		if( this.loop == THREE.LoopPingPong ) {