javax.media.j3d
Class Bounds

java.lang.Object
  extended by javax.media.j3d.Bounds
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
BoundingBox, BoundingPolytope, BoundingSphere

public abstract class Bounds
extends java.lang.Object
implements java.lang.Cloneable

The abstract base class for bounds objects. Bounds objects define a convex, closed volume that is used for various intersection and culling operations.


Field Summary
(package private)  int boundId
           
(package private) static int BOUNDING_BOX
           
(package private) static int BOUNDING_POLYTOPE
           
(package private) static int BOUNDING_SPHERE
           
(package private)  boolean boundsIsEmpty
           
(package private)  boolean boundsIsInfinite
           
(package private) static boolean debug
           
(package private) static double EPSILON
           
 
Constructor Summary
Bounds()
          Constructs a new Bounds object.
 
Method Summary
abstract  java.lang.Object clone()
          Makes a copy of a bounds object.
(package private)  boolean closest_point(Point3d g, Vector4d[] planes, Point3d new_point)
          computes the closest point from the given point to a set of planes (polytope)
abstract  Bounds closestIntersection(Bounds[] boundsObjects)
          Finds closest bounding object that intersects this bounding object.
abstract  void combine(Bounds boundsObject)
          Combines this bounding object with a bounding object so that the resulting bounding object encloses the original bounding object and the given bounds object.
abstract  void combine(Bounds[] boundsObjects)
          Combines this bounding object with an array of bounding objects so that the resulting bounding object encloses the original bounding object and the given array of bounds object.
abstract  void combine(Point3d point)
          Combines this bounding object with a point.
abstract  void combine(Point3d[] points)
          Combines this bounding object with an array of points.
(package private) abstract  Bounds copy(Bounds region)
           
abstract  boolean equals(java.lang.Object bounds)
          Indicates whether the specified bounds object is equal to this Bounds object.
(package private) abstract  Point3d getCenter()
          Returns the center of the bounds
(package private) abstract  int getPickType()
           
(package private)  void getWithLock(Bounds b)
           
abstract  int hashCode()
          Returns a hash code for this Bounds object based on the data values in this object.
(package private)  boolean intersect_ptope_abox(BoundingPolytope polyTope, BoundingBox box)
           
(package private)  boolean intersect_ptope_ptope(BoundingPolytope poly1, BoundingPolytope poly2)
           
(package private)  boolean intersect_ptope_sphere(BoundingPolytope polyTope, BoundingSphere sphere)
           
abstract  boolean intersect(Bounds boundsObject)
          Test for intersection with another bounds object.
abstract  boolean intersect(Bounds[] boundsObjects)
          Test for intersection with another bounds object.
(package private) abstract  boolean intersect(Bounds boundsObject, Point4d position)
          Test for intersection with another bounds object Test for intersection with another bounds object
abstract  boolean intersect(Point3d point)
          Test for intersection with a point.
(package private) abstract  boolean intersect(Point3d start, Point3d end, Point4d position)
          Test for intersection with a segment
(package private) abstract  boolean intersect(Point3d point, Point4d position)
          Test for intersection with a point
abstract  boolean intersect(Point3d origin, Vector3d direction)
          Test for intersection with a ray.
(package private) abstract  boolean intersect(Point3d origin, Vector3d direction, Point4d position)
          Test for intersection with a ray
abstract  boolean isEmpty()
          Tests whether the bounds is empty.
abstract  void set(Bounds boundsObject)
          Sets the value of this Bounds object.
(package private)  void setWithLock(Bounds b)
           
private  void test_point(Vector4d[] planes, Point3d new_point)
           
abstract  void transform(Bounds bounds, Transform3D trans)
          Modifies the bounding object so that it bounds the volume generated by transforming the given bounding object.
abstract  void transform(Transform3D trans)
          Transforms this bounding object by the given matrix.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPSILON

static final double EPSILON
See Also:
Constant Field Values

debug

static final boolean debug
See Also:
Constant Field Values

BOUNDING_BOX

static final int BOUNDING_BOX
See Also:
Constant Field Values

BOUNDING_SPHERE

static final int BOUNDING_SPHERE
See Also:
Constant Field Values

BOUNDING_POLYTOPE

static final int BOUNDING_POLYTOPE
See Also:
Constant Field Values

boundsIsEmpty

boolean boundsIsEmpty

boundsIsInfinite

boolean boundsIsInfinite

boundId

int boundId
Constructor Detail

Bounds

public Bounds()
Constructs a new Bounds object.

Method Detail

clone

public abstract java.lang.Object clone()
Makes a copy of a bounds object.

Overrides:
clone in class java.lang.Object

equals

public abstract boolean equals(java.lang.Object bounds)
Indicates whether the specified bounds object is equal to this Bounds object. They are equal if both the specified bounds object and this Bounds are instances of the same Bounds subclass and all of the data members of bounds are equal to the corresponding data members in this Bounds.

Overrides:
equals in class java.lang.Object
Parameters:
bounds - the object with which the comparison is made.
Returns:
true if this Bounds object is equal to bounds; otherwise false
Since:
Java 3D 1.2

hashCode

public abstract int hashCode()
Returns a hash code for this Bounds object based on the data values in this object. Two different Bounds objects of the same type with identical data values (i.e., Bounds.equals returns true) will return the same hash code. Two Bounds objects with different data members may return the same hash code value, although this is not likely.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this Bounds object.
Since:
Java 3D 1.2

intersect

public abstract boolean intersect(Point3d origin,
                                  Vector3d direction)
Test for intersection with a ray.

Parameters:
origin - the starting point of the ray
direction - the direction of the ray
Returns:
true or false indicating if an intersection occured

intersect

public abstract boolean intersect(Point3d point)
Test for intersection with a point.

Parameters:
point - a point defining a position in 3-space
Returns:
true or false indicating if an intersection occured

intersect

abstract boolean intersect(Point3d origin,
                           Vector3d direction,
                           Point4d position)
Test for intersection with a ray

Parameters:
origin - is a the starting point of the ray
direction - is the direction of the ray
position - is a point defining the location of the pick w= distance to pick
Returns:
true or false indicating if an intersection occured

intersect

abstract boolean intersect(Point3d point,
                           Point4d position)
Test for intersection with a point

Parameters:
point - is a point defining a position in 3-space
position - is a point defining the location of the pick w= distance to pick
Returns:
true or false indicating if an intersection occured

intersect

abstract boolean intersect(Point3d start,
                           Point3d end,
                           Point4d position)
Test for intersection with a segment

Parameters:
start - is a point defining the start of the line segment
end - is a point defining the end of the line segment
position - is a point defining the location of the pick w= distance to pick
Returns:
true or false indicating if an intersection occured

intersect

abstract boolean intersect(Bounds boundsObject,
                           Point4d position)
Test for intersection with another bounds object Test for intersection with another bounds object

Parameters:
boundsObject - is another bounds object
Returns:
true or false indicating if an intersection occured

intersect

public abstract boolean intersect(Bounds boundsObject)
Test for intersection with another bounds object.

Parameters:
boundsObject - another bounds object
Returns:
true or false indicating if an intersection occurred

intersect

public abstract boolean intersect(Bounds[] boundsObjects)
Test for intersection with another bounds object.

Parameters:
boundsObjects - an array of bounding objects
Returns:
true or false indicating if an intersection occured

closestIntersection

public abstract Bounds closestIntersection(Bounds[] boundsObjects)
Finds closest bounding object that intersects this bounding object.

Parameters:
boundsObjects - an array of bounds objects
Returns:
closest bounding object

getCenter

abstract Point3d getCenter()
Returns the center of the bounds

Returns:
bounds center

combine

public abstract void combine(Bounds boundsObject)
Combines this bounding object with a bounding object so that the resulting bounding object encloses the original bounding object and the given bounds object.

Parameters:
boundsObject - another bounds object

combine

public abstract void combine(Bounds[] boundsObjects)
Combines this bounding object with an array of bounding objects so that the resulting bounding object encloses the original bounding object and the given array of bounds object.

Parameters:
boundsObjects - an array of bounds objects

combine

public abstract void combine(Point3d point)
Combines this bounding object with a point.

Parameters:
point - a 3d point in space

combine

public abstract void combine(Point3d[] points)
Combines this bounding object with an array of points.

Parameters:
points - an array of 3d points in space

transform

public abstract void transform(Transform3D trans)
Transforms this bounding object by the given matrix.

Parameters:
trans - the transformation matrix

transform

public abstract void transform(Bounds bounds,
                               Transform3D trans)
Modifies the bounding object so that it bounds the volume generated by transforming the given bounding object.

Parameters:
bounds - the bounding object to be transformed
trans - the transformation matrix

isEmpty

public abstract boolean isEmpty()
Tests whether the bounds is empty. A bounds is empty if it is null (either by construction or as the result of a null intersection) or if its volume is negative. A bounds with a volume of zero is not empty.

Returns:
true if the bounds is empty; otherwise, it returns false

set

public abstract void set(Bounds boundsObject)
Sets the value of this Bounds object.

Parameters:
boundsObject - another bounds object.

copy

abstract Bounds copy(Bounds region)

test_point

private void test_point(Vector4d[] planes,
                        Point3d new_point)

closest_point

boolean closest_point(Point3d g,
                      Vector4d[] planes,
                      Point3d new_point)
computes the closest point from the given point to a set of planes (polytope)

Parameters:
g - the point
planes - array of bounding planes
new_point - point on planes closest g

intersect_ptope_sphere

boolean intersect_ptope_sphere(BoundingPolytope polyTope,
                               BoundingSphere sphere)

intersect_ptope_abox

boolean intersect_ptope_abox(BoundingPolytope polyTope,
                             BoundingBox box)

intersect_ptope_ptope

boolean intersect_ptope_ptope(BoundingPolytope poly1,
                              BoundingPolytope poly2)

setWithLock

void setWithLock(Bounds b)

getWithLock

void getWithLock(Bounds b)

getPickType

abstract int getPickType()


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.