combine2 method

void combine2(
  1. AABB aabb1,
  2. AABB aab
)

Combine two AABBs into this one.

Implementation

void combine2(final AABB aabb1, final AABB aab) {
  lowerBound.x = aabb1.lowerBound.x < aab.lowerBound.x
      ? aabb1.lowerBound.x
      : aab.lowerBound.x;
  lowerBound.y = aabb1.lowerBound.y < aab.lowerBound.y
      ? aabb1.lowerBound.y
      : aab.lowerBound.y;
  upperBound.x = aabb1.upperBound.x > aab.upperBound.x
      ? aabb1.upperBound.x
      : aab.upperBound.x;
  upperBound.y = aabb1.upperBound.y > aab.upperBound.y
      ? aabb1.upperBound.y
      : aab.upperBound.y;
}