A* Pathfinding Project
3.6.6
The A* Pathfinding Project for Unity 3D
|
Axis Aligned Bounding Box Tree. More...
Axis Aligned Bounding Box Tree.
Holds a bounding box tree of triangles.
Performance: Insertion - Practically O(1) - About 0.003 ms
Public Member Functions | |
Rect | ExpandToContain (Rect r, Rect r2) |
Returns a new rect which contains both r and r2. | |
float | ExpansionRequired (Rect r, Rect r2) |
Returns the difference in area between r and r expanded to contain r2. | |
void | Insert (RecastMeshObj mesh) |
Inserts a mesh node in the tree. | |
void | OnDrawGizmos () |
void | OnDrawGizmos (RecastBBTreeBox box) |
void | QueryBoxInBounds (RecastBBTreeBox box, Rect bounds, List< RecastMeshObj > boxes) |
void | QueryInBounds (Rect bounds, List< RecastMeshObj > buffer) |
Queries the tree for the best node, searching within a circle around p with the specified radius. | |
float | RectArea (Rect r) |
Returns the area of a rect. | |
bool | RectContains (Rect r, Vector3 p) |
Returns if a rect contains the 3D point in XZ space. | |
bool | RectIntersectsCircle (Rect r, Vector3 p, float radius) |
bool | RectIntersectsRect (Rect r, Rect r2) |
bool | Remove (RecastMeshObj mesh) |
Removes the specified mesh from the tree. | |
void | TestIntersections (Vector3 p, float radius) |
void | TestIntersections (RecastBBTreeBox box, Vector3 p, float radius) |
new void | ToString () |
bool | XIntersectsCircle (float x1, float x2, float zpos, Vector3 circle, float radius) |
bool | ZIntersectsCircle (float z1, float z2, float xpos, Vector3 circle, float radius) |
Public Attributes | |
RecastBBTreeBox | root |
Private Member Functions | |
RecastBBTreeBox | RemoveBox (RecastBBTreeBox c, RecastMeshObj mesh, Rect bounds, ref bool found) |
Rect ExpandToContain | ( | Rect | r, |
Rect | r2 | ||
) |
Returns a new rect which contains both r and r2.
float ExpansionRequired | ( | Rect | r, |
Rect | r2 | ||
) |
Returns the difference in area between r and r expanded to contain r2.
void Insert | ( | RecastMeshObj | mesh | ) |
Inserts a mesh node in the tree.
void OnDrawGizmos | ( | ) |
void OnDrawGizmos | ( | RecastBBTreeBox | box | ) |
void QueryBoxInBounds | ( | RecastBBTreeBox | box, |
Rect | bounds, | ||
List< RecastMeshObj > | boxes | ||
) |
void QueryInBounds | ( | Rect | bounds, |
List< RecastMeshObj > | buffer | ||
) |
Queries the tree for the best node, searching within a circle around p with the specified radius.
Will fill in both the constrained node and the not constrained node in the NNInfo.
This search will start from the previous NNInfo and improve it if possible. Even if the search fails on this call, the solution will never be worse than previous.
distance | The best distance for the previous solution. Will be updated with the best distance after this search. Will be positive infinity if no node could be found. Set to positive infinity if there was no previous solution. |
float RectArea | ( | Rect | r | ) |
Returns the area of a rect.
bool RectContains | ( | Rect | r, |
Vector3 | p | ||
) |
Returns if a rect contains the 3D point in XZ space.
bool RectIntersectsCircle | ( | Rect | r, |
Vector3 | p, | ||
float | radius | ||
) |
bool RectIntersectsRect | ( | Rect | r, |
Rect | r2 | ||
) |
bool Remove | ( | RecastMeshObj | mesh | ) |
Removes the specified mesh from the tree.
Assumes that it has the correct bounds information.
|
private |
void TestIntersections | ( | Vector3 | p, |
float | radius | ||
) |
void TestIntersections | ( | RecastBBTreeBox | box, |
Vector3 | p, | ||
float | radius | ||
) |
new void ToString | ( | ) |
bool XIntersectsCircle | ( | float | x1, |
float | x2, | ||
float | zpos, | ||
Vector3 | circle, | ||
float | radius | ||
) |
bool ZIntersectsCircle | ( | float | z1, |
float | z2, | ||
float | xpos, | ||
Vector3 | circle, | ||
float | radius | ||
) |
RecastBBTreeBox root |