A* Pathfinding Project  3.8
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
Agent.VO Struct Reference

Public Member Functions

 VO (Vector2 offset, Vector2 p0, Vector2 dir, float weightFactor)
 Creates a VO to avoid the half plane created by the point p0 and has a tangent in the direction of dir.
 
 VO (Vector2 offset, Vector2 p1, Vector2 p2, Vector2 tang1, Vector2 tang2, float weightFactor)
 Creates a VO to avoid the three half planes with {point, tangent}s of {p1, p2-p1}, {p1, tang1}, {p2, tang2}.
 
 VO (Vector2 center, Vector2 offset, float radius, Vector2 sideChooser, float inverseDt, float weightFactor)
 Creates a VO for avoiding another agent.
 
Vector2 Sample (Vector2 p, out float weight)
 
float ScalarSample (Vector2 p)
 

Static Public Member Functions

static float Det (Vector2 a, Vector2 dir, Vector2 p)
 Returns a negative number of if p lies on the left side of a line which with one point in a and has a tangent in the direction of dir.
 
static bool Left (Vector2 a, Vector2 dir, Vector2 p)
 Returns if p lies on the left side of a line which with one point in a and has a tangent in the direction of dir.
 

Public Attributes

Vector2 center
 
bool colliding
 
Vector2 cutoffDir
 
Vector2 cutoffLine
 
Vector2 dir1
 
Vector2 dir2
 
bool leftSide
 
Vector2 line1
 
Vector2 line2
 
Vector2 origin
 
float radius
 
float sqrCutoffDistance
 
float weightFactor
 

Constructor & Destructor Documentation

VO ( Vector2  offset,
Vector2  p0,
Vector2  dir,
float  weightFactor 
)

Creates a VO to avoid the half plane created by the point p0 and has a tangent in the direction of dir.

Parameters
p0A point on the half plane border
dirThe normalized tangent to the half plane
weightFactorrelative amount of influence this VO should have on the agent
VO ( Vector2  offset,
Vector2  p1,
Vector2  p2,
Vector2  tang1,
Vector2  tang2,
float  weightFactor 
)

Creates a VO to avoid the three half planes with {point, tangent}s of {p1, p2-p1}, {p1, tang1}, {p2, tang2}.

tang1 and tang2 should be normalized.

VO ( Vector2  center,
Vector2  offset,
float  radius,
Vector2  sideChooser,
float  inverseDt,
float  weightFactor 
)

Creates a VO for avoiding another agent.

Member Function Documentation

static float Det ( Vector2  a,
Vector2  dir,
Vector2  p 
)
static

Returns a negative number of if p lies on the left side of a line which with one point in a and has a tangent in the direction of dir.

The number can be seen as the double signed area of the triangle {a, a+dir, p} multiplied by the length of dir. If length(dir)=1 this is also the distance from p to the line {a, a+dir}.

static bool Left ( Vector2  a,
Vector2  dir,
Vector2  p 
)
static

Returns if p lies on the left side of a line which with one point in a and has a tangent in the direction of dir.

Also returns true if the points are colinear.

Vector2 Sample ( Vector2  p,
out float  weight 
)
float ScalarSample ( Vector2  p)

Member Data Documentation

Vector2 center
bool colliding
Vector2 cutoffDir
Vector2 cutoffLine
Vector2 dir1
Vector2 dir2
bool leftSide
Vector2 line1
Vector2 line2
Vector2 origin
float radius
float sqrCutoffDistance
float weightFactor

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