Hi I'm testing this lovely library and i've found a bug.
I have an animation in a pingpong way.
When i click on it, the mixer.timeScale is switched between 1 and -1.
In the first loop, at the first click, the animation jumps straight to the end and start going in reverse mode. The others loops are fine.
Looking at the code, it seems to be coming from there :
|
} else { // repetitive Repeat or PingPong |
|
|
|
if ( loopCount === - 1 ) { |
|
|
|
// just started |
|
|
|
if ( deltaTime >= 0 ) { |
|
|
|
loopCount = 0; |
|
|
|
this._setEndings( true, this.repetitions === 0, pingPong ); |
|
|
|
} else { |
|
|
|
// when looping in reverse direction, the initial |
|
// transition through zero counts as a repetition, |
|
// so leave loopCount at -1 |
|
|
|
this._setEndings( this.repetitions === 0, true, pingPong ); |
|
|
|
} |
|
|
|
} |
if ( deltaTime >= 0 )
Should be changed because if delta is negative, then it jumps to the end of animation instead of goinf in reverse mode!
if ( deltaTime * timeDirection >= 0 )
Here is the full stack to change the caller :
|
_update: function ( time, deltaTime, timeDirection, accuIndex ) { |
|
var clipTime = this._updateTime( deltaTime ); |
Adding timeDirection to
|
_updateTime: function ( deltaTime ) { |
Hi I'm testing this lovely library and i've found a bug.
I have an animation in a pingpong way.
When i click on it, the mixer.timeScale is switched between 1 and -1.
In the first loop, at the first click, the animation jumps straight to the end and start going in reverse mode. The others loops are fine.
Looking at the code, it seems to be coming from there :
three.js/src/animation/AnimationAction.js
Lines 545 to 567 in eb86390
if ( deltaTime >= 0 )Should be changed because if delta is negative, then it jumps to the end of animation instead of goinf in reverse mode!
if ( deltaTime * timeDirection >= 0 )Here is the full stack to change the caller :
three.js/src/animation/AnimationAction.js
Line 330 in eb86390
three.js/src/animation/AnimationAction.js
Line 366 in eb86390
Adding timeDirection to
three.js/src/animation/AnimationAction.js
Line 487 in eb86390