org.jbox2d.collision
Class AABB

java.lang.Object
  extended by org.jbox2d.collision.AABB

public class AABB
extends Object

An axis-aligned bounding box.


Field Summary
 Vec2 lowerBound
          Bottom left vertex of bounding box.
 Vec2 upperBound
          Top right vertex of bounding box.
 
Constructor Summary
AABB()
          Creates the default object, with vertices at 0,0 and 0,0.
AABB(AABB copy)
          Copies from the given object
AABB(Vec2 lowerVertex, Vec2 upperVertex)
          Creates an AABB object using the given bounding vertices.
 
Method Summary
 boolean isValid()
          Verify that the bounds are sorted
 void set(AABB aabb)
          Sets this object from the given object
 boolean testOverlap(AABB box)
          Check if AABBs overlap.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lowerBound

public final Vec2 lowerBound
Bottom left vertex of bounding box.


upperBound

public final Vec2 upperBound
Top right vertex of bounding box.

Constructor Detail

AABB

public AABB()
Creates the default object, with vertices at 0,0 and 0,0.


AABB

public AABB(AABB copy)
Copies from the given object

Parameters:
copy - the object to copy from

AABB

public AABB(Vec2 lowerVertex,
            Vec2 upperVertex)
Creates an AABB object using the given bounding vertices.

Parameters:
lowerVertex - the bottom left vertex of the bounding box
maxVertex - the top right vertex of the bounding box
Method Detail

set

public final void set(AABB aabb)
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


testOverlap

public final boolean testOverlap(AABB box)
Check if AABBs overlap. djm optimized


toString

public final String toString()
Overrides:
toString in class Object