Function Path.OpenCandidateConnection

OpenCandidateConnection (uint parentPathNode, uint targetPathNode, uint parentG, uint connectionCost, uint fractionAlongEdge, Int3 targetNodePosition)

Opens a connection between two nodes during the A* search.

Public
void OpenCandidateConnection (

uint

parentPathNode

The node that is being opened.

uint

targetPathNode

A neighbour of the parent that is being considered.

uint

parentG

The G value of the parent node. This is the cost to reach the parent node from the start of the path.

uint

connectionCost

The cost of moving from the parent node to the target node.

uint

fractionAlongEdge

Internal value used by the TriangleMeshNode to store where on the shared edge between the nodes we say we cross over.

Int3

targetNodePosition

The position of the target node. This is used by the heuristic to estimate the cost to reach the end node.

)

Opens a connection between two nodes during the A* search.

When a node is "opened" (i.e. searched by the A* algorithm), it will open connections to all its neighbours. This function checks those connections to see if passing through the node to its neighbour is the best way to reach the neighbour that we have seen so far, and if so, it will push the neighbour onto the search heap.