|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.math.collision.BoundingBox
public class BoundingBox
Encapsulates an axis aligned bounding box represented by a minimum and a maximum Vector. Additionally you can query for the bounding box's center, dimensions and corner points.
Field Summary | |
---|---|
Vector3 |
max
|
Vector3 |
min
|
Constructor Summary | |
---|---|
BoundingBox()
Constructs a new bounding box with the minimum and maximum vector set to zeros. |
|
BoundingBox(BoundingBox bounds)
Constructs a new bounding box from the given bounding box. |
|
BoundingBox(Vector3 minimum,
Vector3 maximum)
Constructs the new bounding box using the given minimum and maximum vector. |
Method Summary | |
---|---|
BoundingBox |
clr()
Sets the minimum and maximum vector to zeros |
boolean |
contains(BoundingBox b)
Returns whether the given bounding box is contained in this bounding box. |
boolean |
contains(Vector3 v)
Returns whether the given vector is contained in this bounding box. |
BoundingBox |
ext(BoundingBox a_bounds)
Extends this bounding box by the given bounding box. |
BoundingBox |
ext(BoundingBox bounds,
Matrix4 transform)
Extends this bounding box by the given transformed bounding box. |
BoundingBox |
ext(float x,
float y,
float z)
Extends the bounding box by the given vector. |
BoundingBox |
ext(Vector3 point)
Extends the bounding box to incorporate the given Vector3 . |
Vector3 |
getCenter()
|
Vector3[] |
getCorners()
|
Vector3 |
getDimensions()
|
Vector3 |
getMax()
|
Vector3 |
getMin()
|
BoundingBox |
inf()
Sets the minimum and maximum vector to positive and negative infinity. |
boolean |
intersects(BoundingBox b)
Returns whether the given bounding box is intersecting this bounding box (at least one point in). |
boolean |
isValid()
Returns whether this bounding box is valid. |
BoundingBox |
mul(Matrix4 matrix)
Multiplies the bounding box by the given matrix. |
BoundingBox |
set(BoundingBox bounds)
Sets the given bounding box. |
BoundingBox |
set(List<Vector3> points)
Sets the bounding box minimum and maximum vector from the given points. |
BoundingBox |
set(Vector3[] points)
Sets the bounding box minimum and maximum vector from the given points. |
BoundingBox |
set(Vector3 minimum,
Vector3 maximum)
Sets the given minimum and maximum vector. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final Vector3 min
public final Vector3 max
Constructor Detail |
---|
public BoundingBox()
public BoundingBox(BoundingBox bounds)
bounds
- The bounding box to copypublic BoundingBox(Vector3 minimum, Vector3 maximum)
minimum
- The minimum vectormaximum
- The maximum vectorMethod Detail |
---|
public Vector3 getCenter()
public Vector3[] getCorners()
public Vector3 getDimensions()
public Vector3 getMin()
public Vector3 getMax()
public BoundingBox set(BoundingBox bounds)
bounds
- The bounds.
public BoundingBox set(Vector3 minimum, Vector3 maximum)
minimum
- The minimum vectormaximum
- The maximum vector
public BoundingBox set(Vector3[] points)
points
- The points.
public BoundingBox set(List<Vector3> points)
points
- The points.
public BoundingBox inf()
public BoundingBox ext(Vector3 point)
Vector3
.
point
- The vector
public BoundingBox clr()
public boolean isValid()
public BoundingBox ext(BoundingBox a_bounds)
a_bounds
- The bounding box
public BoundingBox ext(BoundingBox bounds, Matrix4 transform)
bounds
- The bounding boxtransform
- The transformation matrix to apply to bounds, before using it to extend this bounding box.
public BoundingBox mul(Matrix4 matrix)
matrix
- The matrix
public boolean contains(BoundingBox b)
b
- The bounding box
public boolean intersects(BoundingBox b)
b
- The bounding box
public boolean contains(Vector3 v)
v
- The vector
public String toString()
toString
in class Object
public BoundingBox ext(float x, float y, float z)
x
- The x-coordinatey
- The y-coordinatez
- The z-coordinate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |