|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.geometry.BVNode
maspack.geometry.AABB
public class AABB
Field Summary |
---|
Fields inherited from interface maspack.render.GLRenderable |
---|
TRANSLUCENT, TWO_DIMENSIONAL |
Constructor Summary | |
---|---|
AABB()
|
|
AABB(double minx,
double miny,
double minz,
double maxx,
double maxy,
double maxz)
|
Method Summary | |
---|---|
boolean |
containsPoint(Point3d pnt)
Returns true if this bounding volume contains a prescribed point. |
double |
distanceAlongLine(Point3d origin,
Vector3d dir,
double min,
double max)
Code is modified from "An Efficient and Robust Ray-Box Intersection Algorithm", Amy Williams, Steve Barrus, R. |
double |
distanceToPoint(Point3d pnt)
Returns the distance of a point to this bounding volume, or 0 if the point is on or inside it. |
void |
getCenter(Vector3d center)
Returns a center point for this bounding volume. |
void |
getHalfWidths(Vector3d hw)
|
double |
getRadius()
Returns an approximate "radius" for this bounding volume. |
boolean |
intersectsLine(double[] dists,
Point3d origin,
Vector3d dir,
double min,
double max)
Returns true if this bounding volume intersects a line. |
boolean |
intersectsLineSegment(Point3d p1,
Point3d p2)
Returns true if this bounding volume intersects a line segment. |
boolean |
intersectsPlane(Vector3d n,
double d)
Returns true if this bounding volume intersects a plane described by |
boolean |
intersectsSphere(Point3d pnt,
double r)
Returns true if this bounding volume intersects a sphere. |
boolean |
isContained(Boundable[] boundables,
double tol)
Returns true if an entire set of elements is contained within this bounding volume. |
void |
prerender(RenderList list)
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer. |
void |
render(GLRenderer renderer,
int flags)
Render this object using Open GL via the JOGL. |
void |
set(Boundable[] elementList,
int nelems,
double margin)
|
void |
setMaximums(double maxx,
double maxy,
double maxz)
|
void |
setMinimums(double minx,
double miny,
double minz)
|
void |
update(double margin)
|
void |
updateBounds(Point3d min,
Point3d max)
Update the minimum and maximum points for this object. |
void |
updateForAABB(AABB aabb,
double margin)
Grow this AABB if necessary to accommodate anothor aabb. |
Methods inherited from class maspack.geometry.BVNode |
---|
addChild, getDepth, getElements, getFirstChild, getNext, getNumber, getNumElements, getParent, getRenderHints, isLeaf, numChildren, setElements, setNumber, setParent |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AABB()
public AABB(double minx, double miny, double minz, double maxx, double maxy, double maxz)
Method Detail |
---|
public double getRadius()
BVNode
getRadius
in class BVNode
public void getCenter(Vector3d center)
BVNode
getCenter
in class BVNode
center
- returns to center pointpublic void getHalfWidths(Vector3d hw)
public void setMinimums(double minx, double miny, double minz)
public void setMaximums(double maxx, double maxy, double maxz)
public boolean containsPoint(Point3d pnt)
BVNode
containsPoint
in class BVNode
pnt
- point to be tested
public boolean intersectsSphere(Point3d pnt, double r)
BVNode
intersectsSphere
in class BVNode
pnt
- center point of the spherer
- radius of the sphere
public boolean intersectsLine(double[] dists, Point3d origin, Vector3d dir, double min, double max)
BVNode
x = origin + s dirThe line can be given finite bounds by specifying maximum and minimum bounds for s.
intersectsLine
in class BVNode
dists
- if non-null, returns the lower and upper values of s
that define the intersection regionorigin
- originating point for the linedir
- direction of the linemin
- minimum s value for the line, or -infinity if there
is no minimum valuemax
- maximum s value for the line, or +infinity if there
is no maximum value
public boolean intersectsPlane(Vector3d n, double d)
BVNode
n^T x = d
intersectsPlane
in class BVNode
n
- normal direction of the planed
- dot product offset
public boolean intersectsLineSegment(Point3d p1, Point3d p2)
BVNode
intersectsLineSegment
in class BVNode
p1
- first segment end pointp2
- second segment end point
public void set(Boundable[] elementList, int nelems, double margin)
public void update(double margin)
public boolean isContained(Boundable[] boundables, double tol)
BVNode
isContained
in class BVNode
boundables
- set of boundable elements to checktol
- specifies the minimum amount by which each element
must be insidepublic void updateForAABB(AABB aabb, double margin)
aabb
- AABB that should fit inside this boxmargin
- additional tolerance marginpublic double distanceToPoint(Point3d pnt)
BVNode
distanceToPoint
in class BVNode
pnt
- point to check distance for
public double distanceAlongLine(Point3d origin, Vector3d dir, double min, double max)
distanceAlongLine
in class BVNode
origin
- originating point for the linedir
- direction of the linemin
- minimum s value for the line, or -infinity if there
is no minimum valuemax
- maximum s value for the line, or +infinity if there
is no maximum value
public void updateBounds(Point3d min, Point3d max)
GLRenderable
min
- minimum pointmax
- maximum pointpublic void prerender(RenderList list)
GLRenderable
public void render(GLRenderer renderer, int flags)
GLRenderable
renderer
- renderer object which is used to perform the rendering. Provides pointers
to GL and GLU, along with helper functions.flags
- supplies flags that may be used to control different
aspects of the rendering. Flags are defined in GLRenderer
and currently include
GLRenderer.SELECTED
,
GLRenderer.VERTEX_COLORING
,
GLRenderer.HSV_COLOR_INTERPOLATION
,
GLRenderer.SORT_FACES
, and
GLRenderer.CLEAR_MESH_DISPLAY_LISTS
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |