Maven module :un.api : api-geometry :
Class : un.api.geometry.index.BoundingVolumeCheck
Extends/Implements : -
Subclasses : -


Overlap and containment checks between bounding volumes.



@see BBox
@author Mark Raynsford


Variables : -
Functions : checkAgainst, checkWellFormed, containedWithin, contains, isWellFormed, overlaps, overlapsVolume, rayBoxIntersects




Determine whether b overlaps a, or is
completely contained by a.
param  container
The container
param  item
The item that may be contained
return  The containment result
public Result checkAgainst (BBox container, BBox item)


Evaluates {@link #isWellFormed(BBox)} for the given item
and raises {@link IllegalArgumentException} if the result is
false.

@param item
The area.
public void checkWellFormed (BBox item)


param  container
The container
param  item
The item that may be contained
return  true iff item is completely contained
within container.
public boolean containedWithin (BBox container, BBox item)


The area a described by the given vertices contains
b.

@param a_x0
The X coordinate of the lower corner of a
@param a_x1
The X coordinate of the upper corner of a
@param a_y0
The Y coordinate of the lower corner of a
@param a_y1
The Y coordinate of the upper corner of a
@param a_z0
The Z coordinate of the lower corner of a
@param a_z1
The Z coordinate of the upper corner of a
@param b_x0
The X coordinate of the lower corner of b
@param b_x1
The X coordinate of the upper corner of b
@param b_y0
The Y coordinate of the lower corner of b
@param b_y1
The Y coordinate of the upper corner of b
@param b_z0
The Z coordinate of the lower corner of b
@param b_z1
The Z coordinate of the upper corner of b
@return true if a contains b.
public boolean contains (double a_x0, double a_x1, double a_y0, double a_y1, double a_z0, double a_z1, double b_x0, double b_x1, double b_y0, double b_y1, double b_z0, double b_z1)


@param container
The volume
@return true iff the given bounding volume is well formed.
That is, iff
container.getLower().getX() <= container.getUpper().getX()
and
container.getLower().getY() <= container.getUpper().getY()
and
container.getLower().getZ() <= container.getUpper().getZ()
.
public boolean isWellFormed (BBox container)


The area a described by the given vertices overlaps
b.

@param a_x0
The X coordinate of the lower corner of a
@param a_x1
The X coordinate of the upper corner of a
@param a_y0
The Y coordinate of the lower corner of a
@param a_y1
The Y coordinate of the upper corner of a
@param a_z0
The Z coordinate of the lower corner of a
@param a_z1
The Z coordinate of the upper corner of a
@param b_x0
The X coordinate of the lower corner of b
@param b_x1
The X coordinate of the upper corner of b
@param b_y0
The Y coordinate of the lower corner of b
@param b_y1
The Y coordinate of the upper corner of b
@param b_z0
The Z coordinate of the lower corner of b
@param b_z1
The Z coordinate of the upper corner of b
@return true if a overlaps b.
public boolean overlaps (double a_x0, double a_x1, double a_y0, double a_y1, double a_z0, double a_z1, double b_x0, double b_x1, double b_y0, double b_y1, double b_z0, double b_z1)


@param container
The container
@param item
The item that may be overlapping
@return true iff item overlaps
container.
public boolean overlapsVolume (BBox container, BBox item)


Branchless optimization of the Kay-Kajiya slab ray/AABB intersection test
by Tavian Barnes.


See tavianator.com.



@param ray
The ray
@param x0
The lower X coordinate
@param y0
The lower Y coordinate
@param z0
The lower z coordinate
@param x1
The upper X coordinate
@param y1
The upper Y coordinate
@param z1
The upper z coordinate
@return true if the ray intersects the box given by the
corners.
public boolean rayBoxIntersects (Ray ray, double x0, double y0, double z0, double x1, double y1, double z1)