Allow track entries to finish when timeScale is 0.

closes #806
This commit is contained in:
NathanSweet 2017-05-17 02:10:34 +02:00
parent d7c4195bc7
commit 859dd76f78

View File

@ -139,7 +139,9 @@ public class AnimationState {
if (from == null) return true;
boolean finished = updateMixingFrom(from, delta, animationCount + 1);
if (entry.mixTime >= entry.mixDuration && entry.mixTime > 0) {
// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
if (entry.mixTime > 0 && (entry.mixTime >= entry.mixDuration || entry.timeScale == 0)) {
if (animationCount > 6 && from.mixingFrom == null) { // Limit the mixing from linked list.
entry.mixingFrom = null;
queue.end(from);
@ -856,6 +858,8 @@ public class AnimationState {
/** Multiplier for the delta time when the animation state is updated, causing time for this animation to pass slower or
* faster. Defaults to 1.
* <p>
* If <code>timeScale</code> is 0, any {@link #getMixDuration()} will be ignored.
* <p>
* See AnimationState {@link AnimationState#getTimeScale()} for affecting all animations. */
public float getTimeScale () {
return timeScale;