circleToCircle static method

bool circleToCircle(
  1. CircleShape a,
  2. CircleShape b
)

Implementation

static bool circleToCircle(CircleShape a, CircleShape b) {
  if (!rectToRect(a.rect, b.rect)) return false;

  final distance = a.radius + b.radius;
  final w = a.center.x - b.center.x;
  final h = a.center.y - b.center.y;

  return sqrt(w * w + h * h) <= distance;
}