public class BoundingBox
extends java.lang.Object
BoundingBox describes a bounding volume as an axis-aligned box.
containAABB method.| Constructor and Description |
|---|
BoundingBox()
Instantiate a
BoundingBox without initializing it. |
BoundingBox(Vector3f c,
float x,
float y,
float z)
Instantiate a
BoundingBox with given center and extents. |
BoundingBox(Vector3f min,
Vector3f max)
Instantiate a BoundingBox with the specified extremes.
|
| Modifier and Type | Method and Description |
|---|---|
Vector3f |
getCenter(Vector3f storeResult)
Return the location of the center.
|
Vector3f |
getExtent(Vector3f store)
Query extent.
|
Vector3f |
getMax(Vector3f store)
Determine the maximum coordinate value for each axis.
|
Vector3f |
getMin(Vector3f store)
Determine the minimum coordinate value for each axis.
|
float |
getXExtent()
Determine the X-axis distance between the center and the boundary.
|
float |
getYExtent()
Determine the Y-axis distance between the center and the boundary.
|
float |
getZExtent()
Determine the Z-axis distance between the center and the boundary.
|
void |
setMinMax(Vector3f min,
Vector3f max)
Reconfigure with the specified extremes.
|
void |
setXExtent(float xExtent)
Alter the X-axis distance between the center and the boundary.
|
void |
setYExtent(float yExtent)
Alter the Y-axis distance between the center and the boundary.
|
void |
setZExtent(float zExtent)
Alter the Z-axis distance between the center and the boundary.
|
public BoundingBox()
BoundingBox without initializing it.public BoundingBox(Vector3f c, float x, float y, float z)
BoundingBox with given center and extents.c - the coordinates of the center of the box (not null, not altered)x - the X-extent of the box (0 or greater, may be +Infinity)y - the Y-extent of the box (0 or greater, may be +Infinity)z - the Z-extent of the box (0 or greater, may be +Infinity)public Vector3f getCenter(Vector3f storeResult)
storeResult - storage for the result (modified if not null)storeResult or a new vector)public Vector3f getExtent(Vector3f store)
store - where extent gets stored - null to return a new vectorpublic float getXExtent()
public float getYExtent()
public float getZExtent()
public void setXExtent(float xExtent)
xExtent - the desired distance (≥0)public void setYExtent(float yExtent)
yExtent - the desired distance (≥0)public void setZExtent(float zExtent)
zExtent - the desired distance (≥0)public Vector3f getMin(Vector3f store)
store - storage for the result (modified if not null)public Vector3f getMax(Vector3f store)
store - storage for the result (modified if not null)