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,
double minElevation,
double maxElevation)
Sets this bounding box such that it contains a specified sector on a specified globe with min and max elevation.
|
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, double minElevation, double maxElevation)
sector
- The sector for which to create the bounding box.globe
- The globe associated with the sector.minElevation
- The minimum elevation within the sector.maxElevation
- The maximum elevation within the sector.java.lang.IllegalArgumentException
- If either the specified sector or globe is null or undefined.public 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.