A* Pathfinding Project  3.6.2
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 triangles.
Performance: Insertion - Practically O(1) - About 0.003 ms

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

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)
 

Member Function Documentation

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.

See Also
QueryClosestQueries the tree for the closest node to p constrained by the NNConstraint. Note that this function will, unlike QueryCircle, only fill in the constrained node. If you want a node not constrained by any NNConstraint, do an additional search with constraint = NNConstraint.None
QueryCircleQueries the tree for the closest node to p constrained by the NNConstraint trying to improve an existing solution. Note that this function will, unlike QueryCircle, only fill in the constrained node. If you want a node not constrained by any NNConstraint, do an additional search with constraint = NNConstraint.None

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.

Parameters
distanceThe 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.
See Also
QueryCircle
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.

Returns
True if the mesh was removed from the tree, false otherwise.
RecastBBTreeBox RemoveBox ( RecastBBTreeBox  c,
RecastMeshObj  mesh,
Rect  bounds,
ref bool  found 
)
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 
)

Member Data Documentation


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