Package org.faceless.graph
Class BoundingBox
- java.lang.Object
-
- org.faceless.graph.BoundingBox
-
public final class BoundingBox extends java.lang.Object
A
BoundingBox
is a simple cube which is used to define the "Bounding Box", or the smallest cube that contains a object, on aCanvas
.This class is used internally by the library and is of no interest to end users
-
-
Constructor Summary
Constructors Constructor Description BoundingBox(Point[] p)
BoundingBox(Point p1, Point p2)
Create a new Bounding Box with one corner at p1 and the other at p2
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Point
center()
Return the center of the boxboolean
contains(BoundingBox b)
Returns true if this contains the specified bounding box.void
expand(Point p)
Expand a box to include the specified pointdouble
getDepth()
Return the depth of this boxdouble
getHeight()
Return the height of this boxdouble
getMaxX()
Return the hightest X value of this boxdouble
getMaxY()
Return the hightest Y value of this boxdouble
getMaxZ()
Return the hightest Z value of this boxdouble
getMinX()
Return the lowest X value of this boxdouble
getMinY()
Return the lowest Y value of this boxdouble
getMinZ()
Return the lowest Z value of this boxdouble
getWidth()
Return the width of this boxBoundingBox
intersection(BoundingBox b)
Return a new bounding box that is the intersection of this and the specified box.BoundingBox
superset(BoundingBox b)
Return the smallest bounding box that contains this box and the box passed as a parameter.java.lang.String
toString()
-
-
-
Method Detail
-
expand
public void expand(Point p)
Expand a box to include the specified point
-
contains
public boolean contains(BoundingBox b)
Returns true if this contains the specified bounding box.
-
superset
public BoundingBox superset(BoundingBox b)
Return the smallest bounding box that contains this box and the box passed as a parameter.
-
intersection
public BoundingBox intersection(BoundingBox b)
Return a new bounding box that is the intersection of this and the specified box. Returns null if no intersection exists
-
center
public Point center()
Return the center of the box
-
getMinX
public double getMinX()
Return the lowest X value of this box
-
getMinY
public double getMinY()
Return the lowest Y value of this box
-
getMinZ
public double getMinZ()
Return the lowest Z value of this box
-
getMaxX
public double getMaxX()
Return the hightest X value of this box
-
getMaxY
public double getMaxY()
Return the hightest Y value of this box
-
getMaxZ
public double getMaxZ()
Return the hightest Z value of this box
-
getWidth
public double getWidth()
Return the width of this box
-
getHeight
public double getHeight()
Return the height of this box
-
getDepth
public double getDepth()
Return the depth of this box
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-