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

Classes

struct  HalfPlane
 

Public Member Functions

void Buffer ()
 
void UpdateMovement ()
 
void UpdateNeighbours ()
 
void UpdatePosition ()
 

Static Public Member Functions

static bool IntersectionFactor (Vector2 start1, Vector2 dir1, Vector2 start2, Vector2 dir2, out float factor)
 Returns the intersection factors for line 1 and line 2.
 

Public Attributes

float agentTimeHorizon
 
Vector2 bufferVelocity
 
bool debug
 
Vector2 desiredVelocity
 
float maxSpeed
 
float neighbourDistance
 
Vector2 position
 
float radius
 
NRVOCoreSimulator simulator
 
Vector2 velocity
 

Private Member Functions

bool ClosestOnHull (List< HalfPlane > halfPlanes, Vector2 query, out Vector2 result)
 Calculates the point closest to query that is outside all half planes.
 
void DrawCircle (Vector2 _p, float radius, Color col)
 
void DrawCircle (Vector2 _p, float radius, float a0, float a1, Color col)
 
void DrawCross (Vector2 p, float size=1)
 
void DrawCross (Vector2 p, Color col, float size=1)
 
void DrawVO (Vector2 circleCenter, float radius, Vector2 origin)
 

Static Private Member Functions

static Vector3 To3D (Vector2 p)
 

Private Attributes

List< NRVOAgentneighbours = new List<NRVOAgent>()
 

Member Function Documentation

void Buffer ( )
bool ClosestOnHull ( List< HalfPlane halfPlanes,
Vector2  query,
out Vector2  result 
)
private

Calculates the point closest to query that is outside all half planes.

Expected running time O(n) if the half planes are in random order. Worst case running time O(n^2).

Returns
true if there is such a point, false if there is not
See Also
Computational Geometry, Algorithms and Applications, Third Edition (page 71). Mark de Berg, Otfried Cheong, Marc van Kreveld, Mark Overmars.
void DrawCircle ( Vector2  _p,
float  radius,
Color  col 
)
private
void DrawCircle ( Vector2  _p,
float  radius,
float  a0,
float  a1,
Color  col 
)
private
void DrawCross ( Vector2  p,
float  size = 1 
)
private
void DrawCross ( Vector2  p,
Color  col,
float  size = 1 
)
private
void DrawVO ( Vector2  circleCenter,
float  radius,
Vector2  origin 
)
private
static bool IntersectionFactor ( Vector2  start1,
Vector2  dir1,
Vector2  start2,
Vector2  dir2,
out float  factor 
)
static

Returns the intersection factors for line 1 and line 2.

The intersection factors is a distance along the line start - end where the other line intersects it.

intersectionPoint = start1 + factor1 * (end1-start1)
intersectionPoint2 = start2 + factor2 * (end2-start2)

Lines are treated as infinite.
false is returned if the lines are parallel and true if they are not.

static Vector3 To3D ( Vector2  p)
staticprivate
void UpdateMovement ( )
void UpdateNeighbours ( )
void UpdatePosition ( )

Member Data Documentation

float agentTimeHorizon
Vector2 bufferVelocity
bool debug
Vector2 desiredVelocity
float maxSpeed
float neighbourDistance
List<NRVOAgent> neighbours = new List<NRVOAgent>()
private
Vector2 position
float radius
NRVOCoreSimulator simulator
Vector2 velocity

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