Skip to content

Commit 0526207

Browse files
authored
Merge pull request #14509 from Mugen87/dev17
AnimationAction: Fix result of _updateTime() for paused pingpong actions
2 parents 5a6150f + 78ecf5f commit 0526207

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/animation/AnimationAction.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,19 @@ Object.assign( AnimationAction.prototype, {
468468
_updateTime: function ( deltaTime ) {
469469

470470
var time = this.time + deltaTime;
471+
var duration = this._clip.duration;
472+
var loop = this.loop;
473+
var loopCount = this._loopCount;
471474

472-
if ( deltaTime === 0 ) return time;
475+
var pingPong = ( loop === LoopPingPong );
473476

474-
var duration = this._clip.duration,
477+
if ( deltaTime === 0 ) {
475478

476-
loop = this.loop,
477-
loopCount = this._loopCount;
479+
if ( loopCount === - 1 ) return time;
480+
481+
return ( pingPong && ( loopCount & 1 ) === 1 ) ? duration - time : time;
482+
483+
}
478484

479485
if ( loop === LoopOnce ) {
480486

@@ -511,8 +517,6 @@ Object.assign( AnimationAction.prototype, {
511517

512518
} else { // repetitive Repeat or PingPong
513519

514-
var pingPong = ( loop === LoopPingPong );
515-
516520
if ( loopCount === - 1 ) {
517521

518522
// just started

0 commit comments

Comments
 (0)