Class BoundingBoxContains

Object
BoundingBoxContains

public final class BoundingBoxContains extends Object
Does a bounding box contain other objects?

The other objects can be points, other bounding boxes etc.

Author:
Owen Feehan
  • Constructor Details

    • BoundingBoxContains

      public BoundingBoxContains(BoundingBox box)
      Create with the BoundingBox that is queried.
      Parameters:
      box - the bounding-box to query whether other entities are contained within it.
  • Method Details

    • x

      public boolean x(int value)
      Is this value in the X-dimension within the bounding box range?
      Parameters:
      value - a value to be tested whether it lies within the bounding-box on the X-axis.
      Returns:
      true iff the value is within the range.
    • y

      public boolean y(int value)
      Is this value in the Y-dimension within the bounding box range?
      Parameters:
      value - a value to be tested whether it lies within the bounding-box on the Y-axis.
      Returns:
      true iff the value is within the range.
    • z

      public boolean z(int value)
      Is this value in the Z-dimension within the bounding box range?
      Parameters:
      value - a value to be tested whether it lies within the bounding-box on the Z-axis.
      Returns:
      true iff the value is within the range.
    • point

      public boolean point(ReadableTuple3i point)
      Is this point within the bounding-box?
      Parameters:
      point - point to test whether it lies within the bounding-box.
      Returns:
      true iff the point lies inside the bounding-box.
    • pointIgnoreZ

      public boolean pointIgnoreZ(Point3i point)
      Like point(ReadableTuple3i) but ignores the z-dimension.
      Parameters:
      point - point to test whether it lies within the bounding-box.
      Returns:
      true iff the point lies inside the bounding-box, disregarding the z-dimension.
    • box

      public boolean box(BoundingBox maybeContainedInside)
      Is this other bounding-box fully contained within this bounding box?
      Parameters:
      maybeContainedInside - box to test whether it is contained inside or not.
      Returns:
      true iff the maybeContainedInside entirely lies inside the bounding-box.