Class AABB
java.lang.Object
org.jbox2d.collision.AABB
public class AABB
extends java.lang.Object
An axis-aligned bounding box.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidCombines another aabb with this onefinal voidCombine two AABBs into this one.final booleanDoes this aabb contain the provided AABB.final Vec2Get the center of the AABBfinal voidgetCenterToOut(Vec2 out) final Vec2Get the extents of the AABB (half-widths).final voidgetExtentsToOut(Vec2 out) final floatGets the perimeter lengthfinal voidgetVertices(Vec2[] argRay) final booleanisValid()Verify that the bounds are sortedfinal booleanraycast(RayCastOutput output, RayCastInput input) Deprecated.final booleanraycast(RayCastOutput output, RayCastInput input, IWorldPool argPool) From Real-time Collision Detection, p179.final voidSets this object from the given objectstatic final booleantestOverlap(AABB a, AABB b) final java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
lowerBound
Bottom left vertex of bounding box. -
upperBound
Top right vertex of bounding box.
-
-
Constructor Details
-
AABB
public AABB()Creates the default object, with vertices at 0,0 and 0,0. -
AABB
-
AABB
-
-
Method Details
-
set
Sets this object from the given object- Parameters:
aabb- the object to copy from
-
isValid
public final boolean isValid()Verify that the bounds are sorted -
getCenter
-
getCenterToOut
-
getExtents
-
getExtentsToOut
-
getVertices
-
combine
-
getPerimeter
public final float getPerimeter()Gets the perimeter length- Returns:
-
combine
-
contains
-
raycast
Deprecated.please useraycast(RayCastOutput, RayCastInput, IWorldPool)for better performance- Parameters:
output-input-- Returns:
-
raycast
From Real-time Collision Detection, p179.- Parameters:
output-input-
-
testOverlap
-
toString
public final java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
raycast(RayCastOutput, RayCastInput, IWorldPool)for better performance