public class AABB
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
Vec2 |
lowerBound
Bottom left vertex of bounding box.
|
Vec2 |
upperBound
Top right vertex of bounding box.
|
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
combine(AABB aabb)
Combines another aabb with this one
|
void |
combine(AABB aabb1,
AABB aab)
Combine two AABBs into this one.
|
boolean |
contains(AABB aabb)
Does this aabb contain the provided AABB.
|
Vec2 |
getCenter()
Get the center of the AABB
|
void |
getCenterToOut(Vec2 out) |
Vec2 |
getExtents()
Get the extents of the AABB (half-widths).
|
void |
getExtentsToOut(Vec2 out) |
float |
getPerimeter()
Gets the perimeter length
|
void |
getVertices(Vec2[] argRay) |
boolean |
isValid()
Verify that the bounds are sorted
|
boolean |
raycast(RayCastOutput output,
RayCastInput input)
Deprecated.
please use
raycast(RayCastOutput, RayCastInput, IWorldPool) for better
performance |
boolean |
raycast(RayCastOutput output,
RayCastInput input,
IWorldPool argPool)
From Real-time Collision Detection, p179.
|
void |
set(AABB aabb)
Sets this object from the given object
|
static boolean |
testOverlap(AABB a,
AABB b) |
java.lang.String |
toString() |
public final Vec2 lowerBound
public final Vec2 upperBound
public AABB()
public AABB(AABB copy)
copy
- the object to copy frompublic final void set(AABB aabb)
aabb
- the object to copy frompublic final boolean isValid()
public final Vec2 getCenter()
public final void getCenterToOut(Vec2 out)
public final Vec2 getExtents()
public final void getExtentsToOut(Vec2 out)
public final void getVertices(Vec2[] argRay)
public final void combine(AABB aabb1, AABB aab)
aabb1
- aab
- public final float getPerimeter()
public final void combine(AABB aabb)
aabb
- public final boolean contains(AABB aabb)
public final boolean raycast(RayCastOutput output, RayCastInput input)
raycast(RayCastOutput, RayCastInput, IWorldPool)
for better
performanceoutput
- input
- public final boolean raycast(RayCastOutput output, RayCastInput input, IWorldPool argPool)
output
- input
- public final java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2017. All Rights Reserved.