Class BoundingBoxFactory

Object
BoundingBoxFactory

public class BoundingBoxFactory extends Object
Utility methods to create a BoundingBox.
Author:
Owen Feehan
  • Method Summary

    Modifier and Type
    Method
    Description
    at(int x, int y, int width, int height)
    Short-hand factory method for creating a 2D bounding-box.
    at(int x, int y, int z, int width, int height, int depth)
    Short-hand factory method for creating a 3D bounding-box.
    uniform3D(int corner, int extent)
    Short-hand factory method for creating a 3D bounding-box, where a coordinate is identical in each dimension.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • at

      public static BoundingBox at(int x, int y, int width, int height)
      Short-hand factory method for creating a 2D bounding-box.
      Parameters:
      x - left-corner in x-dimension
      y - left-corner in y-dimension
      width - bounding-box width (extent in x-dimension)
      height - bounding-box width (extent in y-dimension)
      Returns:
      the newly created bounding-box
    • at

      public static BoundingBox at(int x, int y, int z, int width, int height, int depth)
      Short-hand factory method for creating a 3D bounding-box.
      Parameters:
      x - left-corner in x-dimension
      y - left-corner in y-dimension
      z - left-corner in z-dimension
      width - bounding-box width (extent in x-dimension)
      height - bounding-box width (extent in y-dimension)
      depth - bounding-box width (extent in z-dimension)
      Returns:
      the newly created bounding-box
    • uniform3D

      public static BoundingBox uniform3D(int corner, int extent)
      Short-hand factory method for creating a 3D bounding-box, where a coordinate is identical in each dimension.
      Parameters:
      corner - left-corner in every dimension
      extent - extent in every dimension
      Returns:
      the newly created bounding-box