A* Pathfinding Project  4.0.8
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
RecastBBTree Class Reference

Axis Aligned Bounding Box Tree. More...

Detailed Description

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.

A* Pro Feature:
This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited
The Pro version can be bought here

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.
 

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 RectIntersectsRect (Rect r, Rect r2)
 

Private Attributes

RecastBBTreeBox root
 

Member Function Documentation

static Rect ExpandToContain ( Rect  r,
Rect  r2 
)
staticprivate

Returns a new rect which contains both r and r2.

static float ExpansionRequired ( Rect  r,
Rect  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)
void QueryBoxInBounds ( RecastBBTreeBox  box,
Rect  bounds,
List< RecastMeshObj boxes 
)
private
void QueryInBounds ( Rect  bounds,
List< RecastMeshObj buffer 
)

Queries the tree for all RecastMeshObjs inside the specified bounds.

Parameters
boundsWorld space bounds to search within
bufferThe results will be added to the buffer
static float RectArea ( Rect  r)
staticprivate

Returns the area of a rect.

static bool RectIntersectsRect ( Rect  r,
Rect  r2 
)
staticprivate
bool Remove ( RecastMeshObj  mesh)

Removes the specified mesh from the tree.

Assumes that it has the correct bounds information.

Returns
True if the mesh was removed from the tree, false otherwise.
RecastBBTreeBox RemoveBox ( RecastBBTreeBox  c,
RecastMeshObj  mesh,
Rect  bounds,
ref bool  found 
)
private

Member Data Documentation

RecastBBTreeBox root
private

The documentation for this class was generated from the following file: