Velocity Obstacle.
More...
Velocity Obstacle.
This is a struct to avoid too many allocations.
- See also
- https://en.wikipedia.org/wiki/Velocity_obstacle
|
static float2 | Normalize (float2 v, out float length) |
|
static float | SignedDistanceFromLine (float2 a, float2 dir, float2 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. More...
|
|
◆ VO()
VO |
( |
float2 |
center, |
|
|
float2 |
offset, |
|
|
float |
radius, |
|
|
float |
inverseDt, |
|
|
float |
inverseDeltaTime |
|
) |
| |
Creates a VO for avoiding another agent.
- Parameters
-
center | The position of the other agent relative to this agent. |
offset | Offset of the velocity obstacle. For example to account for the agents' relative velocities. |
radius | Combined radius of the two agents (radius1 + radius2). |
inverseDt | 1 divided by the local avoidance time horizon (e.g avoid agents that we will hit within the next 2 seconds). |
inverseDeltaTime | 1 divided by the time step length. |
◆ Draw()
◆ Gradient()
float2 Gradient |
( |
float2 |
p, |
|
|
out float |
weight |
|
) |
| |
Gradient and value of the cost function of this VO.
The VO has a cost function which is 0 outside the VO and increases inside it as the point moves further into the VO.
This is the negative gradient of that function as well as its value (the weight). The negative gradient points in the direction where the function decreases the fastest.
The value of the function is the distance to the closest edge of the VO and the gradient is normalized.
◆ Normalize()
static float2 Normalize |
( |
float2 |
v, |
|
|
out float |
length |
|
) |
| |
|
static |
◆ ScaledGradient()
float2 ScaledGradient |
( |
float2 |
p, |
|
|
out float |
weight |
|
) |
| |
Gradient and value of the cost function of this VO.
Very similar to the Gradient method however the gradient and value have been scaled and tweaked slightly.
◆ SignedDistanceFromLine()
static float SignedDistanceFromLine |
( |
float2 |
a, |
|
|
float2 |
dir, |
|
|
float2 |
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 dir.magnitude=1 this is also the distance from p to the line {a, a+dir}.
◆ circleCenter
◆ colliding
◆ cutoffDir
◆ cutoffLine
◆ dir1
◆ dir2
◆ line1
◆ line2
◆ radius
◆ segment
◆ weightBonus
◆ weightFactor
The documentation for this struct was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Core/RVO/RVOAgentBurst.cs