@@ -485,7 +485,9 @@ Object.assign(AnimController.prototype, {
485
485
var interpolatedTime = this . _currTransitionTime / this . _totalTransitionTime ;
486
486
for ( i = 0 ; i < this . _transitionPreviousStates . length ; i ++ ) {
487
487
// interpolate the weights of the most recent previous state and all other previous states based on the progress through the previous transition
488
- if ( i !== this . _transitionPreviousStates . length - 1 ) {
488
+ if ( ! this . _isTransitioning ) {
489
+ this . _transitionPreviousStates [ i ] . weight = 1.0 ;
490
+ } else if ( i !== this . _transitionPreviousStates . length - 1 ) {
489
491
this . _transitionPreviousStates [ i ] . weight *= ( 1.0 - interpolatedTime ) ;
490
492
} else {
491
493
this . _transitionPreviousStates [ i ] . weight = interpolatedTime ;
@@ -501,9 +503,9 @@ Object.assign(AnimController.prototype, {
501
503
clip . name = animation . name + '.previous.' + i ;
502
504
}
503
505
// // pause previous animation clips to reduce their impact on performance
504
- // if (i !== this._transitionPreviousStates.length - 1) {
505
- clip . pause ( ) ;
506
- // }
506
+ if ( i !== this . _transitionPreviousStates . length - 1 ) {
507
+ clip . pause ( ) ;
508
+ }
507
509
}
508
510
}
509
511
}
@@ -652,7 +654,8 @@ Object.assign(AnimController.prototype, {
652
654
this . _updateStateFromTransition ( transition ) ;
653
655
654
656
if ( this . _isTransitioning ) {
655
- if ( this . _currTransitionTime < this . _totalTransitionTime ) {
657
+ this . _currTransitionTime += dt ;
658
+ if ( this . _currTransitionTime <= this . _totalTransitionTime ) {
656
659
var interpolatedTime = this . _currTransitionTime / this . _totalTransitionTime ;
657
660
// while transitioning, set all previous state animations to be weighted by (1.0 - interpolationTime).
658
661
for ( i = 0 ; i < this . _transitionPreviousStates . length ; i ++ ) {
@@ -691,7 +694,6 @@ Object.assign(AnimController.prototype, {
691
694
}
692
695
}
693
696
}
694
- this . _currTransitionTime += dt ;
695
697
}
696
698
this . _animEvaluator . update ( dt ) ;
697
699
} ,
0 commit comments