|
|||||||||
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.BoundingSphere
This class defines a spherical bounding region which is defined by a center point and a radius.
Constructor Summary | |
BoundingSphere()
Constructs and initializes a BoundingSphere with radius = 1 at 0 0 0. |
|
BoundingSphere(Bounds boundsObject)
Constructs and initializes a BoundingSphere from a bounding object. |
|
BoundingSphere(Bounds[] boundsObjects)
Constructs and initializes a BoundingSphere from an array of bounding objects. |
|
BoundingSphere(Point3d center,
double radius)
Constructs and initializes a BoundingSphere from a center and radius. |
Method Summary | |
java.lang.Object |
clone()
Creates a copy of the bounding sphere. |
Bounds |
closestIntersection(Bounds[] boundsObjects)
Finds closest bounding object that intersects this bounding sphere. |
void |
combine(Bounds boundsObject)
Combines this bounding sphere with a bounding object so that the resulting bounding sphere encloses the original bounding sphere and the given bounds object. |
void |
combine(Bounds[] boundsObjects)
Combines this bounding sphere with an array of bounding objects so that the resulting bounding sphere encloses the original bounding sphere and the given array of bounds object. |
void |
combine(Point3d point)
Combines this bounding sphere with a point. |
void |
combine(Point3d[] points)
Combines this bounding sphere with an array of points. |
boolean |
equals(java.lang.Object bounds)
Indicates whether the specified bounds object is
equal to this BoundingSphere object. |
void |
getCenter(Point3d center)
Returns the position of this bounding sphere as a point. |
double |
getRadius()
Returns the radius of this bounding sphere as a double. |
int |
hashCode()
Returns a hash code value for this BoundingSphere 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,
BoundingSphere newBoundSphere)
Test for intersection with an array of bounds objects. |
boolean |
intersect(Bounds boundsObject,
BoundingSphere newBoundSphere)
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 sphere is empty. |
void |
set(Bounds boundsObject)
Sets the value of this BoundingSphere. |
void |
setCenter(Point3d center)
Sets the position of this bounding sphere from a point. |
void |
setRadius(double r)
Sets the radius of this bounding sphere from a double. |
java.lang.String |
toString()
Returns a string representation of this class. |
void |
transform(Bounds boundsObject,
Transform3D matrix)
Modifies the bounding sphere so that it bounds the volume generated by transforming the given bounding object. |
void |
transform(Transform3D trans)
Transforms this bounding sphere by the given matrix. |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public BoundingSphere(Point3d center, double radius)
center
- the center of the bounding sphereradius
- the radius of the bounding spherepublic BoundingSphere()
public BoundingSphere(Bounds boundsObject)
boundsObject
- a bounds objectpublic BoundingSphere(Bounds[] boundsObjects)
bounds
- an array of bounds objectsMethod Detail |
public double getRadius()
public void setRadius(double r)
r
- the new radius for the bounding spherepublic void getCenter(Point3d center)
center
- a Point to receive the center of the bounding spherepublic void setCenter(Point3d center)
center
- a Point defining the new center of the bounding spherepublic 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 BoundingSphere object. They are equal if the
specified bounds
object is an instance of
BoundingSphere and all of the data
members of bounds
are equal to the corresponding
data members in this BoundingSphere.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 boolean isEmpty()
public void transform(Bounds boundsObject, Transform3D matrix)
boundsObject
- the bounding object to be transformedmatrix
- a transformation matrixpublic void transform(Transform3D trans)
trans
- the transformation matrixpublic boolean intersect(Point3d origin, Vector3d direction)
origin
- the starting point of the raydirection
- the direction of the raypublic 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, BoundingSphere newBoundSphere)
boundsObject
- another bounds objectnewBoundSphere
- the new bounding sphere which is the intersection of
the boundsObject and this BoundingSpherepublic boolean intersect(Bounds[] boundsObjects, BoundingSphere newBoundSphere)
boundsObjects
- an array of bounds objectsnewBoundSphere
- the new bounding sphere which is the intersection of
the boundsObject and this BoundingSpherepublic Bounds closestIntersection(Bounds[] boundsObjects)
boundsObjects
- 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 |