Class dnx.geom.BoundingBox3
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.geom.BoundingBox3

java.lang.Object
   |
   +----dnx.geom.BoundingBox3

public class BoundingBox3
extends Object
implements Cloneable, Copyable
3D bounding box This implements a three-dimensional rectangular box with sides parallel to the coordinate planes. This is intended to be used to compute "bounding boxes" of geometry but could be used more generally. If the x dimension of the bounding box's size is < 0, the bounding box is considered to be "undefined"; this is what the bounding box of the empty set is. This differs from a zero-size bounding box, which is the bounding box of a point. Undefined behavior will result if the x dimension of the bounding box's size is >= 0 and the y or z dimensions of the bounding box's size are < 0.

Constructor Index

 o BoundingBox3()
Create a new undefined bounding box.
 o BoundingBox3(BoundingBox3)
Create a new bounding box identical to the specified one.
 o BoundingBox3(Point3, Vector3)
Create a new bounding box with a specified center and size.

Method Index

 o clear()
 o clone()
 o copy(Copyable)
 o equals(BoundingBox3)
 o getCenter()
Return the center of the bounding box.
 o getHalfSize()
Return the half-size of the bounding box.
 o include(float, float, float)
If (x, y, z) does not lie inside the bounding box, recompute the bounding box to be the smallest box containing the original box and the point p.
 o include(Point3)
If p does not lie inside the bounding box, recompute the bounding box to be the smallest box containing the original box and the point p.
 o infiniteSize()
Set the bounding box to have infinite size.
 o inside(float, float, float)
Return true if the point (x, y, z) lies inside of the bounding box.
 o inside(Point3)
Return true if the point p lies inside of the bounding box.
 o rayIntersection(Ray3)
Returns the distance (scaled by the magnitude of the ray direction vector) from the ray origin to a bounding box.
 o setCenter(float, float, float)
Set the center of the bounding box
 o setCenter(Point3)
Set the center of the bounding box.
 o setHalfSize(float, float, float)
Set the size of the bounding box by specifying a half-size.
 o setHalfSize(Vector3)
Set the size of the bounding box by specifying a half-size.
 o setSize(float, float, float)
Set the size of the bounding box
 o setSize(Vector3)
Set the size of the bounding box
 o setValue(Point3, Point3)
Set the value of the bounding box to be just large enough to include the points leftBottomBack and rightTopFront.
 o setValue(Point3, Vector3)
Set the center and size of the bounding box.
 o toString()
 o transform(Matrix4)
 o undefined()
Set the bounding box to be undefined.
 o union(BoundingBox3)
Compute the smallest bounding box which contains this and b
 o zeroSize()
Set the bounding box to have zero size.

Constructors

 o BoundingBox3
  public BoundingBox3()
Create a new undefined bounding box.
 o BoundingBox3
  public BoundingBox3(BoundingBox3 copy)
Create a new bounding box identical to the specified one.
 o BoundingBox3
  public BoundingBox3(Point3 center,
                      Vector3 size)
Create a new bounding box with a specified center and size. The size is the full width, height, and depth of the box. Internally, however, the "half-size" (half of each dimension) is stored, and this is what can be retrieved (using getHalfSize()).

Methods

 o clear
  public void clear()
 o getCenter
  public final synchronized Point3 getCenter()
Return the center of the bounding box. This Point3 is owned by the BoundingBox3; don't modify it.
 o getHalfSize
  public final synchronized Vector3 getHalfSize()
Return the half-size of the bounding box. This Vector3 is owned by the BoundingBox3; don't modify it.
 o setValue
  public final void setValue(Point3 center,
                             Vector3 size)
Set the center and size of the bounding box.
 o setValue
  public final void setValue(Point3 leftBottomBack,
                             Point3 rightTopFront)
Set the value of the bounding box to be just large enough to include the points leftBottomBack and rightTopFront. Each component of the point leftBottomBack must be less than or equal to the corresponding component of rightTopFront.
 o setCenter
  public final void setCenter(Point3 center)
Set the center of the bounding box.
 o setCenter
  public final void setCenter(float x,
                              float y,
                              float z)
Set the center of the bounding box
 o setSize
  public final synchronized void setSize(Vector3 size)
Set the size of the bounding box
 o setSize
  public final synchronized void setSize(float x,
                                         float y,
                                         float z)
Set the size of the bounding box
 o setHalfSize
  public final synchronized void setHalfSize(Vector3 size)
Set the size of the bounding box by specifying a half-size.
 o setHalfSize
  public final synchronized void setHalfSize(float x,
                                             float y,
                                             float z)
Set the size of the bounding box by specifying a half-size.
 o zeroSize
  public final synchronized void zeroSize()
Set the bounding box to have zero size.
 o infiniteSize
  public final synchronized void infiniteSize()
Set the bounding box to have infinite size.
 o undefined
  public final synchronized void undefined()
Set the bounding box to be undefined.
 o union
  public void union(BoundingBox3 b)
Compute the smallest bounding box which contains this and b
 o include
  public void include(Point3 p)
If p does not lie inside the bounding box, recompute the bounding box to be the smallest box containing the original box and the point p.
 o include
  public void include(float x,
                      float y,
                      float z)
If (x, y, z) does not lie inside the bounding box, recompute the bounding box to be the smallest box containing the original box and the point p.
 o inside
  public boolean inside(float x,
                        float y,
                        float z)
Return true if the point (x, y, z) lies inside of the bounding box.
 o inside
  public boolean inside(Point3 p)
Return true if the point p lies inside of the bounding box.
 o transform
  public void transform(Matrix4 m)
 o rayIntersection
  public float rayIntersection(Ray3 ray)
Returns the distance (scaled by the magnitude of the ray direction vector) from the ray origin to a bounding box. If the ray origin is inside or on the bounding box, the distance returned will be zero. A negative return value indicates that the ray does not intersect the bounding box.
 o copy
  public void copy(Copyable cop)
 o clone
  public Object clone()
Overrides:
clone in class Object
 o equals
  public boolean equals(BoundingBox3 b)
 o toString
  public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index