APIdia Launch Partner
Top Fields Constructors Methods
com.badlogic.gdx.math.collision

public Class OrientedBoundingBox

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
com.badlogic.gdx.math.Intersector, .Matrix4, .Vector3, java.io.Serializable

Field Summary

Modifier and TypeField and Description
private final Vector3[]
private final BoundingBox
bounds

Bounds used as size.

private final Matrix4
private static final long
private static final Vector3[]
private static final Vector3[]
private static final Vector3[]
public final Matrix4
transform

Transform matrix.

private final Vector3[]

Constructor Summary

AccessConstructor and Description
public
OrientedBoundingBox()

Constructs a new oriented bounding box with the minimum and maximum vector set to zeros.

public
OrientedBoundingBox(BoundingBox
The bounding box to copy
bounds
)

Constructs a new oriented bounding box from the given bounding box.

public
OrientedBoundingBox(BoundingBox
The bounding box to copy
bounds
,
Matrix4
The transformation matrix to copy
transform
)

Constructs a new oriented bounding box from the given bounding box and transform.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

Whether the vector is contained or not.
contains
(Vector3
The vector
v
)

Returns whether the given vector is contained in this oriented bounding box.

private boolean
contains(Vector3 v, Matrix4 invTransform)

public boolean

Returns:

Whether the given bounding box is contained
contains
(BoundingBox
The bounding box
b
)

Returns whether the given bounding box is contained in this oriented bounding box.

public boolean

Returns:

Whether the given oriented bounding box is contained
contains
(OrientedBoundingBox
The oriented bounding box
obb
)

Returns whether the given oriented bounding box is contained in this oriented bounding box.

public BoundingBox
getBounds()

Get the current bounds.

public Vector3
getCorner000(final Vector3 out)

public Vector3
getCorner001(final Vector3 out)

public Vector3
getCorner010(final Vector3 out)

public Vector3
getCorner011(final Vector3 out)

public Vector3
getCorner100(final Vector3 out)

public Vector3
getCorner101(final Vector3 out)

public Vector3
getCorner110(final Vector3 out)

public Vector3
getCorner111(final Vector3 out)

public Matrix4
getTransform()

Get the current transformation matrix.

public Vector3[]
private Vector3[]
private void
init()

public boolean

Returns:

Whether the given bounding box is intersected
intersects
(BoundingBox
The bounding box
b
)

Returns whether the given bounding box is intersecting this oriented bounding box (at least one point in).

public boolean

Returns:

Whether the given bounding box is intersected
intersects
(OrientedBoundingBox
The oriented bounding box
obb
)

Returns whether the given oriented bounding box is intersecting this oriented bounding box (at least one point in).

public void
mul(Matrix4 transform)

public OrientedBoundingBox
set(BoundingBox bounds, Matrix4 transform)

public void
setBounds(BoundingBox
The bounding box to copy
bounds
)

Sets the base bounds of the oriented bounding box as the bounds given, the transform is applied to the vertices.

public void
setTransform(Matrix4 transform)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

axesback to summary
private final Vector3[] axes
boundsback to summary
private final BoundingBox bounds

Bounds used as size.

inverseTransformback to summary
private final Matrix4 inverseTransform
serialVersionUIDback to summary
private static final long serialVersionUID
tempAxesback to summary
private static final Vector3[] tempAxes
tempVerticesback to summary
private static final Vector3[] tempVertices
tmpVectorsback to summary
private static final Vector3[] tmpVectors
transformback to summary
public final Matrix4 transform

Transform matrix.

verticesback to summary
private final Vector3[] vertices

Constructor Detail

OrientedBoundingBoxback to summary
public OrientedBoundingBox()

Constructs a new oriented bounding box with the minimum and maximum vector set to zeros.

OrientedBoundingBoxback to summary
public OrientedBoundingBox(BoundingBox bounds)

Constructs a new oriented bounding box from the given bounding box.

Parameters
bounds:BoundingBox

The bounding box to copy

OrientedBoundingBoxback to summary
public OrientedBoundingBox(BoundingBox bounds, Matrix4 transform)

Constructs a new oriented bounding box from the given bounding box and transform.

Parameters
bounds:BoundingBox

The bounding box to copy

transform:Matrix4

The transformation matrix to copy

Method Detail

containsback to summary
public boolean contains(Vector3 v)

Returns whether the given vector is contained in this oriented bounding box.

Parameters
v:Vector3

The vector

Returns:boolean

Whether the vector is contained or not.

containsback to summary
private boolean contains(Vector3 v, Matrix4 invTransform)
containsback to summary
public boolean contains(BoundingBox b)

Returns whether the given bounding box is contained in this oriented bounding box.

Parameters
b:BoundingBox

The bounding box

Returns:boolean

Whether the given bounding box is contained

containsback to summary
public boolean contains(OrientedBoundingBox obb)

Returns whether the given oriented bounding box is contained in this oriented bounding box.

Parameters
obb:OrientedBoundingBox

The oriented bounding box

Returns:boolean

Whether the given oriented bounding box is contained

getBoundsback to summary
public BoundingBox getBounds()

Get the current bounds. Call update() if you manually change this bounding box.

getCorner000back to summary
public Vector3 getCorner000(final Vector3 out)
getCorner001back to summary
public Vector3 getCorner001(final Vector3 out)
getCorner010back to summary
public Vector3 getCorner010(final Vector3 out)
getCorner011back to summary
public Vector3 getCorner011(final Vector3 out)
getCorner100back to summary
public Vector3 getCorner100(final Vector3 out)
getCorner101back to summary
public Vector3 getCorner101(final Vector3 out)
getCorner110back to summary
public Vector3 getCorner110(final Vector3 out)
getCorner111back to summary
public Vector3 getCorner111(final Vector3 out)
getTransformback to summary
public Matrix4 getTransform()

Get the current transformation matrix. Call update() if you manually change this matrix.

getVerticesback to summary
public Vector3[] getVertices()
getVerticesback to summary
private Vector3[] getVertices(BoundingBox b)
initback to summary
private void init()
intersectsback to summary
public boolean intersects(BoundingBox b)

Returns whether the given bounding box is intersecting this oriented bounding box (at least one point in).

Parameters
b:BoundingBox

The bounding box

Returns:boolean

Whether the given bounding box is intersected

intersectsback to summary
public boolean intersects(OrientedBoundingBox obb)

Returns whether the given oriented bounding box is intersecting this oriented bounding box (at least one point in).

Parameters
obb:OrientedBoundingBox

The oriented bounding box

Returns:boolean

Whether the given bounding box is intersected

mulback to summary
public void mul(Matrix4 transform)
setback to summary
public OrientedBoundingBox set(BoundingBox bounds, Matrix4 transform)
setBoundsback to summary
public void setBounds(BoundingBox bounds)

Sets the base bounds of the oriented bounding box as the bounds given, the transform is applied to the vertices.

Parameters
bounds:BoundingBox

The bounding box to copy

setTransformback to summary
public void setTransform(Matrix4 transform)
updateback to summary
private void update()