containsPoint method

bool containsPoint(
  1. Vector point
)

point - Vector3 to check for inclusion.

Returns true if the specified point lies within or on the boundaries of this box.

Implementation

bool containsPoint(Vector point) {
  if(point is Vector3){
    return point.x < min.x ||
          point.x > max.x ||
          point.y < min.y ||
          point.y > max.y ||
          point.z < min.z ||
          point.z > max.z
      ? false
      : true;
  }
  else{
    return point.x < min.x ||
          point.x > max.x ||
          point.y < min.y ||
          point.y > max.y
      ? false
      : true;
  }
}