|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.math.BoundingBox
public class BoundingBox
The BoundingBox class describes a 3-dimensional rectangular box which is aligned with the coordinate axes.
Field Summary | |
---|---|
double |
maxx
|
double |
maxy
|
double |
maxz
|
double |
minx
|
double |
miny
|
double |
minz
|
Constructor Summary | |
---|---|
BoundingBox(BoundingBox b)
Create a new BoundingBox identical to another one. |
|
BoundingBox(double x1,
double x2,
double y1,
double y2,
double z1,
double z2)
Create a BoundingBox by specifying the upper and lower values along the X, Y, and Z axes. |
|
BoundingBox(Vec3 p1,
Vec3 p2)
Create a BoundingBox by specifying two opposite corners. |
Method Summary | |
---|---|
boolean |
contains(Vec3 p)
Determine whether the given point lies inside the box. |
double |
distanceToPoint(Vec3 p)
Determine the distance between a point and the closest point in the box. |
void |
extend(BoundingBox b)
Extend this bounding box to also contain the contents of another one. |
Vec3 |
getCenter()
Get a vector to the center of the box. |
Vec3[] |
getCorners()
Get an array containing the coordinates of the corners of the box. |
Vec3 |
getSize()
Get a vector containing the dimensions of the box. |
boolean |
intersects(BoundingBox b)
Determine whether two bounding boxes intersect each other. |
BoundingBox |
merge(BoundingBox b)
Return a new bounding box which contains both this box and another specified one. |
void |
outset(double dist)
Outset the bounding box by a fixed amount in every direction. |
java.lang.String |
toString()
|
BoundingBox |
transformAndOutset(Mat4 m)
This method applies a transformation matrix M to each of the eight corners of the box, then generates a new BoundingBox which is large enough to contain the transformed box. |
BoundingBox |
translate(double dx,
double dy,
double dz)
Return a new bounding box which is translated from this one by the specified amount. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double minx
public double maxx
public double miny
public double maxy
public double minz
public double maxz
Constructor Detail |
---|
public BoundingBox(double x1, double x2, double y1, double y2, double z1, double z2)
public BoundingBox(Vec3 p1, Vec3 p2)
public BoundingBox(BoundingBox b)
Method Detail |
---|
public Vec3 getSize()
public Vec3 getCenter()
public Vec3[] getCorners()
public BoundingBox merge(BoundingBox b)
public void extend(BoundingBox b)
public final boolean contains(Vec3 p)
public final boolean intersects(BoundingBox b)
public final double distanceToPoint(Vec3 p)
public final void outset(double dist)
public final BoundingBox translate(double dx, double dy, double dz)
public final BoundingBox transformAndOutset(Mat4 m)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |