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
ConstructorDescriptionInstantiate aBoundingBox
without initializing it.BoundingBox
(Vector3f c, float x, float y, float z) Instantiate aBoundingBox
with 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.float
Determine the X-axis distance between the center and the boundary.float
Determine the Y-axis distance between the center and the boundary.float
Determine the Z-axis distance between the center and the boundary.void
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.
-
Constructor Details
-
BoundingBox
public BoundingBox()Instantiate aBoundingBox
without initializing it. -
BoundingBox
Instantiate aBoundingBox
with 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
storeResult
or 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)
-