public class BoxBounds extends BaseBounds
BaseBounds.BoundsType
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(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() |
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, getInstance
public BoxBounds()
public BoxBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
public BoxBounds(BoxBounds other)
public BaseBounds copy()
BaseBounds
copy
in class BaseBounds
public BaseBounds.BoundsType getBoundsType()
getBoundsType
in class BaseBounds
public boolean is2D()
BaseBounds
is2D
in class BaseBounds
public float getWidth()
getWidth
in class BaseBounds
public float getHeight()
getHeight
in class BaseBounds
public float getDepth()
getDepth
in class BaseBounds
public float getMinX()
getMinX
in class BaseBounds
public void setMinX(float minX)
public float getMinY()
getMinY
in class BaseBounds
public void setMinY(float minY)
public float getMinZ()
getMinZ
in class BaseBounds
public void setMinZ(float minZ)
public float getMaxX()
getMaxX
in class BaseBounds
public void setMaxX(float maxX)
public float getMaxY()
getMaxY
in class BaseBounds
public void setMaxY(float maxY)
public float getMaxZ()
getMaxZ
in class BaseBounds
public void setMaxZ(float maxZ)
public Vec2f getMin(Vec2f min)
getMin
in class BaseBounds
public Vec2f getMax(Vec2f max)
getMax
in class BaseBounds
public Vec3f getMin(Vec3f min)
getMin
in class BaseBounds
public Vec3f getMax(Vec3f max)
getMax
in class BaseBounds
public BaseBounds deriveWithUnion(BaseBounds other)
deriveWithUnion
in class BaseBounds
public BaseBounds deriveWithNewBounds(Rectangle other)
deriveWithNewBounds
in class BaseBounds
public BaseBounds deriveWithNewBounds(BaseBounds other)
deriveWithNewBounds
in class BaseBounds
public BaseBounds deriveWithNewBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
deriveWithNewBounds
in class BaseBounds
public BaseBounds deriveWithNewBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
deriveWithNewBoundsAndSort
in class BaseBounds
public RectBounds flattenInto(RectBounds bounds)
BaseBounds
flattenInto
in class BaseBounds
bounds
- 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 BaseBounds
public void setBoundsAndSort(Point2D p1, Point2D p2)
BaseBounds
setBoundsAndSort
in class BaseBounds
public 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 BaseBounds
public void add(Point2D p)
add
in class BaseBounds
public void intersectWith(Rectangle other)
intersectWith
in class BaseBounds
public void intersectWith(BaseBounds other)
intersectWith
in class BaseBounds
public void intersectWith(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
intersectWith
in class BaseBounds
public boolean contains(Point2D p)
contains
in class BaseBounds
public boolean contains(float x, float y)
contains
in class BaseBounds
public 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 BaseBounds
public 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 BaseBounds
public boolean disjoint(float x, float y, float z, float width, float height, float depth)
public boolean isEmpty()
isEmpty
in class BaseBounds
public void roundOut()
roundOut
in class BaseBounds
public void grow(float h, float v, float d)
public BaseBounds deriveWithPadding(float h, float v, float d)
deriveWithPadding
in class BaseBounds
public BoxBounds makeEmpty()
makeEmpty
in class BaseBounds
protected void sortMinMax()
sortMinMax
in class BaseBounds
public void translate(float x, float y, float z)
translate
in class BaseBounds
Copyright © 2020. All rights reserved.