|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.Bounds | +--javax.media.j3d.BoundingPolytope
A BoundingPolytope defines a polyhedral bounding region using the intersection of three or more half spaces. The region defined by a BoundingPolytope is always convex and must be closed.
Each plane in the BoundingPolytope specifies a half-space defined by the equation:
Constructor Summary | |
BoundingPolytope()
Constructs a BoundingPolytope and initializes it to a set of 6 planes that defines a cube such that -1 <= x,y,z <= 1. |
|
BoundingPolytope(Bounds boundsObject)
Constructs a BoundingPolytope from the specified bounds object. |
|
BoundingPolytope(Bounds[] boundsObjects)
Constructs a BoundingPolytope from the specified array of bounds objects. |
|
BoundingPolytope(Vector4d[] planes)
Constructs a BoundingPolytope using the specified planes. |
Method Summary | |
java.lang.Object |
clone()
Creates a copy of a polytope. |
Bounds |
closestIntersection(Bounds[] boundsObjects)
Finds closest bounding object that intersects this bounding polytope. |
void |
combine(Bounds boundsObject)
Combines this bounding polytope with a bounding object so that the resulting bounding polytope encloses the original bounding polytope and the given bounds object. |
void |
combine(Bounds[] boundsObjects)
Combines this bounding polytope with an array of bounding objects so that the resulting bounding polytope encloses the original bounding polytope and the given array of bounds object. |
void |
combine(Point3d point)
Combines this bounding polytope with a point. |
void |
combine(Point3d[] points)
Combines this bounding polytope with an array of points. |
boolean |
equals(java.lang.Object bounds)
Indicates whether the specified bounds object is
equal to this BoundingPolytope object. |
int |
getNumPlanes()
|
void |
getPlanes(Vector4d[] planes)
Returns the equations of the bounding planes for this bounding polytope. |
int |
hashCode()
Returns a hash code value for this BoundingPolytope 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 another bounds object. |
boolean |
intersect(Bounds[] boundsObjects,
BoundingPolytope newBoundingPolytope)
Test for intersection with an array of bounds objects. |
boolean |
intersect(Bounds boundsObject,
BoundingPolytope newBoundPolytope)
Test for intersection with another bounds object. |
boolean |
intersect(Point3d point)
Test for intersection with a point. |
boolean |
intersect(Point3d origin,
Vector3d direction)
Test for intersection with a ray. |
boolean |
isEmpty()
Tests whether the bounding polytope is empty. |
void |
set(Bounds boundsObject)
Sets the planes for this BoundingPolytope by keeping its current number and position of planes and computing new planes positions to enclose the given bounds object. |
void |
setPlanes(Vector4d[] planes)
Sets the bounding planes for this polytope. |
java.lang.String |
toString()
Returns a string representation of this class |
void |
transform(Bounds boundsObject,
Transform3D matrix)
Modifies the bounding polytope so that it bounds the volume generated by transforming the given bounding object. |
void |
transform(Transform3D matrix)
Transforms this bounding polytope by the given transformation matrix. |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public BoundingPolytope(Vector4d[] planes)
planes
- a set of planes defining the polytope.public BoundingPolytope()
public BoundingPolytope(Bounds boundsObject)
boundsObject
- the bounds object from which this polytope
is constructed.public BoundingPolytope(Bounds[] boundsObjects)
boundsObjects
- the array bounds objects from which this
polytope is constructed.Method Detail |
public void setPlanes(Vector4d[] planes)
planes
- the new set of planes for this polytopepublic void getPlanes(Vector4d[] planes)
planes
- an array Vector4d to receive the bounding planespublic int getNumPlanes()
public void set(Bounds boundsObject)
boundsObject
- another bounds objectpublic java.lang.Object clone()
public boolean equals(java.lang.Object bounds)
bounds
object is
equal to this BoundingPolytope object. They are equal if the
specified bounds
object is an instance of
BoundingPolytope and all of the data
members of bounds
are equal to the corresponding
data members in this BoundingPolytope.bounds
- the object with which the comparison is made.bounds
;
otherwise falsepublic int hashCode()
public void combine(Bounds boundsObject)
boundsObject
- another bounds objectpublic void combine(Bounds[] boundsObjects)
boundsObjects
- an array of bounds objectspublic void combine(Point3d point)
point
- a 3d point in spacepublic void combine(Point3d[] points)
points
- an array of 3d points in spacepublic void transform(Bounds boundsObject, Transform3D matrix)
boundsObject
- the bounding object to be transformedmatrix
- a transformation matrixpublic void transform(Transform3D matrix)
matrix
- a transformation matrixpublic boolean intersect(Point3d origin, Vector3d direction)
origin
- the starting point of the raydirection
- the direction of the raypublic boolean isEmpty()
public boolean intersect(Point3d point)
point
- a Point defining a position in 3-spacepublic boolean intersect(Bounds boundsObject)
boundsObject
- another bounds objectpublic boolean intersect(Bounds[] boundsObjects)
boundsObjects
- an array of bounding objectspublic boolean intersect(Bounds boundsObject, BoundingPolytope newBoundPolytope)
boundsObject
- another bounds objectnewBoundPolytope
- the new bounding polytope, which is the intersection of
the boundsObject and this BoundingPolytopepublic boolean intersect(Bounds[] boundsObjects, BoundingPolytope newBoundingPolytope)
boundsObjects
- an array of bounds objectsnewBoundPolytope
- the new bounding polytope, which is the intersection of
the boundsObject and this BoundingPolytopepublic Bounds closestIntersection(Bounds[] boundsObjects)
boundsObjects
- is an array of bounds objectspublic java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |