Limit linked list by speeding up and removing old entries instead of snapping.

This commit is contained in:
NathanSweet 2017-05-18 02:37:05 +02:00
parent be583ba96d
commit 0f944b2baf

View File

@ -142,9 +142,13 @@ public class AnimationState {
// Require mixTime > 0 to ensure the mixing from entry was applied at least once. // 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 (entry.mixTime > 0 && (entry.mixTime >= entry.mixDuration || entry.timeScale == 0)) {
if (animationCount > 6 && from.mixingFrom == null) { // Limit the mixing from linked list. if (animationCount > 5 && from.mixingFrom == null) {
entry.mixingFrom = null; // Limit linked list by speeding up and removing old entries.
queue.end(from); entry.interruptAlpha = Math.max(0, entry.interruptAlpha - delta * 0.66f);
if (entry.interruptAlpha <= 0) {
entry.mixingFrom = null;
queue.end(from);
}
} }
return finished; return finished;
} }