testOverlap static method

bool testOverlap(
  1. AABB a,
  2. AABB b
)

Implementation

static bool testOverlap(AABB a, AABB b) {
  double d1x = b.left - a.right;
  double d1y = b.top - a.bottom;

  double d2x = a.left - b.right;
  double d2y = a.top - b.bottom;

  if (d1x > 0.0 || d1y > 0.0) {
    return false;
  }

  if (d2x > 0.0 || d2y > 0.0) {
    return false;
  }

  return true;
}