lerpResolved static method

AnyCorner lerpResolved(
  1. AnyCorner a,
  2. AnyCorner b,
  3. double t
)

Implementation

static AnyCorner lerpResolved(AnyCorner a, AnyCorner b, double t) {
  if (identical(a, b) || a == b) return a;

  if (t <= 0.0) return a;
  if (t >= 1.0) return b;

  if (a.runtimeType == b.runtimeType) {
    return a.lerpTo(b, t);
  }

  if (t < 0.5) {
    return a * ((0.5 - t) / 0.5);
  }

  return b * ((t - 0.5) / 0.5);
}