|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.media.ding3d.Bounds
javax.media.ding3d.BoundingPolytope
public class BoundingPolytope
A BoundingPolytope defines a polyhedral bounding region using the intersection of four 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 |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BoundingPolytope(Vector4d[] planes)
planes - a set of planes defining the polytope.
java.lang.IllegalArgumentException - if the length of the
specified array of planes is less than 4.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 polytope
java.lang.IllegalArgumentException - if the length of the
specified array of planes is less than 4.public void getPlanes(Vector4d[] planes)
planes - an array Vector4d to receive the bounding planespublic int getNumPlanes()
public void set(Bounds boundsObject)
set in class BoundsboundsObject - another bounds objectpublic java.lang.Object clone()
clone in class Boundspublic 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.
equals in class Boundsbounds - the object with which the comparison is made.
bounds;
otherwise falsepublic int hashCode()
hashCode in class Boundspublic void combine(Bounds boundsObject)
combine in class BoundsboundsObject - another bounds objectpublic void combine(Bounds[] boundsObjects)
combine in class BoundsboundsObjects - an array of bounds objectspublic void combine(Point3d point)
combine in class Boundspoint - a 3d point in spacepublic void combine(Point3d[] points)
combine in class Boundspoints - an array of 3d points in space
public void transform(Bounds boundsObject,
Transform3D matrix)
transform in class BoundsboundsObject - the bounding object to be transformedmatrix - a transformation matrixpublic void transform(Transform3D matrix)
transform in class Boundsmatrix - a transformation matrix
public boolean intersect(Point3d origin,
Vector3d direction)
intersect in class Boundsorigin - the starting point of the raydirection - the direction of the ray
public boolean isEmpty()
isEmpty in class Boundspublic boolean intersect(Point3d point)
intersect in class Boundspoint - a Point defining a position in 3-space
public boolean intersect(Bounds boundsObject)
intersect in class BoundsboundsObject - another bounds object
public boolean intersect(Bounds[] boundsObjects)
intersect in class BoundsboundsObjects - an array of bounding objects
public boolean intersect(Bounds boundsObject,
BoundingPolytope newBoundPolytope)
boundsObject - another bounds objectnewBoundPolytope - the new bounding polytope, which is the intersection of
the boundsObject and this BoundingPolytope
public boolean intersect(Bounds[] boundsObjects,
BoundingPolytope newBoundingPolytope)
boundsObjects - an array of bounds objectsnewBoundingPolytope - the new bounding polytope, which is the intersection of
the boundsObject and this BoundingPolytope
public Bounds closestIntersection(Bounds[] boundsObjects)
closestIntersection in class BoundsboundsObjects - is an array of bounds objects
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||