The U4DPathfinderAStar class implements the Path Finding algorithm known as A Star algorithm.
More...
The U4DPathfinderAStar class implements the Path Finding algorithm known as A Star algorithm.
◆ assemblePath()
assembles the path computed using the A Star algorithm
- Parameters
-
uNavMeshNodes | nav mesh nodes creating the path |
- Returns
- container with segments representing the computed path
◆ findPath()
bool U4DEngine::U4DPathfinderAStar::findPath |
( |
std::vector< U4DNavMeshNode > |
uNavMeshNodeContainer, |
|
|
int |
uStartNodeIndex, |
|
|
int |
uEndNodeIndex, |
|
|
std::vector< U4DSegment > & |
uPath |
|
) |
| |
computes the path using the A Star algorithm
- Parameters
-
uNavMeshNodeContainer | navigation mesh containing the nav mesh nodes |
uStartNodeIndex | starting node to compute path |
uEndNodeIndex | ending node to compute path |
uPath | vector containing the computed path segments |
- Returns
- true if the path was able to be determined
◆ reHeapDown()
void U4DEngine::U4DPathfinderAStar::reHeapDown |
( |
int |
root, |
|
|
int |
bottom |
|
) |
| |
sorts the heap data structure using a heap-down implementation
- Parameters
-
root | root node in the data structure |
bottom | bottom node in the data structure |
◆ setCost()
sets the gCost, hCost and total cost of the current nav mesh node
- Parameters
-
uCurrentNode | current mesh node |
uStartNode | start mesh node |
uEndNode | end mesh node |
◆ swap()
void U4DEngine::U4DPathfinderAStar::swap |
( |
int |
uIndex1, |
|
|
int |
uIndex2 |
|
) |
| |
swaps the nodes indices. This is used to sort the Head data structure
- Parameters
-
uIndex1 | node1 index |
uIndex2 | node2 index |