Fixed interruptAlpha NaN when there is no mixingFrom.

This commit is contained in:
NathanSweet 2017-05-17 02:12:19 +02:00
parent 6140ea31e9
commit 2349356584

View File

@ -414,7 +414,11 @@ public class AnimationState {
if (interrupt) queue.interrupt(from);
current.mixingFrom = from;
current.mixTime = 0;
current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); // Store interrupted mix percentage.
// Store the interrupted mix percentage.
if (from.mixingFrom != null && from.mixDuration > 0)
current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);
from.timelinesRotation.clear(); // Reset rotation for mixing out, in case entry was mixed in.
}