Calling tween.stop() should stop the tween, and a following tween.update(time) (f.e. in an animation frame) should return false so that the return value is reliable for exiting the animation loop. Currently this will fail:
function loop(time) {
const keepGoing = tween.update(time)
if (keepGoing) requestAnimationFrame(loop)
}
loop(performance.now())
// ... later, before the animation is finished ...
tween.stop() // Does not cause the loop to stop, the loop keeps going.
The tween.stop() call should cause tween.update() to return true so that the animation loop will end.
Calling
tween.stop()should stop the tween, and a followingtween.update(time)(f.e. in an animation frame) should return false so that the return value is reliable for exiting the animation loop. Currently this will fail:The
tween.stop()call should causetween.update()to returntrueso that the animation loop will end.