public class BoundingBox
extends java.lang.Object
Constructor and Description |
---|
BoundingBox() |
Modifier and Type | Method and Description |
---|---|
double |
distanceTo(Vec3 point) |
boolean |
intersectsFrustum(Frustum frustum)
Indicates whether this bounding box intersects a specified frustum.
|
boolean |
isUnitBox()
Indicates whether this bounding box is a unit box centered at the Cartesian origin (0, 0, 0).
|
BoundingBox |
setToPoints(float[] array,
int count,
int stride)
Sets this bounding box such that it minimally encloses a specified array of points.
|
BoundingBox |
setToSector(Sector sector,
Globe globe,
float minHeight,
float maxHeight)
Sets this bounding box such that it contains a specified sector on a specified globe with min and max terrain
height.
|
BoundingBox |
setToUnitBox()
Sets this bounding box to a unit box centered at the Cartesian origin (0, 0, 0).
|
java.lang.String |
toString() |
BoundingBox |
translate(double x,
double y,
double z)
Translates this bounding box by specified components.
|
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isUnitBox()
public BoundingBox setToUnitBox()
public BoundingBox setToPoints(float[] array, int count, int stride)
array
- the array of points to considercount
- the number of array elements to considerstride
- the number of coordinates between the first coordinate of adjacent points - must be at least 3java.lang.IllegalArgumentException
- If the array is null or empty, if the count is less than 0, or if the stride is
less than 3public BoundingBox setToSector(Sector sector, Globe globe, float minHeight, float maxHeight)
sector
- the sector for which to create the bounding boxglobe
- the globe associated with the sectorminHeight
- the minimum terrain height within the sectormaxHeight
- the maximum terrain height within the sectorjava.lang.IllegalArgumentException
- If any argument is nullpublic BoundingBox translate(double x, double y, double z)
x
- the X translation componenty
- the Y translation componentz
- the Z translation componentpublic double distanceTo(Vec3 point)
public boolean intersectsFrustum(Frustum frustum)
frustum
- The frustum of interest.java.lang.IllegalArgumentException
- If the specified frustum is null or undefined.