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

Quadtree for quick nearest neighbour search of rvo agents. More...

Detailed Description

Quadtree for quick nearest neighbour search of rvo agents.

See Also
Pathfinding.RVO.Simulator

Classes

struct  Node
 Node in a quadtree for storing RVO agents. More...
 
struct  QuadtreeQuery
 

Public Member Functions

void CalculateSpeeds ()
 
void Clear ()
 Removes all agents from the tree.
 
void DebugDraw ()
 
void Insert (Agent agent)
 Add a new agent to the tree.
 
void Query (Vector3 p, float speed, float timeHorizon, float agentRadius, Agent agent)
 Find all agents that could collide with an agent at position p within timeHorizon seconds.
 
void SetBounds (Vector3 min, Vector3 max)
 Set the bounding box of this quadtree.
 

Public Attributes

bool threeD
 

Private Member Functions

void DebugDrawRec (int i, float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)
 
int GetNodeIndex ()
 

Private Attributes

float bxmax
 
float bxmin
 
float bymax
 
float bymin
 
float bzmax
 
float bzmin
 
int filledNodes = 1
 
const int LeafSize = 15
 
float maxRadius = 0
 
Node[] nodes = new Node[16]
 

Member Function Documentation

void CalculateSpeeds ( )
void Clear ( )

Removes all agents from the tree.

void DebugDraw ( )
void DebugDrawRec ( int  i,
float  xmin,
float  xmax,
float  ymin,
float  ymax,
float  zmin,
float  zmax 
)
private
int GetNodeIndex ( )
private
void Insert ( Agent  agent)

Add a new agent to the tree.

Warning
Agents must not be added multiple times to the same tree
void Query ( Vector3  p,
float  speed,
float  timeHorizon,
float  agentRadius,
Agent  agent 
)

Find all agents that could collide with an agent at position p within timeHorizon seconds.

This method will call agent.InsertAgentNeighbour for each agent found.

void SetBounds ( Vector3  min,
Vector3  max 
)

Set the bounding box of this quadtree.

This must be done before adding any agents to the tree and all agents must be inside the bounding box.

Member Data Documentation

float bxmax
private
float bxmin
private
float bymax
private
float bymin
private
float bzmax
private
float bzmin
private
int filledNodes = 1
private
const int LeafSize = 15
private
float maxRadius = 0
private
Node [] nodes = new Node[16]
private
bool threeD

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