Package org.jbox2d.collision
Class AABB
java.lang.Object
org.jbox2d.collision.AABB
An axis-aligned bounding box.
- Author:
- Daniel Murphy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidCombines another aabb with this one.final voidCombine two AABBs into this one.final booleanDoes this aabb contain the provided AABB.final Vec2Get the center of the AABB.final voidgetCenterToOut(Vec2 out) final Vec2Get the extents of the AABB (half-widths).final voidgetExtentsToOut(Vec2 out) final floatGets the perimeter length.final voidgetVertices(Vec2[] argRay) final booleanisValid()Verify that the bounds are sorted.final booleanraycast(RayCastOutput output, RayCastInput input) Deprecated.final booleanraycast(RayCastOutput output, RayCastInput input, WorldPool argPool) From Real-time Collision Detection, p179.final voidSets this object from the given object.static booleantestOverlap(AABB a, AABB b) final StringtoString()
-
Field Details
-
lowerBound
The bottom left vertex of the bounding box. -
upperBound
The top right vertex of the bounding box.
-
-
Constructor Details
-
AABB
public AABB()Creates the default object, with vertices at 0,0 and 0,0. -
AABB
Copies from the given object.- Parameters:
copy- The object to copy from.
-
AABB
Creates an AABB object using the given bounding vertices.- Parameters:
lowerVertex- The bottom left vertex of the bounding box.upperVertex- The top right vertex of the bounding box.
-
-
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
Get the center of the AABB. -
getCenterToOut
-
getExtents
Get the extents of the AABB (half-widths). -
getExtentsToOut
-
getVertices
-
combine
Combine two AABBs into this one. -
getPerimeter
public final float getPerimeter()Gets the perimeter length. -
combine
Combines another aabb with this one. -
contains
Does this aabb contain the provided AABB. -
raycast
Deprecated.please useraycast(RayCastOutput, RayCastInput, WorldPool)for better performance -
raycast
From Real-time Collision Detection, p179. -
testOverlap
-
toString
-
raycast(RayCastOutput, RayCastInput, WorldPool)for better performance