A* Pathfinding Project  3.1.4
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Enumerations Properties Groups Pages
Agent Class Reference
+ Inheritance diagram for Agent:
+ Collaboration diagram for Agent:

Public Member Functions

 Agent (Vector3 pos)
 
void BufferSwitch ()
 
void CalculateNeighbours ()
 
void CalculateVelocity ()
 
float det (Vector3 a, Vector3 b)
 
float det (Vector2 a, Vector2 b)
 
float InsertAgentNeighbour (Agent agent, float rangeSq)
 
void InsertObstacleNeighbour (ObstacleVertex ob1, float rangeSq)
 
void Interpolate (float t)
 
void PreUpdatePosition ()
 
void Update ()
 

Public Attributes

bool locked = false
 
int maxNeighbours
 
Vector3 position
 
float radius
 
Simulator simulator
 Simulator which handles this agent.
 

Static Public Attributes

static System.Diagnostics.Stopwatch watch1 = new System.Diagnostics.Stopwatch()
 
static System.Diagnostics.Stopwatch watch2 = new System.Diagnostics.Stopwatch()
 

Properties

float AgentTimeHorizon [get, set]
 
bool DebugDraw [get, set]
 
Vector3 DesiredVelocity [get, set]
 
float Height [get, set]
 
Vector3 InterpolatedPosition [get]
 
bool Locked [get, set]
 
int MaxNeighbours [get, set]
 
float MaxSpeed [get, set]
 
float NeighbourDist [get, set]
 
List< ObstacleVertexNeighbourObstacles [get]
 
float ObstacleTimeHorizon [get, set]
 
Vector3 Position [get, set]
 
float Radius [get, set]
 
Vector3 Velocity [get, set]
 
- Properties inherited from IAgent
float AgentTimeHorizon [get, set]
 
bool DebugDraw [get, set]
 
Vector3 DesiredVelocity [get, set]
 
float Height [get, set]
 Height of the agent.
 
Vector3 InterpolatedPosition [get]
 Interpolated position of agent.
 
bool Locked [get, set]
 
int MaxNeighbours [get, set]
 
float MaxSpeed [get, set]
 Max speed of the agent.
 
float NeighbourDist [get, set]
 
List< ObstacleVertexNeighbourObstacles [get]
 
float ObstacleTimeHorizon [get, set]
 
Vector3 Position [get, set]
 
float Radius [get, set]
 Radius of the agent.
 
Vector3 Velocity [get, set]
 

Private Member Functions

bool LinearProgram1 (List< Line > lines, int lineNo, float radius, Vector2 optVelocity, bool directionOpt, ref Vector2 result)
 
int LinearProgram2 (List< Line > lines, float radius, Vector2 optVelocity, bool directionOpt, ref Vector2 result)
 
void LinearProgram3 (List< Line > lines, int numObstLines, int beginLine, float radius, ref Vector2 result)
 
float Sqr (float v)
 

Static Private Member Functions

static float DistSqPointLineSegment (Vector3 a, Vector3 b, Vector3 c)
 
static float DistSqPointLineSegment (Vector2 a, Vector2 b, Vector2 c)
 

Private Attributes

float agentTimeHorizon
 
Vector3 desiredVelocity
 
float height
 
float maxSpeed
 
float neighbourDist
 
List< float > neighbourDists = new List<float>()
 
List< Agentneighbours = new List<Agent>()
 
Vector3 newVelocity
 
List< float > obstacleDists = new List<float>()
 
List< ObstacleVertexobstacles = new List<ObstacleVertex>()
 
List< ObstacleVertexobstaclesBuffered = new List<ObstacleVertex>()
 
float obstacleTimeHorizon
 
List< LineorcaLines = new List<Line>()
 
Vector3 prevSmoothPos
 
List< LineprojLines = new List<Line>()
 
Vector3 smoothPos
 
Vector3 velocity
 
float weight
 

Member Data Documentation

Simulator simulator

Simulator which handles this agent.

Used by this script as a reference and to prevent adding this agent to multiple simulations.


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