◆ RichFunnel()
◆ BuildFunnelCorridor()
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
-
nodes | Nodes to build the funnel corridor from |
start | Start index in the nodes list |
end | End index in the nodes list, this index is inclusive |
◆ CheckForDestroyedNodes()
bool CheckForDestroyedNodes |
( |
| ) |
|
|
private |
True if any node in the path is destroyed.
◆ ClampToNavmesh()
Vector3 ClampToNavmesh |
( |
Vector3 |
position | ) |
|
Clamps the position to the navmesh and repairs the path if the agent has moved slightly outside it.
You should not call this method with anything other than the agent's position.
◆ ClampToNavmeshInternal()
bool ClampToNavmeshInternal |
( |
ref Vector3 |
position | ) |
|
|
private |
Searches for the node the agent is inside.
This will also clamp the position to the navmesh and repair the funnel cooridor if the agent moves slightly outside it.
- Returns
- True if nodes along the path have been destroyed so that a path recalculation is required
◆ FindNextCorners()
bool FindNextCorners |
( |
Vector3 |
origin, |
|
|
int |
startIndex, |
|
|
List< Vector3 > |
funnelPath, |
|
|
int |
numCorners, |
|
|
out bool |
lastCorner |
|
) |
| |
|
private |
◆ FindWalls() [1/2]
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.
◆ FindWalls() [2/2]
void FindWalls |
( |
int |
nodeIndex, |
|
|
List< Vector3 > |
wallBuffer, |
|
|
Vector3 |
position, |
|
|
float |
range |
|
) |
| |
|
private |
◆ Initialize()
Works like a constructor, but can be used even for pooled objects.
Returns this for easy chaining
◆ OnEnterPool()
override void OnEnterPool |
( |
| ) |
|
|
virtual |
◆ Update()
Vector3 Update |
( |
Vector3 |
position, |
|
|
List< Vector3 > |
buffer, |
|
|
int |
numCorners, |
|
|
out bool |
lastCorner, |
|
|
out bool |
requiresRepath |
|
) |
| |
Find the next points to move towards and clamp the position to the navmesh.
- Parameters
-
position | The position of the agent. |
buffer | Will be filled with up to numCorners points which are the next points in the path towards the target. |
numCorners | See buffer. |
lastCorner | True if the buffer contains the end point of the path. |
requiresRepath | True if nodes along the path have been destroyed and a path recalculation is necessary. |
- Returns
- The position of the agent clamped to make sure it is inside the navmesh.
◆ UpdateFunnelCorridor()
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.
◆ checkForDestroyedNodesCounter
int checkForDestroyedNodesCounter |
|
private |
◆ currentNode
◆ currentPosition
◆ exactEnd
◆ exactStart
◆ funnelSimplification
bool funnelSimplification = true |
Post process the funnel corridor or not.
◆ graph
◆ left
readonly List<Vector3> left |
|
private |
◆ navmeshClampDict
Cached object to avoid unnecessary allocations.
◆ navmeshClampList
Cached object to avoid unnecessary allocations.
◆ navmeshClampQueue
Cached object to avoid unnecessary allocations.
◆ nodes
◆ path
◆ right
readonly List<Vector3> right |
|
private |
◆ triBuffer
int [] triBuffer = new int[3] |
|
private |
◆ CurrentNode
◆ DistanceToEndOfPath
float DistanceToEndOfPath |
|
get |
Approximate distance (as the crow flies) to the endpoint of this path part.
- See also
- exactEnd
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Core/AI/RichPath.cs