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

KD-Tree implementation for rvo agents. More...

Detailed Description

KD-Tree implementation for rvo agents.

See Also
Pathfinding.RVO.Simulator
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

Classes

struct  AgentTreeNode
 
class  ObstacleTreeNode
 

Public Member Functions

 KDTree (Simulator simulator)
 
void BuildAgentTree ()
 
void BuildObstacleTree ()
 
void GetAgentNeighbours (Agent agent, float rangeSq)
 
void GetObstacleNeighbours (Agent agent, float rangeSq)
 
void RebuildAgents ()
 

Private Member Functions

void BuildAgentTreeRecursive (int start, int end, int node)
 
ObstacleTreeNode BuildObstacleTreeRecursive (List< ObstacleVertex > obstacles)
 
int countDepth (ObstacleTreeNode node)
 
void QueryAgentTreeRecursive (Agent agent, ref float rangeSq, int node)
 
void QueryObstacleTreeRecursive (Agent agent, float rangeSq, ObstacleTreeNode node)
 
float Sqr (float v)
 

Static Private Member Functions

static ObstacleTreeNode GetOTN ()
 
static void RecycleOTN (ObstacleTreeNode node)
 

Private Attributes

List< Agentagents
 
AgentTreeNode[] agentTree
 
const int MAX_LEAF_SIZE = 10
 
ObstacleTreeNode obstacleRoot
 
bool rebuildAgents = false
 
Simulator simulator
 

Static Private Attributes

static Stack< ObstacleTreeNodeOTNPool = new Stack<ObstacleTreeNode>()
 

Constructor & Destructor Documentation

KDTree ( Simulator  simulator)

Member Function Documentation

void BuildAgentTree ( )
void BuildAgentTreeRecursive ( int  start,
int  end,
int  node 
)
private
void BuildObstacleTree ( )
ObstacleTreeNode BuildObstacleTreeRecursive ( List< ObstacleVertex obstacles)
private
int countDepth ( ObstacleTreeNode  node)
private
void GetAgentNeighbours ( Agent  agent,
float  rangeSq 
)
void GetObstacleNeighbours ( Agent  agent,
float  rangeSq 
)
static ObstacleTreeNode GetOTN ( )
staticprivate
void QueryAgentTreeRecursive ( Agent  agent,
ref float  rangeSq,
int  node 
)
private
void QueryObstacleTreeRecursive ( Agent  agent,
float  rangeSq,
ObstacleTreeNode  node 
)
private
void RebuildAgents ( )
static void RecycleOTN ( ObstacleTreeNode  node)
staticprivate
float Sqr ( float  v)
private

Member Data Documentation

List<Agent> agents
private
AgentTreeNode [] agentTree
private
const int MAX_LEAF_SIZE = 10
private
ObstacleTreeNode obstacleRoot
private
Stack<ObstacleTreeNode> OTNPool = new Stack<ObstacleTreeNode>()
staticprivate
bool rebuildAgents = false
private
Simulator simulator
private

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