testIntersects static method

bool testIntersects(
  1. Box box1,
  2. Box box2
)

Returns true if box1 and box2 intersects.

Implementation

static bool testIntersects(Box box1, Box box2) {
  if (box1.minX > box2.maxX ||
      box1.maxX < box2.minX ||
      box1.minY > box2.maxY ||
      box1.maxY < box2.minY) {
    return false;
  }
  if (box1.is3D != box2.is3D || box1.isMeasured != box2.isMeasured) {
    return false;
  }
  if (box1.is3D && (box1.minZ! > box2.maxZ! || box1.maxZ! < box2.minZ!)) {
    return false;
  }
  if (box1.isMeasured &&
      (box1.minM! > box2.maxM! || box1.maxM! < box2.minM!)) {
    return false;
  }
  return true;
}