intersect method

Box3 intersect(
  1. Box3 box
)

Implementation

Box3 intersect(Box3 box) {
  min.max(box.min);
  max.min(box.max);

  // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.
  if (isEmpty()) makeEmpty();

  return this;
}