Package com.jme3.bounding
Class BoundingBox
java.lang.Object
com.jme3.bounding.BoundingBox
BoundingBox describes a bounding volume as an axis-aligned box.
Instances may be initialized by invoking the
containAABB method.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate aBoundingBoxwithout initializing it.BoundingBox(Vector3f c, float x, float y, float z) Instantiate aBoundingBoxwith given center and extents.BoundingBox(Vector3f min, Vector3f max) Instantiate a BoundingBox with the specified extremes. -
Method Summary
Modifier and TypeMethodDescriptionReturn the location of the center.Query extent.Determine the maximum coordinate value for each axis.Determine the minimum coordinate value for each axis.floatDetermine the X-axis distance between the center and the boundary.floatDetermine the Y-axis distance between the center and the boundary.floatDetermine the Z-axis distance between the center and the boundary.voidReconfigure with the specified extremes.voidsetXExtent(float xExtent) Alter the X-axis distance between the center and the boundary.voidsetYExtent(float yExtent) Alter the Y-axis distance between the center and the boundary.voidsetZExtent(float zExtent) Alter the Z-axis distance between the center and the boundary.
-
Constructor Details
-
BoundingBox
public BoundingBox()Instantiate aBoundingBoxwithout initializing it. -
BoundingBox
Instantiate aBoundingBoxwith given center and extents.- Parameters:
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)
-
BoundingBox
Instantiate a BoundingBox with the specified extremes.- Parameters:
min- the desired minimum coordinate value for each axis (not null, not altered)max- the desired maximum coordinate value for each axis (not null, not altered)
-
-
Method Details
-
getCenter
Return the location of the center.- Parameters:
storeResult- storage for the result (modified if not null)- Returns:
- a location vector (either
storeResultor a new vector)
-
getExtent
Query extent.- Parameters:
store- where extent gets stored - null to return a new vector- Returns:
- store / new vector
-
getXExtent
public float getXExtent()Determine the X-axis distance between the center and the boundary.- Returns:
- the distance
-
getYExtent
public float getYExtent()Determine the Y-axis distance between the center and the boundary.- Returns:
- the distance
-
getZExtent
public float getZExtent()Determine the Z-axis distance between the center and the boundary.- Returns:
- the distance
-
setXExtent
public void setXExtent(float xExtent) Alter the X-axis distance between the center and the boundary.- Parameters:
xExtent- the desired distance (≥0)
-
setYExtent
public void setYExtent(float yExtent) Alter the Y-axis distance between the center and the boundary.- Parameters:
yExtent- the desired distance (≥0)
-
setZExtent
public void setZExtent(float zExtent) Alter the Z-axis distance between the center and the boundary.- Parameters:
zExtent- the desired distance (≥0)
-
getMin
Determine the minimum coordinate value for each axis.- Parameters:
store- storage for the result (modified if not null)- Returns:
- either storeResult or a new vector
-
getMax
Determine the maximum coordinate value for each axis.- Parameters:
store- storage for the result (modified if not null)- Returns:
- either storeResult or a new vector
-
setMinMax
Reconfigure with the specified extremes.- Parameters:
min- the desired minimum coordinate value for each axis (not null, not altered)max- the desired maximum coordinate value for each axis (not null, not altered)
-