|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.bounding.BoundingVolume
com.jme.bounding.BoundingBox
public class 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
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jme.bounding.BoundingVolume |
---|
BoundingVolume.Type |
Field Summary | |
---|---|
float |
xExtent
|
float |
yExtent
|
float |
zExtent
|
Fields inherited from class com.jme.bounding.BoundingVolume |
---|
_compVect1, _compVect2, _compVect3, center, checkPlane |
Constructor Summary | |
---|---|
BoundingBox()
Default constructor instantiates a new BoundingBox
object. |
|
BoundingBox(Vector3f c,
float x,
float y,
float z)
Contstructor instantiates a new BoundingBox object with
given specs. |
Method Summary | |
---|---|
BoundingVolume |
clone(BoundingVolume store)
clone creates a new BoundingBox object containing the same
data as this one. |
void |
computeFromPoints(java.nio.FloatBuffer points)
computeFromPoints creates a new Bounding Box from a given
set of points. |
void |
computeFromTris(int[] indices,
TriMesh mesh,
int start,
int end)
|
void |
computeFromTris(Triangle[] tris,
int start,
int end)
computeFromTris creates a new Bounding Box from a given
set of triangles. |
void |
containAABB(java.nio.FloatBuffer 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. |
boolean |
contains(Vector3f point)
determines if a given point is contained within this bounding volume. |
float |
distanceToEdge(Vector3f point)
Find the distance from the nearest edge of this Bounding Volume to the given point. |
Vector3f |
getExtent(Vector3f store)
Query extent. |
BoundingVolume.Type |
getType()
getType returns the type of bounding volume this is. |
float |
getVolume()
|
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 |
intersectsCapsule(BoundingCapsule bc)
determines if this bounding box intersects with a given bounding capsule. |
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. |
IntersectionRecord |
intersectsWhere(Ray ray)
determines if a ray intersects this bounding volume and if so, where. |
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 |
read(JMEImporter e)
|
java.lang.String |
toString()
toString returns the string representation of this object. |
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. |
Plane.Side |
whichSide(Plane plane)
whichSide takes a plane (typically provided by a view
frustum) to determine which side this bound is on. |
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.bounding.BoundingVolume |
---|
distanceSquaredTo, distanceTo, getCenter, getCenter, getCheckPlane, getClassTag, setCenter, setCheckPlane, transform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public float xExtent
public float yExtent
public float zExtent
Constructor Detail |
---|
public BoundingBox()
BoundingBox
object.
public BoundingBox(Vector3f c, float x, float y, float z)
BoundingBox
object with
given specs.
Method Detail |
---|
public BoundingVolume.Type getType()
BoundingVolume
getType
in class BoundingVolume
public void computeFromPoints(java.nio.FloatBuffer points)
computeFromPoints
creates a new Bounding Box from a given
set of points. It uses the containAABB
method as default.
computeFromPoints
in class BoundingVolume
points
- the points to contain.public void computeFromTris(Triangle[] tris, int start, int end)
computeFromTris
creates a new Bounding Box from a given
set of triangles. It is used in OBBTree calculations.
computeFromTris
in class BoundingVolume
tris
- start
- end
- public void computeFromTris(int[] indices, TriMesh mesh, int start, int end)
computeFromTris
in class BoundingVolume
public void containAABB(java.nio.FloatBuffer 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, BoundingVolume store)
transform
modifies the center of the box to reflect the
change made via a rotation, translation and scale.
transform
in class BoundingVolume
rotate
- the rotation change.translate
- the translation change.scale
- the size change.store
- box to store result in
public Plane.Side whichSide(Plane plane)
whichSide
takes a plane (typically provided by a view
frustum) to determine which side this bound is on.
whichSide
in class BoundingVolume
plane
- the plane to check against.
public 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 class BoundingVolume
volume
- 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 class BoundingVolume
volume
- the sphere to combine with this sphere.
public BoundingVolume clone(BoundingVolume store)
clone
creates a new BoundingBox object containing the same
data as this one.
clone
in class BoundingVolume
store
- where to store the cloned information. if null or wrong class,
a new store is created.
public java.lang.String toString()
toString
returns the string representation of this object.
The form is: "Radius: RRR.SSSS Center:
toString
in class java.lang.Object
public boolean intersects(BoundingVolume bv)
intersects
in class BoundingVolume
bv
- the second volume to test against.
BoundingVolume.intersects(com.jme.bounding.BoundingVolume)
public boolean intersectsSphere(BoundingSphere bs)
intersectsSphere
in class BoundingVolume
bs
- the bounding sphere to test against.
BoundingVolume.intersectsSphere(com.jme.bounding.BoundingSphere)
public boolean intersectsBoundingBox(BoundingBox bb)
intersectsBoundingBox
in class BoundingVolume
bb
- the bounding box to test against.
BoundingVolume.intersectsBoundingBox(com.jme.bounding.BoundingBox)
public boolean intersectsOrientedBoundingBox(OrientedBoundingBox obb)
intersectsOrientedBoundingBox
in class BoundingVolume
obb
- the bounding box to test against.
BoundingVolume.intersectsOrientedBoundingBox(com.jme.bounding.OrientedBoundingBox)
public boolean intersectsCapsule(BoundingCapsule bc)
intersectsCapsule
in class BoundingVolume
bc
- the bounding capsule to test against.
BoundingVolume.intersectsCapsule(BoundingCapsule)
public boolean intersects(Ray ray)
intersects
in class BoundingVolume
ray
- the ray to test.
BoundingVolume.intersects(com.jme.math.Ray)
public IntersectionRecord intersectsWhere(Ray ray)
BoundingVolume
intersectsWhere
in class BoundingVolume
ray
- the ray to test.
BoundingVolume.intersectsWhere(com.jme.math.Ray)
public boolean contains(Vector3f point)
BoundingVolume
contains
in class BoundingVolume
point
- the point to check
public float distanceToEdge(Vector3f point)
BoundingVolume
distanceToEdge
in class BoundingVolume
point
- The point to get the distance to
public Vector3f getExtent(Vector3f store)
store
- where extent gets stored - null to return a new vector
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class BoundingVolume
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class BoundingVolume
java.io.IOException
public float getVolume()
getVolume
in class BoundingVolume
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |