|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.Bounds
javax.media.j3d.BoundingBox
public class BoundingBox
This class defines an axis aligned bounding box which is used for bounding regions.
Field Summary | |
---|---|
private Point3d |
centroid
|
private static double |
EPS
|
(package private) Point3d |
lower
The corner of the bounding box with the numerically smallest values. |
private static boolean |
releaseBoundingBoxMemory
|
private BoundingBox |
tmpBox
|
private Point3d |
tmpP3d
|
private BoundingPolytope |
tmpPolytope
|
private BoundingSphere |
tmpSphere
|
(package private) Point3d |
upper
The corner of the bounding box with the numerically largest values. |
Fields inherited from class javax.media.j3d.Bounds |
---|
boundId, BOUNDING_BOX, BOUNDING_POLYTOPE, BOUNDING_SPHERE, boundsIsEmpty, boundsIsInfinite, debug, EPSILON |
Constructor Summary | |
---|---|
BoundingBox()
Constructs and initializes a 2X bounding box about the origin. |
|
BoundingBox(Bounds boundsObject)
Constructs a BoundingBox from a bounding object. |
|
BoundingBox(Bounds[] bounds)
Constructs a BoundingBox from an array of bounding objects. |
|
BoundingBox(Point3d lower,
Point3d upper)
Constructs and initializes a BoundingBox given min,max in x,y,z. |
Method Summary | |
---|---|
(package private) boolean |
checkBoundsIsNaN()
|
java.lang.Object |
clone()
Creates a copy of this bounding box. |
Bounds |
closestIntersection(Bounds[] boundsObjects)
Finds closest bounding object that intersects this bounding box. |
void |
combine(Bounds boundsObject)
Combines this bounding box with a bounding object so that the resulting bounding box encloses the original bounding box and the specified bounds object. |
void |
combine(Bounds[] bounds)
Combines this bounding box with an array of bounding objects so that the resulting bounding box encloses the original bounding box and the array of bounding objects. |
void |
combine(Point3d point)
Combines this bounding box with a point so that the resulting bounding box encloses the original bounding box and the point. |
void |
combine(Point3d[] points)
Combines this bounding box with an array of points so that the resulting bounding box encloses the original bounding box and the array of points. |
(package private) Bounds |
copy(Bounds r)
if the passed the "region" is same type as this object then do a copy, otherwise clone the Bounds and return |
boolean |
equals(java.lang.Object bounds)
Indicates whether the specified bounds object is
equal to this BoundingBox object. |
(package private) Point3d |
getCenter()
Returns the center of the bounds |
void |
getLower(Point3d p1)
Gets the lower corner of this bounding box. |
(package private) int |
getPickType()
|
void |
getUpper(Point3d p1)
Gets the upper corner of this bounding box. |
int |
hashCode()
Returns a hash code value for this BoundingBox object based on the data values in this object. |
boolean |
intersect(Bounds boundsObject)
Test for intersection with another bounds object. |
boolean |
intersect(Bounds[] boundsObjects)
Test for intersection with an array of bounds objects. |
boolean |
intersect(Bounds[] boundsObjects,
BoundingBox newBoundBox)
Test for intersection with an array of bounds objects. |
boolean |
intersect(Bounds boundsObject,
BoundingBox newBoundBox)
Test for intersection with another bounding box. |
(package private) boolean |
intersect(Bounds boundsObject,
Point4d position)
Test for intersection with another bounds object. |
(package private) boolean |
intersect(CachedFrustum frustum)
Tests for intersection of box and frustum. |
boolean |
intersect(Point3d point)
Test for intersection with a point. |
(package private) boolean |
intersect(Point3d start,
Point3d end,
Point4d position)
Test for intersection with a segment. |
(package private) boolean |
intersect(Point3d point,
Point4d position)
Test for intersection with a point. |
boolean |
intersect(Point3d origin,
Vector3d direction)
Test for intersection with a ray. |
(package private) boolean |
intersect(Point3d origin,
Vector3d direction,
Point3d intersect)
A protected intersect method that returns the point of intersection. |
(package private) boolean |
intersect(Point3d origin,
Vector3d direction,
Point4d position)
Test for intersection with a ray. |
boolean |
isEmpty()
Tests whether the bounding box is empty. |
void |
set(Bounds boundsObject)
Sets the the value of this BoundingBox |
void |
setLower(double xmin,
double ymin,
double zmin)
Sets the lower corner of this bounding box. |
void |
setLower(Point3d p1)
Sets the lower corner of this bounding box. |
void |
setUpper(double xmax,
double ymax,
double zmax)
Sets the upper corner of this bounding box. |
void |
setUpper(Point3d p1)
Sets the upper corner of this bounding box. |
java.lang.String |
toString()
Returns a string representation of this class. |
void |
transform(Bounds boundsObject,
Transform3D matrix)
Modifies the bounding box so that it bounds the volume generated by transforming the given bounding object. |
void |
transform(Transform3D matrix)
Transforms this bounding box by the given matrix. |
(package private) void |
translate(BoundingBox bbox,
Vector3d value)
|
private void |
updateBoundsStates()
|
Methods inherited from class javax.media.j3d.Bounds |
---|
closest_point, getWithLock, intersect_ptope_abox, intersect_ptope_ptope, intersect_ptope_sphere, setWithLock |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
Point3d lower
Point3d upper
private Point3d centroid
private static final double EPS
private BoundingSphere tmpSphere
private BoundingBox tmpBox
private BoundingPolytope tmpPolytope
private Point3d tmpP3d
private static boolean releaseBoundingBoxMemory
Constructor Detail |
---|
public BoundingBox(Point3d lower, Point3d upper)
lower
- the "small" cornerupper
- the "large" cornerpublic BoundingBox()
public BoundingBox(Bounds boundsObject)
boundsObject
- a bounds objectpublic BoundingBox(Bounds[] bounds)
bounds
- an array of bounding objectsMethod Detail |
---|
public void getLower(Point3d p1)
p1
- a Point to receive the lower corner of the bounding boxpublic void setLower(double xmin, double ymin, double zmin)
xmin
- minimum x value of boundining boxymin
- minimum y value of boundining boxzmin
- minimum z value of boundining boxpublic void setLower(Point3d p1)
p1
- a Point defining the new lower corner of the bounding boxpublic void getUpper(Point3d p1)
p1
- a Point to receive the upper corner of the bounding boxpublic void setUpper(double xmax, double ymax, double zmax)
xmax
- max x value of boundining boxymax
- max y value of boundining boxzmax
- max z value of boundining boxpublic void setUpper(Point3d p1)
p1
- a Point defining the new upper corner of the bounding boxpublic void set(Bounds boundsObject)
set
in class Bounds
boundsObject
- another bounds objectpublic java.lang.Object clone()
clone
in class Bounds
public boolean equals(java.lang.Object bounds)
bounds
object is
equal to this BoundingBox object. They are equal if the
specified bounds
object is an instance of
BoundingBox and all of the data
members of bounds
are equal to the corresponding
data members in this BoundingBox.
equals
in class Bounds
bounds
- the object with which the comparison is made.
bounds
;
otherwise falsepublic int hashCode()
hashCode
in class Bounds
public void combine(Bounds boundsObject)
combine
in class Bounds
boundsObject
- another bounds objectpublic void combine(Bounds[] bounds)
combine
in class Bounds
bounds
- an array of bounds objectspublic void combine(Point3d point)
combine
in class Bounds
point
- a 3d point in spacepublic void combine(Point3d[] points)
combine
in class Bounds
points
- an array of 3d points in spacepublic void transform(Bounds boundsObject, Transform3D matrix)
transform
in class Bounds
boundsObject
- the bounding object to be transformedmatrix
- a transformation matrixpublic void transform(Transform3D matrix)
transform
in class Bounds
matrix
- a transformation matrixboolean intersect(Point3d origin, Vector3d direction, Point4d position)
intersect
in class Bounds
origin
- the starting point of the raydirection
- the direction of the rayposition3
- a point defining the location of the pick w= distance to pick
boolean intersect(Point3d point, Point4d position)
intersect
in class Bounds
point
- the pick pointposition
- a point defining the location of the pick w= distance to pick
boolean intersect(Point3d start, Point3d end, Point4d position)
intersect
in class Bounds
start
- a point defining the start of the line segmentend
- a point defining the end of the line segmentposition
- a point defining the location of the pick w= distance to pick
public boolean intersect(Point3d origin, Vector3d direction)
intersect
in class Bounds
origin
- the starting point of the raydirection
- the direction of the ray
boolean intersect(Point3d origin, Vector3d direction, Point3d intersect)
public boolean intersect(Point3d point)
intersect
in class Bounds
point
- a point defining a position in 3-space
public boolean isEmpty()
isEmpty
in class Bounds
boolean intersect(Bounds boundsObject, Point4d position)
intersect
in class Bounds
boundsObject
- another bounds object
public boolean intersect(Bounds boundsObject)
intersect
in class Bounds
boundsObject
- another bounds object
public boolean intersect(Bounds[] boundsObjects)
intersect
in class Bounds
boundsObjects
- an array of bounding objects
public boolean intersect(Bounds boundsObject, BoundingBox newBoundBox)
boundsObject
- another bounding objectnewBoundBox
- the new bounding box which is the intersection of
the boundsObject and this BoundingBox
public boolean intersect(Bounds[] boundsObjects, BoundingBox newBoundBox)
boundsObjects
- an array of bounds objectsnewBoundBox
- the new bounding box which is the intersection of
the boundsObject and this BoundingBox
public Bounds closestIntersection(Bounds[] boundsObjects)
closestIntersection
in class Bounds
boundsObjects
- an array of bounds objects
boolean intersect(CachedFrustum frustum)
frustum
-
public java.lang.String toString()
toString
in class java.lang.Object
private void updateBoundsStates()
Point3d getCenter()
Bounds
getCenter
in class Bounds
void translate(BoundingBox bbox, Vector3d value)
Bounds copy(Bounds r)
copy
in class Bounds
boolean checkBoundsIsNaN()
int getPickType()
getPickType
in class Bounds
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |