A* Pathfinding Project
3.8.1
The A* Pathfinding Project for Unity 3D
|
Axis Aligned Bounding Box Tree. More...
Axis Aligned Bounding Box Tree.
Holds a bounding box tree of RecastMeshObj components.
Note that it assumes that once an object has been added, it stays at the same world position. If it is moved, then it might not be able to be found.
Public Member Functions | |
void | Insert (RecastMeshObj mesh) |
Inserts a RecastMeshObj in the tree at its current position. | |
void | OnDrawGizmos () |
void | OnDrawGizmos (RecastBBTreeBox box) |
void | QueryInBounds (Rect bounds, List< RecastMeshObj > buffer) |
Queries the tree for all RecastMeshObjs inside the specified bounds. | |
bool | Remove (RecastMeshObj mesh) |
Removes the specified mesh from the tree. | |
new void | ToString () |
Public Attributes | |
RecastBBTreeBox | root |
Private Member Functions | |
void | QueryBoxInBounds (RecastBBTreeBox box, Rect bounds, List< RecastMeshObj > boxes) |
RecastBBTreeBox | RemoveBox (RecastBBTreeBox c, RecastMeshObj mesh, Rect bounds, ref bool found) |
Static Private Member Functions | |
static Rect | ExpandToContain (Rect r, Rect r2) |
Returns a new rect which contains both r and r2. | |
static float | ExpansionRequired (Rect r, Rect r2) |
Returns the difference in area between r and r expanded to contain r2. | |
static float | RectArea (Rect r) |
Returns the area of a rect. | |
static bool | RectContains (Rect r, Vector3 p) |
Returns if a rect contains the 3D point in XZ space. | |
static bool | RectIntersectsCircle (Rect r, Vector3 p, float radius) |
static bool | RectIntersectsRect (Rect r, Rect r2) |
static bool | XIntersectsCircle (float x1, float x2, float zpos, Vector3 circle, float radius) |
static bool | ZIntersectsCircle (float z1, float z2, float xpos, Vector3 circle, float radius) |
|
staticprivate |
Returns a new rect which contains both r and r2.
|
staticprivate |
Returns the difference in area between r and r expanded to contain r2.
void Insert | ( | RecastMeshObj | mesh | ) |
Inserts a RecastMeshObj in the tree at its current position.
void OnDrawGizmos | ( | ) |
void OnDrawGizmos | ( | RecastBBTreeBox | box | ) |
|
private |
void QueryInBounds | ( | Rect | bounds, |
List< RecastMeshObj > | buffer | ||
) |
Queries the tree for all RecastMeshObjs inside the specified bounds.
bounds | World space bounds to search within |
buffer | The results will be added to the buffer |
|
staticprivate |
Returns the area of a rect.
|
staticprivate |
Returns if a rect contains the 3D point in XZ space.
|
staticprivate |
|
staticprivate |
bool Remove | ( | RecastMeshObj | mesh | ) |
Removes the specified mesh from the tree.
Assumes that it has the correct bounds information.
|
private |
new void ToString | ( | ) |
|
staticprivate |
|
staticprivate |
RecastBBTreeBox root |