Package com.jme3.bounding
Class BoundingVolume
java.lang.Object
com.jme3.bounding.BoundingVolume
- All Implemented Interfaces:
- Collidable,- Savable,- Cloneable
- Direct Known Subclasses:
- BoundingBox,- BoundingSphere
BoundingVolume defines an interface for dealing with
 containment of a collection of points.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumThe type of bounding volume being used.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()abstract BoundingVolumeclone(BoundingVolume store) clonecreates a new BoundingVolume object containing the same data as this one.intcollideWith(Collidable other) abstract voidcomputeFromPoints(FloatBuffer points) computeFromPointsgenerates a bounding volume that encompasses a collection of points.abstract booleandetermines if a given point is contained within this bounding volume.final floatdistanceSquaredTo(Vector3f point) Find the squared distance from the center of this Bounding Volume to the given point.final floatdistanceTo(Vector3f point) Find the distance from the center of this Bounding Volume to the given point.abstract floatdistanceToEdge(Vector3f point) Find the distance from the nearest edge of this Bounding Volume to the given point.final Vector3ffinal Vector3fintGrabs the plane we should check first.abstract BoundingVolume.TypegetType()getType returns the type of bounding volume this is.abstract floatabstract booleandetermines if this bounding volume and a second given volume are intersecting.abstract booleanintersects(Ray ray) determines if a ray intersects this bounding volume.abstract booleanintersects(Vector3f point) Determines if a given point intersects (touches or is inside) this bounding volume.abstract booleandetermines if this bounding volume and a given bounding box are intersecting.abstract booleandetermines if this bounding volume and a given bounding sphere are intersecting.abstract BoundingVolumemerge(BoundingVolume volume) mergecombines two bounding volumes into a single bounding volume that contains both this bounding volume and the parameter volume.abstract BoundingVolumemergeLocal(BoundingVolume volume) mergeLocalcombines two bounding volumes into a single bounding volume that contains both this bounding volume and the parameter volume.voidread(JmeImporter importer) final voidsetCenter(float x, float y, float z) final voidfinal voidsetCheckPlane(int value) Sets the index of the plane that should be first checked during rendering.abstract BoundingVolumetransform(Matrix4f trans, BoundingVolume store) final BoundingVolumetransformalters the location of the bounding volume by a rotation, translation and a scalar.abstract BoundingVolumetransform(Transform trans, BoundingVolume store) transformalters the location of the bounding volume by a rotation, translation and a scalar.abstract Plane.SidewhichSidereturns the side on which the bounding volume lies on a plane.voidwrite(JmeExporter e) Methods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.collision.CollidablecollideWith
- 
Field Details- 
checkPlaneprotected int checkPlane
- 
center
 
- 
- 
Constructor Details- 
BoundingVolumepublic BoundingVolume()
- 
BoundingVolume
 
- 
- 
Method Details- 
getCheckPlanepublic int getCheckPlane()Grabs the plane we should check first.- Returns:
- the index of the plane to be checked first
 
- 
setCheckPlanepublic final void setCheckPlane(int value) Sets the index of the plane that should be first checked during rendering.- Parameters:
- value- the index of the plane to be checked first
 
- 
getTypegetType returns the type of bounding volume this is.- Returns:
- an enum value
 
- 
transformtransformalters the location of the bounding volume by a rotation, translation and a scalar.- Parameters:
- trans- the transform to affect the bound.
- Returns:
- the new bounding volume.
 
- 
transformtransformalters the location of the bounding volume by a rotation, translation and a scalar.- Parameters:
- trans- the transform to affect the bound.
- store- bounding volume to store result in
- Returns:
- the new bounding volume.
 
- 
transform
- 
whichSidewhichSidereturns the side on which the bounding volume lies on a plane. Possible values are POSITIVE_SIDE, NEGATIVE_SIDE, and NO_SIDE.- Parameters:
- plane- the plane to check against this bounding volume.
- Returns:
- the side on which this bounding volume lies.
 
- 
computeFromPointscomputeFromPointsgenerates a bounding volume that encompasses a collection of points.- Parameters:
- points- the points to contain.
 
- 
mergemergecombines two bounding volumes into a single bounding volume that contains both this bounding volume and the parameter volume.- Parameters:
- volume- the volume to combine.
- Returns:
- the new merged bounding volume.
 
- 
mergeLocalmergeLocalcombines two bounding volumes into a single bounding volume that contains both this bounding volume and the parameter volume. The result is stored locally.- Parameters:
- volume- the volume to combine.
- Returns:
- this
 
- 
cloneclonecreates a new BoundingVolume object containing the same data as this one.- Parameters:
- store- where to store the cloned information. if null or wrong class, a new store is created.
- Returns:
- the new BoundingVolume
 
- 
getCenter
- 
getCenter
- 
setCenter
- 
setCenterpublic final void setCenter(float x, float y, float z) 
- 
distanceToFind the distance from the center of this Bounding Volume to the given point.- Parameters:
- point- The point to get the distance to
- Returns:
- distance
 
- 
distanceSquaredToFind the squared distance from the center of this Bounding Volume to the given point.- Parameters:
- point- The point to get the distance to
- Returns:
- distance
 
- 
distanceToEdgeFind the distance from the nearest edge of this Bounding Volume to the given point.- Parameters:
- point- The point to get the distance to
- Returns:
- distance
 
- 
intersectsdetermines if this bounding volume and a second given volume are intersecting. Intersecting being: one volume contains another, one volume overlaps another or one volume touches another.- Parameters:
- bv- the second volume to test against.
- Returns:
- true if this volume intersects the given volume.
 
- 
intersectsdetermines if a ray intersects this bounding volume.- Parameters:
- ray- the ray to test.
- Returns:
- true if this volume is intersected by a given ray.
 
- 
intersectsSpheredetermines if this bounding volume and a given bounding sphere are intersecting.- Parameters:
- bs- the bounding sphere to test against.
- Returns:
- true if this volume intersects the given bounding sphere.
 
- 
intersectsBoundingBoxdetermines if this bounding volume and a given bounding box are intersecting.- Parameters:
- bb- the bounding box to test against.
- Returns:
- true if this volume intersects the given bounding box.
 
- 
containsdetermines if a given point is contained within this bounding volume. If the point is on the edge of the bounding volume, this method will return false. Use intersects(Vector3f) to check for edge intersection.- Parameters:
- point- the point to check
- Returns:
- true if the point lies within this bounding volume.
 
- 
intersectsDetermines if a given point intersects (touches or is inside) this bounding volume.- Parameters:
- point- the point to check
- Returns:
- true if the point lies within this bounding volume.
 
- 
getVolumepublic abstract float getVolume()
- 
clone
- 
write- Specified by:
- writein interface- Savable
- Throws:
- IOException
 
- 
read- Specified by:
- readin interface- Savable
- Throws:
- IOException
 
- 
collideWith
 
-