intersectsBox method

bool intersectsBox(
  1. Box2 box
)

Implementation

bool intersectsBox(Box2 box) {
  // using 4 splitting planes to rule out intersections

  return box.max.x < min.x ||
          box.min.x > max.x ||
          box.max.y < min.y ||
          box.min.y > max.y
      ? false
      : true;
}