|
|||||||||
| 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.BoundingSphere
public class BoundingSphere
This class defines a spherical bounding region which is defined by a center point and a radius.
| Field Summary | |
|---|---|
(package private) boolean |
allocBoxVerts
|
(package private) Point3d[] |
boxVerts
|
(package private) Point3d |
center
The center of the bounding sphere. |
(package private) double |
radius
The radius of the bounding sphere. |
private BoundingBox |
tmpBox
|
private BoundingPolytope |
tmpPolytope
|
| Fields inherited from class javax.media.j3d.Bounds |
|---|
boundId, BOUNDING_BOX, BOUNDING_POLYTOPE, BOUNDING_SPHERE, boundsIsEmpty, boundsIsInfinite, debug, EPSILON |
| 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 | |
|---|---|
(package private) boolean |
checkBoundsIsNaN()
|
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. |
private void |
combinePoint(double x,
double y,
double z)
|
(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 BoundingSphere object. |
(package private) Point3d |
getCenter()
Returns the center of the bounds |
void |
getCenter(Point3d center)
Returns the position of this bounding sphere as a point. |
(package private) int |
getPickType()
|
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. |
(package private) boolean |
intersect(Bounds boundsObject,
Point4d position)
Test for intersection with another bounds object. |
(package private) boolean |
intersect(CachedFrustum frustum)
Intersects this bounding sphere with preprocessed 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 intersectPoint)
Returns the position of the intersect point if the ray intersects with the sphere. |
(package private) boolean |
intersect(Point3d origin,
Vector3d direction,
Point4d position)
Test for intersection with a ray |
(package private) boolean |
intersect(Vector4d[] planes)
This intersects this bounding sphere with 6 frustum plane equations |
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. |
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 center
double radius
Point3d[] boxVerts
boolean allocBoxVerts
private BoundingBox tmpBox
private BoundingPolytope tmpPolytope
| 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)
boundsObjects - an array of bounds objects| Method 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)
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 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.
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 object
private void combinePoint(double x,
double y,
double z)
public 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 trans)
transform in class Boundstrans - the transformation matrix
boolean intersect(Point3d origin,
Vector3d direction,
Point4d position)
intersect in class Boundsorigin - 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 Boundspoint - 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 Boundsstart - 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 Boundsorigin - the starting point of the raydirection - the direction of the ray
boolean intersect(Point3d origin,
Vector3d direction,
Point3d intersectPoint)
public boolean intersect(Point3d point)
intersect in class Boundspoint - a point defining a position in 3-space
public boolean isEmpty()
isEmpty in class Bounds
boolean intersect(Bounds boundsObject,
Point4d position)
intersect in class BoundsboundsObject - another bounds object
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,
BoundingSphere newBoundSphere)
boundsObject - another bounds objectnewBoundSphere - the new bounding sphere which is the intersection of
the boundsObject and this BoundingSphere
public 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 BoundingSphere
public Bounds closestIntersection(Bounds[] boundsObjects)
closestIntersection in class BoundsboundsObjects - an array of bounds objects
boolean intersect(CachedFrustum frustum)
boolean intersect(Vector4d[] planes)
public java.lang.String toString()
toString in class java.lang.Objectprivate void updateBoundsStates()
Point3d getCenter()
Bounds
getCenter in class BoundsBounds copy(Bounds r)
copy in class Boundsboolean checkBoundsIsNaN()
int getPickType()
getPickType in class Bounds
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||