updateMixingFrom method

bool updateMixingFrom(
  1. TrackEntry to,
  2. double delta
)

Implementation

bool updateMixingFrom(TrackEntry to, double delta) {
  final TrackEntry? from = to.mixingFrom;
  if (from == null) return true;

  final bool finished = updateMixingFrom(from, delta);

  // Require mixTime > 0 to ensure the mixing from entry was applied at least once.
  if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
    // Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
    if (from.totalAlpha == 0 || to.mixDuration == 0) {
      to
        ..mixingFrom = from.mixingFrom
        ..interruptAlpha = from.interruptAlpha;
      queue.end(from);
    }
    return finished;
  }

  from
    ..animationLast = from.nextAnimationLast
    ..trackLast = from.nextTrackLast
    ..trackTime = from.trackTime + delta * from.timeScale;
  to.mixTime = to.mixTime + delta * to.timeScale;
  return false;
}