testIntersectsPoint static method

bool testIntersectsPoint(
  1. Box box,
  2. Position point
)

Returns true if box intesects with point.

Implementation

static bool testIntersectsPoint(Box box, Position point) {
  if (box.minX > point.x ||
      box.maxX < point.x ||
      box.minY > point.y ||
      box.maxY < point.y) {
    return false;
  }
  if (box.is3D != point.is3D || box.isMeasured != point.isMeasured) {
    return false;
  }
  if (box.is3D && (box.minZ! > point.z || box.maxZ! < point.z)) {
    return false;
  }
  if (box.isMeasured && (box.minM! > point.m || box.maxM! < point.m)) {
    return false;
  }
  return true;
}