|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Geometry
com.jme.scene.TriMesh
com.jme.scene.shape.Box
com.jme.bounding.BoundingBox
BoundingBox defines an axis-aligned cube that defines a
container for a group of vertices of a particular piece of geometry. This box
defines a center and extents from that center along the x, y and z axis.
A typical usage is to allow the class define the center and radius by calling
either containAABB or averagePoints. A call to
computeFramePoint in turn calls containAABB.
| Field Summary | |
int[] |
checkPlanes
These define the array of planes that are check during view culling. |
| Fields inherited from class com.jme.scene.shape.Box |
AXIS_X, AXIS_Y, AXIS_Z, center, xExtent, yExtent, zExtent |
| Fields inherited from class com.jme.scene.TriMesh |
indices, triangleQuantity |
| Fields inherited from class com.jme.scene.Geometry |
bound, color, colorBuf, normal, normBuf, texBuf, texture, vertBuf, vertex, vertQuantity |
| Fields inherited from class com.jme.scene.Spatial |
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
| Constructor Summary | |
BoundingBox()
Default contstructor instantiates a new BoundingBox
object. |
|
BoundingBox(java.lang.String name)
Contstructor instantiates a new BoundingBox object with
given specs. |
|
BoundingBox(java.lang.String name,
Vector3f center,
float xExtent,
float yExtent,
float zExtent)
Contstructor instantiates a new BoundingBox object with
given specs. |
|
BoundingBox(Vector3f center,
float xExtent,
float yExtent,
float zExtent)
Contstructor instantiates a new BoundingBox object with
given specs. |
|
| Method Summary | |
java.lang.Object |
clone(BoundingVolume store)
clone creates a new BoundingBox object containing the same
data as this one. |
void |
computeFromPoints(Vector3f[] points)
computeFromPoints creates a new Bounding Box from a given
set of points. |
void |
containAABB(Vector3f[] points)
containAABB creates a minimum-volume axis-aligned bounding
box of the points, then selects the smallest enclosing sphere of the box
with the sphere centered at the boxes center. |
float |
distanceTo(Vector3f point)
Find the distance from the center of this Bounding Volume to the given point. |
Vector3f |
getCenter(Vector3f store)
Stores the current center of this BoundingBox into the store vector. |
int |
getCheckPlane(int index)
getCheckPlane returns a specific check plane. |
Vector3f |
getOrigCenter()
Returns the original, unrotated center of the bounding box. |
Vector3f |
getOrigExtent()
Gets the original, unrotated extent of the box. |
void |
initCheckPlanes()
Not to be called by users. |
boolean |
intersects(BoundingVolume bv)
intersects determines if this Bounding Box intersects with another given bounding volume. |
boolean |
intersects(Ray ray)
determines if this bounding box intersects with a given ray object. |
boolean |
intersectsBoundingBox(BoundingBox bb)
determines if this bounding box intersects a given bounding box. |
boolean |
intersectsOBB2(OBB2 obb)
determines if this bounding box intersects with a given OBB2 bounding. |
boolean |
intersectsOrientedBoundingBox(OrientedBoundingBox obb)
determines if this bounding box intersects with a given oriented bounding box. |
boolean |
intersectsSphere(BoundingSphere bs)
determines if this bounding box intersects a given bounding sphere. |
BoundingVolume |
merge(BoundingVolume volume)
merge combines this sphere with a second bounding sphere. |
BoundingVolume |
mergeLocal(BoundingVolume volume)
mergeLocal combines this sphere with a second bounding
sphere locally. |
void |
recomputeMesh()
recomputeMesh regenerates the BoundingBox
based on new model information. |
void |
setCheckPlane(int index,
int value)
setCheckPlane indentifies the value of one of the spheres
checked planes. |
void |
setOrigCenter(Vector3f origCenter)
Sets the bounding box's original center. |
void |
setOrigExtent(Vector3f origExtent)
Sets the box's original extent. |
java.lang.String |
toString()
toString returns the string representation of this object. |
BoundingVolume |
transform(Quaternion rotate,
Vector3f translate,
Vector3f scale)
transform modifies the center of the box to reflect the
change made via a rotation, translation and scale. |
BoundingVolume |
transform(Quaternion rotate,
Vector3f translate,
Vector3f scale,
BoundingVolume store)
transform modifies the center of the box to reflect the
change made via a rotation, translation and scale. |
int |
whichSide(Plane plane)
whichSide takes a plane (typically provided by a view
frustum) to determine which side this bound is on. |
| Methods inherited from class com.jme.scene.shape.Box |
clone, computeVertices, getCenter, setCenter, setData, setData |
| Methods inherited from class com.jme.scene.TriMesh |
clearBuffers, draw, drawBounds, findCollisions, findTriangleCollision, findTrianglePick, findWorldRotMat, getIndexAsBuffer, getIndices, getMeshAsTriangles, getTriangle, getTriangle, getTriangleQuantity, hasCollision, hasTriangleCollision, putClone, reconstruct, setIndexBuffer, setIndices, updateCollisionTree, updateIndexBuffer |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int[] checkPlanes
| Constructor Detail |
public BoundingBox()
BoundingBox
object.
public BoundingBox(java.lang.String name)
BoundingBox object with
given specs.
public BoundingBox(Vector3f center,
float xExtent,
float yExtent,
float zExtent)
BoundingBox object with
given specs.
public BoundingBox(java.lang.String name,
Vector3f center,
float xExtent,
float yExtent,
float zExtent)
BoundingBox object with
given specs.
| Method Detail |
public void initCheckPlanes()
initCheckPlanes in interface BoundingVolumepublic void computeFromPoints(Vector3f[] points)
computeFromPoints creates a new Bounding Box from a given
set of points. It uses the containAABB method as default.
computeFromPoints in interface BoundingVolumepoints - the points to contain.public void containAABB(Vector3f[] points)
containAABB creates a minimum-volume axis-aligned bounding
box of the points, then selects the smallest enclosing sphere of the box
with the sphere centered at the boxes center.
points - the list of points.
public BoundingVolume transform(Quaternion rotate,
Vector3f translate,
Vector3f scale)
transform modifies the center of the box to reflect the
change made via a rotation, translation and scale.
transform in interface BoundingVolumerotate - the rotation change.translate - the translation change.scale - the size change.
public BoundingVolume transform(Quaternion rotate,
Vector3f translate,
Vector3f scale,
BoundingVolume store)
transform modifies the center of the box to reflect the
change made via a rotation, translation and scale.
transform in interface BoundingVolumerotate - the rotation change.translate - the translation change.scale - the size change.store - box to store result in
public int whichSide(Plane plane)
whichSide takes a plane (typically provided by a view
frustum) to determine which side this bound is on.
whichSide in interface BoundingVolumeplane - the plane to check against.
Pointpublic BoundingVolume merge(BoundingVolume volume)
merge combines this sphere with a second bounding sphere.
This new sphere contains both bounding spheres and is returned.
merge in interface BoundingVolumevolume - the sphere to combine with this sphere.
public BoundingVolume mergeLocal(BoundingVolume volume)
mergeLocal combines this sphere with a second bounding
sphere locally. Altering this sphere to contain both the original and the
additional sphere volumes;
mergeLocal in interface BoundingVolumevolume - the sphere to combine with this sphere.
public java.lang.Object clone(BoundingVolume store)
clone creates a new BoundingBox object containing the same
data as this one.
clone in interface BoundingVolumestore - where to store the cloned information. if null or wrong class,
a new store is created.
public int getCheckPlane(int index)
getCheckPlane returns a specific check plane. This plane
identitifies the previous value of the visibility check.
getCheckPlane in interface BoundingVolumeindex -
public void setCheckPlane(int index,
int value)
setCheckPlane indentifies the value of one of the spheres
checked planes. That is what plane of the view frustum has been checked
for intersection.
setCheckPlane in interface BoundingVolumeindex - value - public void recomputeMesh()
recomputeMesh regenerates the BoundingBox
based on new model information.
recomputeMesh in interface BoundingVolumepublic float distanceTo(Vector3f point)
distanceTo in interface BoundingVolumepoint - The point to get the distance to
public Vector3f getCenter(Vector3f store)
getCenter in interface BoundingVolumestore - The vector to store the center into.
public java.lang.String toString()
toString returns the string representation of this object.
The form is: "Radius: RRR.SSSS Center:
toString in class Spatialpublic Vector3f getOrigCenter()
public void setOrigCenter(Vector3f origCenter)
origCenter - New original centercomputeFromPoints(com.jme.math.Vector3f[])public Vector3f getOrigExtent()
public void setOrigExtent(Vector3f origExtent)
origExtent - The new extent.computeFromPoints(com.jme.math.Vector3f[])public boolean intersects(BoundingVolume bv)
intersects in interface BoundingVolumebv - the second volume to test against.
BoundingVolume.intersects(com.jme.bounding.BoundingVolume)public boolean intersectsSphere(BoundingSphere bs)
intersectsSphere in interface BoundingVolumebs - the bounding sphere to test against.
BoundingVolume.intersectsSphere(com.jme.bounding.BoundingSphere)public boolean intersectsBoundingBox(BoundingBox bb)
intersectsBoundingBox in interface BoundingVolumebb - the bounding box to test against.
BoundingVolume.intersectsBoundingBox(com.jme.bounding.BoundingBox)public boolean intersectsOrientedBoundingBox(OrientedBoundingBox obb)
intersectsOrientedBoundingBox in interface BoundingVolumeobb - the bounding box to test against.
BoundingVolume.intersectsOrientedBoundingBox(com.jme.bounding.OrientedBoundingBox)public boolean intersectsOBB2(OBB2 obb)
intersectsOBB2 in interface BoundingVolumeobb - the bounding box to test against.
BoundingVolume.intersectsOBB2(com.jme.bounding.OBB2)public boolean intersects(Ray ray)
intersects in interface BoundingVolumeray - the ray to test.
BoundingVolume.intersects(com.jme.math.Ray)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||