Class BoundingBoxIntersection

Object
BoundingBoxIntersection

public final class BoundingBoxIntersection extends Object
Methods for checking intersection between a particular bounding-box and others.
Author:
Owen Feehan
  • Constructor Details

    • BoundingBoxIntersection

      public BoundingBoxIntersection(BoundingBox box)
  • Method Details

    • existsWith

      public boolean existsWith(BoundingBox other)
      Does intersection exist with another bounding-box?
      Parameters:
      other - the other bounding-box to test intersection with.
      Returns:
      true iff intersection exists.
    • existsWithAny

      public boolean existsWithAny(List<BoundingBox> others)
      Does intersection exist with with any of the others in the list?
      Parameters:
      others - the other bounding-boxes to test intersection with.
      Returns:
      true iff intersection exists with at least one box in others.
    • with

      public Optional<BoundingBox> with(BoundingBox other)
      Finds the intersection with another bounding-box, if it exists.
      Parameters:
      other - the bounding-box to find intersection with.
      Returns:
      a bounding-box describing the in the intersection, or Optional.empty() if no intersection exists.
    • withInside

      public Optional<BoundingBox> withInside(BoundingBox other, Extent containingExtent)
      Finds the intersection and clamp to a containing extent.
      Parameters:
      other - the bounding-box to find intersection with.
      containingExtent - the extent the intersection is clamped to.
      Returns:
      a bounding-box describing the in the intersection, or Optional.empty() if no intersection exists.