public class BoxBounds extends BaseBounds
BaseBounds.BoundsType| Modifier and Type | Field and Description |
|---|---|
private float |
maxX |
private float |
maxY |
private float |
maxZ |
private float |
minX |
private float |
minY |
private float |
minZ |
| Constructor and Description |
|---|
BoxBounds()
Create an axis aligned bounding box object, with an empty bounds
where maxX < minX, maxY < minY and maxZ < minZ.
|
BoxBounds(BoxBounds other)
Creates an axis aligned bounding box as a copy of the specified
BoxBounds object.
|
BoxBounds(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
Creates an axis aligned bounding box based on the minX, minY, minZ, maxX, maxY,
and maxZ values specified.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(float x,
float y,
float z) |
void |
add(Point2D p) |
boolean |
contains(float x,
float y) |
boolean |
contains(float x,
float y,
float z) |
boolean |
contains(float x,
float y,
float z,
float width,
float height,
float depth) |
boolean |
contains(Point2D p) |
BaseBounds |
copy()
Duplicates this instance.
|
BaseBounds |
deriveWithNewBounds(BaseBounds other) |
BaseBounds |
deriveWithNewBounds(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ) |
BaseBounds |
deriveWithNewBounds(Rectangle other) |
BaseBounds |
deriveWithNewBoundsAndSort(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ) |
BaseBounds |
deriveWithPadding(float h,
float v,
float d) |
BaseBounds |
deriveWithUnion(BaseBounds other) |
boolean |
disjoint(float x,
float y,
float width,
float height) |
boolean |
disjoint(float x,
float y,
float z,
float width,
float height,
float depth) |
boolean |
equals(java.lang.Object obj) |
RectBounds |
flattenInto(RectBounds bounds)
Sets the given RectBounds (or creates a new instance of bounds is null) to
have the minX, minY, maxX, and maxY of this BoxBounds, dropping the Z values.
|
BaseBounds.BoundsType |
getBoundsType() |
float |
getDepth()
Convenience function for getting the depth of this bounds.
|
float |
getHeight()
Convenience function for getting the height of this bounds.
|
Vec2f |
getMax(Vec2f max) |
Vec3f |
getMax(Vec3f max) |
float |
getMaxX() |
float |
getMaxY() |
float |
getMaxZ() |
Vec2f |
getMin(Vec2f min) |
Vec3f |
getMin(Vec3f min) |
float |
getMinX() |
float |
getMinY() |
float |
getMinZ() |
float |
getWidth()
Convenience function for getting the width of this bounds.
|
void |
grow(float h,
float v,
float d) |
int |
hashCode() |
boolean |
intersects(BaseBounds other) |
boolean |
intersects(float x,
float y,
float width,
float height) |
boolean |
intersects(float x,
float y,
float z,
float width,
float height,
float depth) |
void |
intersectWith(BaseBounds other) |
void |
intersectWith(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ) |
void |
intersectWith(Rectangle other) |
boolean |
is2D()
Return true if this bounds is of a 2D BoundsType, else false.
|
boolean |
isEmpty() |
BoxBounds |
makeEmpty() |
void |
roundOut()
Adjusts the edges of this BoxBounds "outward" toward integral boundaries,
such that the rounded bounding box will always full enclose the original
bounding box.
|
void |
setBounds(BaseBounds other)
Set the bounds to match that of the BaseBounds object specified.
|
void |
setBounds(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
Set the bounds to the given values.
|
void |
setBoundsAndSort(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ) |
void |
setBoundsAndSort(Point2D p1,
Point2D p2)
Sets the bounds based on the given points, and also ensures that
after having done so that this bounds instance is sorted (x1<=x2 and y1<=y2).
|
void |
setMaxX(float maxX) |
void |
setMaxY(float maxY) |
void |
setMaxZ(float maxZ) |
void |
setMinX(float minX) |
void |
setMinY(float minY) |
void |
setMinZ(float minZ) |
protected void |
sortMinMax() |
java.lang.String |
toString() |
void |
translate(float x,
float y,
float z) |
void |
unionWith(BaseBounds other) |
void |
unionWith(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ) |
getInstance, getInstanceprivate float minX
private float maxX
private float minY
private float maxY
private float minZ
private float maxZ
public BoxBounds()
public BoxBounds(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
public BoxBounds(BoxBounds other)
public BaseBounds copy()
BaseBoundscopy in class BaseBoundspublic BaseBounds.BoundsType getBoundsType()
getBoundsType in class BaseBoundspublic boolean is2D()
BaseBoundsis2D in class BaseBoundspublic float getWidth()
getWidth in class BaseBoundspublic float getHeight()
getHeight in class BaseBoundspublic float getDepth()
getDepth in class BaseBoundspublic float getMinX()
getMinX in class BaseBoundspublic void setMinX(float minX)
public float getMinY()
getMinY in class BaseBoundspublic void setMinY(float minY)
public float getMinZ()
getMinZ in class BaseBoundspublic void setMinZ(float minZ)
public float getMaxX()
getMaxX in class BaseBoundspublic void setMaxX(float maxX)
public float getMaxY()
getMaxY in class BaseBoundspublic void setMaxY(float maxY)
public float getMaxZ()
getMaxZ in class BaseBoundspublic void setMaxZ(float maxZ)
public Vec2f getMin(Vec2f min)
getMin in class BaseBoundspublic Vec2f getMax(Vec2f max)
getMax in class BaseBoundspublic Vec3f getMin(Vec3f min)
getMin in class BaseBoundspublic Vec3f getMax(Vec3f max)
getMax in class BaseBoundspublic BaseBounds deriveWithUnion(BaseBounds other)
deriveWithUnion in class BaseBoundspublic BaseBounds deriveWithNewBounds(Rectangle other)
deriveWithNewBounds in class BaseBoundspublic BaseBounds deriveWithNewBounds(BaseBounds other)
deriveWithNewBounds in class BaseBoundspublic BaseBounds deriveWithNewBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
deriveWithNewBounds in class BaseBoundspublic BaseBounds deriveWithNewBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
deriveWithNewBoundsAndSort in class BaseBoundspublic RectBounds flattenInto(RectBounds bounds)
BaseBoundsflattenInto in class BaseBoundsbounds - The bounds to fill with values, or null. If null, a new RectBounds
is returned. If not null, the given bounds will be populated and
then returnedpublic final void setBounds(BaseBounds other)
public final void setBounds(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
public void setBoundsAndSort(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
setBoundsAndSort in class BaseBoundspublic void setBoundsAndSort(Point2D p1, Point2D p2)
BaseBoundssetBoundsAndSort in class BaseBoundspublic void unionWith(BaseBounds other)
public void unionWith(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
public void add(float x,
float y,
float z)
add in class BaseBoundspublic void add(Point2D p)
add in class BaseBoundspublic void intersectWith(Rectangle other)
intersectWith in class BaseBoundspublic void intersectWith(BaseBounds other)
intersectWith in class BaseBoundspublic void intersectWith(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
intersectWith in class BaseBoundspublic boolean contains(Point2D p)
contains in class BaseBoundspublic boolean contains(float x,
float y)
contains in class BaseBoundspublic boolean contains(float x,
float y,
float z)
public boolean contains(float x,
float y,
float z,
float width,
float height,
float depth)
public boolean intersects(float x,
float y,
float width,
float height)
intersects in class BaseBoundspublic boolean intersects(float x,
float y,
float z,
float width,
float height,
float depth)
public boolean intersects(BaseBounds other)
public boolean disjoint(float x,
float y,
float width,
float height)
disjoint in class BaseBoundspublic boolean disjoint(float x,
float y,
float z,
float width,
float height,
float depth)
public boolean isEmpty()
isEmpty in class BaseBoundspublic void roundOut()
roundOut in class BaseBoundspublic void grow(float h,
float v,
float d)
public BaseBounds deriveWithPadding(float h, float v, float d)
deriveWithPadding in class BaseBoundspublic BoxBounds makeEmpty()
makeEmpty in class BaseBoundsprotected void sortMinMax()
sortMinMax in class BaseBoundspublic void translate(float x,
float y,
float z)
translate in class BaseBoundspublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object