-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tween.end occasionally does not finish a tween #283
Comments
maybe i wrong, but i have some idea. this.end = function () {
_startTime = TWEEN.now() + _duration + _delay;
return this.update(_startTime);
} Check the code, then let me know works or not. I can't check, because i'm temporarily not in code-made state. Sorry :( UPDATE: When we not use Thanks, |
@mikebolt or we should use an epsilon comparison instead: if the difference is less than a small value Do you have test cases for this? ta! |
Bumping.. |
fixed |
Tween.end() has an issue caused by floating point inaccuracy errors. The problem is that
(_startTime + _duration - _startTime) / _duration
is occasionally slightly more than and occasionally slightly less than 1. In the case that it is less than 1, it will not properly complete the tween and call the onComplete callback.When run in browsers, the two test cases that test Tween.end fail at random.
I think a good fix would be to not use Tween.update in Tween.end, but instead just set the end values and call onComplete manually.
The text was updated successfully, but these errors were encountered: