public class BoundingBox
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
BoundingBox()
Constructs a new bounding box with the minimum and maximum vector set to zeros.
|
BoundingBox(BoundingBox bounds)
Constructs a new bounding box from the given bounding box.
|
BoundingBox(Vector3 minimum,
Vector3 maximum)
Constructs the new bounding box using the given minimum and maximum vector.
|
| Modifier and Type | Method and Description |
|---|---|
BoundingBox |
clr()
Sets the minimum and maximum vector to zeros
|
boolean |
contains(BoundingBox bounds)
Returns whether the given bounding box is contained in this bounding box.
|
boolean |
contains(Vector3 v)
Returns whether the given vector is contained in this bounding box.
|
BoundingBox |
ext(BoundingBox a_bounds)
Extends this bounding box by the given bounding box.
|
BoundingBox |
ext(float x,
float y,
float z)
Extends the bounding box by the given vector.
|
BoundingBox |
ext(Vector3 point)
Extends the bounding box to incorporate the given
Vector3. |
Vector3 |
getCenter() |
Vector3[] |
getCorners() |
Vector3 |
getDimensions() |
Vector3 |
getMax() |
Vector3 |
getMin() |
BoundingBox |
inf()
Sets the minimum and maximum vector to positive and negative infinity.
|
boolean |
isValid()
Returns whether this bounding box is valid.
|
BoundingBox |
mul(Matrix4 matrix)
Multiplies the bounding box by the given matrix.
|
BoundingBox |
set(BoundingBox bounds)
Sets the given bounding box.
|
BoundingBox |
set(java.util.List<Vector3> points)
Sets the bounding box minimum and maximum vector from the given points.
|
BoundingBox |
set(Vector3[] points)
Sets the bounding box minimum and maximum vector from the given points.
|
BoundingBox |
set(Vector3 minimum,
Vector3 maximum)
Sets the given minimum and maximum vector.
|
java.lang.String |
toString() |
protected void |
updateCorners() |
public BoundingBox()
public BoundingBox(BoundingBox bounds)
bounds - The bounding box to copypublic Vector3 getCenter()
protected void updateCorners()
public Vector3[] getCorners()
public Vector3 getDimensions()
public Vector3 getMin()
public Vector3 getMax()
public BoundingBox set(BoundingBox bounds)
bounds - The bounds.public BoundingBox set(Vector3 minimum, Vector3 maximum)
minimum - The minimum vectormaximum - The maximum vectorpublic BoundingBox set(Vector3[] points)
points - The points.public BoundingBox set(java.util.List<Vector3> points)
points - The points.public BoundingBox inf()
public BoundingBox ext(Vector3 point)
Vector3.point - The vectorpublic BoundingBox clr()
public boolean isValid()
public BoundingBox ext(BoundingBox a_bounds)
a_bounds - The bounding boxpublic BoundingBox mul(Matrix4 matrix)
matrix - The matrixpublic boolean contains(BoundingBox bounds)
bounds - The bounding boxpublic boolean contains(Vector3 v)
v - The vectorpublic java.lang.String toString()
toString in class java.lang.Objectpublic BoundingBox ext(float x, float y, float z)
x - The x-coordinatey - The y-coordinatez - The z-coordinate