extend method

void extend(
  1. AABB aabb
)

Extend this AABB so that it covers the given AABB too.

Implementation

void extend(AABB aabb) {
  lowerBound.x = math.min(lowerBound.x, aabb.lowerBound.x);
  upperBound.x = math.max(upperBound.x, aabb.upperBound.x);
  lowerBound.y = math.min(lowerBound.y, aabb.lowerBound.y);
  upperBound.y = math.max(upperBound.y, aabb.upperBound.y);
  lowerBound.z = math.min(lowerBound.z, aabb.lowerBound.z);
  upperBound.z = math.max(upperBound.z, aabb.upperBound.z);
}