|
| RichFunnel () |
|
void | BuildFunnelCorridor (List< GraphNode > nodes, int start, int end) |
| Build a funnel corridor from a node list slice.
|
|
bool | FindNextCorners (Vector3 origin, int startIndex, List< Vector3 > funnelPath, int numCorners, out bool lastCorner) |
|
void | FindWalls (List< Vector3 > wallBuffer, float range) |
| Fill wallBuffer with all navmesh wall segments close to the current position.
|
|
RichFunnel | Initialize (RichPath path, IFunnelGraph graph) |
| Works like a constructor, but can be used even for pooled objects.
|
|
override void | OnEnterPool () |
|
void | SimplifyPath (IRaycastableGraph graph, List< GraphNode > nodes, int start, int end, List< GraphNode > result, Vector3 startPoint, Vector3 endPoint) |
| Simplifies a funnel path using linecasting.
|
|
Vector3 | Update (Vector3 position, List< Vector3 > buffer, int numCorners, out bool lastCorner, out bool requiresRepath) |
|
void | UpdateFunnelCorridor (int splitIndex, TriangleMeshNode prefix) |
| Split funnel at node index splitIndex and throw the nodes up to that point away and replace with prefix.
|
|
|
static void | SimplifyPath2 (IRaycastableGraph rcg, List< GraphNode > nodes, int start, int end, List< GraphNode > result, Vector3 startPoint, Vector3 endPoint) |
|
static void | SimplifyPath3 (IRaycastableGraph rcg, List< GraphNode > nodes, int start, int end, List< GraphNode > result, Vector3 startPoint, Vector3 endPoint, int depth=0) |
|
|
void | FindWalls (int nodeIndex, List< Vector3 > wallBuffer, Vector3 position, float range) |
|
Different algorithms for simplifying a funnel corridor using linecasting.
This makes the most sense when using tiled navmeshes. A lot of times, the funnel corridor can be improved by using funnel simplification. You will have to experiment and see which one of these give the best result on your map. In my own tests, iterative has usually given the best results, closesly followed by RecursiveTrinary which was the fastest one, recursive binary came last with both the worst quality and slowest execution time. But on other maps, it might be totally different.
- Enumerator:
None |
|
Iterative |
|
RecursiveBinary |
|
RecursiveTrinary |
|
void BuildFunnelCorridor |
( |
List< GraphNode > |
nodes, |
|
|
int |
start, |
|
|
int |
end |
|
) |
| |
Build a funnel corridor from a node list slice.
The nodes are assumed to be of type TriangleMeshNode.
- Parameters
-
start | Start index in the nodes array |
end | End index in the nodes array, this index is inclusive |
bool FindNextCorners |
( |
Vector3 |
origin, |
|
|
int |
startIndex, |
|
|
List< Vector3 > |
funnelPath, |
|
|
int |
numCorners, |
|
|
out bool |
lastCorner |
|
) |
| |
void FindWalls |
( |
List< Vector3 > |
wallBuffer, |
|
|
float |
range |
|
) |
| |
Fill wallBuffer with all navmesh wall segments close to the current position.
A wall segment is a node edge which is not shared by any other neighbour node, i.e an outer edge on the navmesh.
void FindWalls |
( |
int |
nodeIndex, |
|
|
List< Vector3 > |
wallBuffer, |
|
|
Vector3 |
position, |
|
|
float |
range |
|
) |
| |
|
private |
Works like a constructor, but can be used even for pooled objects.
Returns this for easy chaining
override void OnEnterPool |
( |
| ) |
|
|
virtual |
Simplifies a funnel path using linecasting.
Running time is roughly O(n^2 log n) in the worst case (where n = end-start) Actually it depends on how the graph looks, so in theory the actual upper limit on the worst case running time is O(n*m log n) (where n = end-start and m = nodes in the graph) but O(n^2 log n) is a much more realistic worst case limit.
Requires graph to implement IRaycastableGraph
static void SimplifyPath3 |
( |
IRaycastableGraph |
rcg, |
|
|
List< GraphNode > |
nodes, |
|
|
int |
start, |
|
|
int |
end, |
|
|
List< GraphNode > |
result, |
|
|
Vector3 |
startPoint, |
|
|
Vector3 |
endPoint, |
|
|
int |
depth = 0 |
|
) |
| |
|
static |
Vector3 Update |
( |
Vector3 |
position, |
|
|
List< Vector3 > |
buffer, |
|
|
int |
numCorners, |
|
|
out bool |
lastCorner, |
|
|
out bool |
requiresRepath |
|
) |
| |
Split funnel at node index splitIndex and throw the nodes up to that point away and replace with prefix.
Used when the AI has happened to get sidetracked and entered a node outside the funnel.
How to post process the funnel corridor.
int [] triBuffer = new int[3] |
|
private |
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Core/AI/RichPath.cs