public class BoundingBox3DFloat
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private float |
maxX
The maximum X coordinate.
|
private float |
maxY
The maximum Y coordinate.
|
private float |
maxZ
The maximum Z coordinate.
|
private float |
minX
The minimum X coordinate.
|
private float |
minY
The minimum Y coordinate.
|
private float |
minZ
The minimum Z coordinate.
|
Constructor and Description |
---|
BoundingBox3DFloat()
Public constructor to construct an empty bounding box.
|
BoundingBox3DFloat(BoundingBox3DFloat orig)
Copy constructor.
|
BoundingBox3DFloat(float x,
float y,
float z)
Construct a zero-sized BoundingBox around a single point.
|
BoundingBox3DFloat(float x1,
float y1,
float z1,
float x2,
float y2,
float z2)
Construct a BoundingBox with the specified coordinates.
|
BoundingBox3DFloat(Point3DFloat p)
Construct a zero-sized BoundingBox around a single point.
|
BoundingBox3DFloat(Point3DFloat p1,
Point3DFloat p2)
Construct a BoundingBox with the specified coordinates.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(float x,
float y,
float z)
Add a point to a BoundingBox.
|
void |
addPoint(Point3DFloat p)
Add a point to a BoundingBox.
|
BoundingBox3DFloat |
expand(float expandBy)
Expands a BoundingBox3DFloat by the specified value on each side and
returns a new bounding box.
|
BoundingBox3DFloat |
expand(float expandX,
float expandY,
float expandZ)
Expands a BoundingBox3DFloat by the specified value on each side and
returns a new bounding box.
|
BoundingBox3DFloat |
expand(float xmin,
float ymin,
float zmin,
float xmax,
float ymax,
float zmax)
Expands a BoundingBox3DFloat by the specified value on each side and
returns a new bounding box.
|
float |
getMaxX()
Returns the maximum value of x.
|
float |
getMaxY()
Returns the maximum value of y.
|
float |
getMaxZ()
Returns the maximum value of z.
|
float |
getMinX()
Returns the minimum value of x.
|
float |
getMinY()
Returns the minimum value of y.
|
float |
getMinZ()
Returns the minimum value of z.
|
BoundingBox3DFloat |
intersection(BoundingBox3DFloat b1,
BoundingBox3DFloat b2)
Returns a new BoundingBox3DFloat which is the intersection of two
bounding boxes.
|
boolean |
isEmpty()
Returns true if this is empty.
|
boolean |
isInside(float x,
float y,
float z)
Returns true if the point is within the bounding box.
|
java.lang.String |
toString()
Returns a String representation of this bounding box.
|
void |
union(BoundingBox3DFloat other)
Adds the bounds of the other BoundingBox to this box, modifying this
in place.
|
static BoundingBox3DFloat |
union(BoundingBox3DFloat b1,
BoundingBox3DFloat b2)
Returns a new BoundingBox3DFloat which is the union of two bounding
boxes.
|
private float minX
private float maxX
private float minY
private float maxY
private float minZ
private float maxZ
public BoundingBox3DFloat()
public BoundingBox3DFloat(float x, float y, float z)
public BoundingBox3DFloat(BoundingBox3DFloat orig)
public BoundingBox3DFloat(Point3DFloat p)
public BoundingBox3DFloat(float x1, float y1, float z1, float x2, float y2, float z2)
public BoundingBox3DFloat(Point3DFloat p1, Point3DFloat p2)
public void addPoint(float x, float y, float z)
public void addPoint(Point3DFloat p)
public float getMinX()
public float getMaxX()
public float getMinY()
public float getMaxY()
public float getMinZ()
public float getMaxZ()
public boolean isEmpty()
public void union(BoundingBox3DFloat other)
public static BoundingBox3DFloat union(BoundingBox3DFloat b1, BoundingBox3DFloat b2)
public BoundingBox3DFloat intersection(BoundingBox3DFloat b1, BoundingBox3DFloat b2)
public boolean isInside(float x, float y, float z)
public BoundingBox3DFloat expand(float expandBy)
public BoundingBox3DFloat expand(float expandX, float expandY, float expandZ)
public BoundingBox3DFloat expand(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
public java.lang.String toString()
toString
in class java.lang.Object