Browse Source

Merge pull request #13374 from Mugen87/dev8

AnimationAction: Fix LoopRepeat
Mr.doob 7 years ago
parent
commit
545c587b32
2 changed files with 3 additions and 6 deletions
  1. 1 4
      docs/api/animation/AnimationAction.html
  2. 2 2
      src/animation/AnimationAction.js

+ 1 - 4
docs/api/animation/AnimationAction.html

@@ -91,10 +91,7 @@
 			The number of repetitions of the performed [page:AnimationClip] over the course of this action.
 			Can be set via [page:.setLoop setLoop]. Default is *Infinity*.<br /><br />
 			Setting this number has no effect, if the [page:.loop loop mode] is set to
-			[page:Animation THREE.LoopOnce].<br /><br />
-
-			Note: The first run is not taken into account. For example: if *repetition* is set to 2, the
-			total number of executed rounds will be 3.
+			[page:Animation THREE.LoopOnce].
 		</div>
 
 		<h3>[property:Number time]</h3>

+ 2 - 2
src/animation/AnimationAction.js

@@ -546,7 +546,7 @@ Object.assign( AnimationAction.prototype, {
 
 				var pending = this.repetitions - loopCount;
 
-				if ( pending < 0 ) {
+				if ( pending <= 0 ) {
 
 					// have to stop (switch state, clamp time, fire event)
 
@@ -564,7 +564,7 @@ Object.assign( AnimationAction.prototype, {
 
 					// keep running
 
-					if ( pending === 0 ) {
+					if ( pending === 1 ) {
 
 						// entering the last round