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.
-
BoundingBox3()
- Create a new undefined bounding box.
-
BoundingBox3(BoundingBox3)
- Create a new bounding box identical to the specified one.
-
BoundingBox3(Point3, Vector3)
- Create a new bounding box with a specified center and size.
-
clear()
-
-
clone()
-
-
copy(Copyable)
-
-
equals(BoundingBox3)
-
-
getCenter()
- Return the center of the bounding box.
-
getHalfSize()
- Return the half-size of the bounding box.
-
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.
-
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.
-
infiniteSize()
- Set the bounding box to have infinite size.
-
inside(float, float, float)
- Return true if the point (x, y, z) lies inside of the bounding
box.
-
inside(Point3)
- Return true if the point p lies inside of the bounding
box.
-
rayIntersection(Ray3)
- Returns the distance (scaled by the magnitude of the ray
direction vector) from the ray origin to a bounding box.
-
setCenter(float, float, float)
- Set the center of the bounding box
-
setCenter(Point3)
- Set the center of the bounding box.
-
setHalfSize(float, float, float)
- Set the size of the bounding box by specifying a half-size.
-
setHalfSize(Vector3)
- Set the size of the bounding box by specifying a half-size.
-
setSize(float, float, float)
- Set the size of the bounding box
-
setSize(Vector3)
- Set the size of the bounding box
-
setValue(Point3, Point3)
- Set the value of the bounding box to be just large enough to include
the points leftBottomBack and rightTopFront.
-
setValue(Point3, Vector3)
- Set the center and size of the bounding box.
-
toString()
-
-
transform(Matrix4)
-
-
undefined()
- Set the bounding box to be undefined.
-
union(BoundingBox3)
- Compute the smallest bounding box which contains this and b
-
zeroSize()
- Set the bounding box to have zero size.
BoundingBox3
public BoundingBox3()
- Create a new undefined bounding box.
BoundingBox3
public BoundingBox3(BoundingBox3 copy)
- Create a new bounding box identical to the specified one.
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()).
clear
public void clear()
getCenter
public final synchronized Point3 getCenter()
- Return the center of the bounding box. This Point3 is owned by
the BoundingBox3; don't modify it.
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.
setValue
public final void setValue(Point3 center,
Vector3 size)
- Set the center and size of the bounding box.
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.
setCenter
public final void setCenter(Point3 center)
- Set the center of the bounding box.
setCenter
public final void setCenter(float x,
float y,
float z)
- Set the center of the bounding box
setSize
public final synchronized void setSize(Vector3 size)
- Set the size of the bounding box
setSize
public final synchronized void setSize(float x,
float y,
float z)
- Set the size of the bounding box
setHalfSize
public final synchronized void setHalfSize(Vector3 size)
- Set the size of the bounding box by specifying a half-size.
setHalfSize
public final synchronized void setHalfSize(float x,
float y,
float z)
- Set the size of the bounding box by specifying a half-size.
zeroSize
public final synchronized void zeroSize()
- Set the bounding box to have zero size.
infiniteSize
public final synchronized void infiniteSize()
- Set the bounding box to have infinite size.
undefined
public final synchronized void undefined()
- Set the bounding box to be undefined.
union
public void union(BoundingBox3 b)
- Compute the smallest bounding box which contains this and b
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.
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.
inside
public boolean inside(float x,
float y,
float z)
- Return true if the point (x, y, z) lies inside of the bounding
box.
inside
public boolean inside(Point3 p)
- Return true if the point p lies inside of the bounding
box.
transform
public void transform(Matrix4 m)
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.
copy
public void copy(Copyable cop)
clone
public Object clone()
- Overrides:
- clone in class Object
equals
public boolean equals(BoundingBox3 b)
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index