Package javax.media.j3d
Class Bounds
- java.lang.Object
-
- 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.CloneableThe abstract base class for bounds objects. Bounds objects define a convex, closed volume that is used for various intersection and culling operations.
-
-
Constructor Summary
Constructors Constructor Description Bounds()Constructs a new Bounds object.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.lang.Objectclone()Makes a copy of a bounds object.abstract BoundsclosestIntersection(Bounds[] boundsObjects)Finds closest bounding object that intersects this bounding object.abstract voidcombine(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 voidcombine(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 voidcombine(javax.vecmath.Point3d point)Combines this bounding object with a point.abstract voidcombine(javax.vecmath.Point3d[] points)Combines this bounding object with an array of points.abstract booleanequals(java.lang.Object bounds)Indicates whether the specifiedboundsobject is equal to this Bounds object.abstract inthashCode()Returns a hash code for this Bounds object based on the data values in this object.abstract booleanintersect(Bounds boundsObject)Test for intersection with another bounds object.abstract booleanintersect(Bounds[] boundsObjects)Test for intersection with another bounds object.abstract booleanintersect(javax.vecmath.Point3d point)Test for intersection with a point.abstract booleanintersect(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction)Test for intersection with a ray.abstract booleanisEmpty()Tests whether the bounds is empty.abstract voidset(Bounds boundsObject)Sets the value of this Bounds object.abstract voidtransform(Bounds bounds, Transform3D trans)Modifies the bounding object so that it bounds the volume generated by transforming the given bounding object.abstract voidtransform(Transform3D trans)Transforms this bounding object by the given matrix.
-
-
-
Method Detail
-
clone
public abstract java.lang.Object clone()
Makes a copy of a bounds object.- Overrides:
clonein classjava.lang.Object
-
equals
public abstract boolean equals(java.lang.Object bounds)
Indicates whether the specifiedboundsobject is equal to this Bounds object. They are equal if both the specifiedboundsobject and this Bounds are instances of the same Bounds subclass and all of the data members ofboundsare equal to the corresponding data members in this Bounds.- Overrides:
equalsin classjava.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:
hashCodein classjava.lang.Object- Returns:
- a hash code for this Bounds object.
- Since:
- Java 3D 1.2
-
intersect
public abstract boolean intersect(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction)Test for intersection with a ray.- Parameters:
origin- the starting point of the raydirection- the direction of the ray- Returns:
- true or false indicating if an intersection occured
-
intersect
public abstract boolean intersect(javax.vecmath.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
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
-
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(javax.vecmath.Point3d point)
Combines this bounding object with a point.- Parameters:
point- a 3d point in space
-
combine
public abstract void combine(javax.vecmath.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 transformedtrans- 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.
-
-