A* Pathfinding Project
3.1.4
The A* Pathfinding Project for Unity 3D
|
Binary heap implementation. More...
Public Member Functions | |
BinaryHeapM (int numberOfElements) | |
void | Add (NodeRun node) |
Adds a node to the heap. | |
void | Clear () |
NodeRun | GetNode (int i) |
void | Rebuild () |
Rebuilds the heap by trickeling down all items. | |
NodeRun | Remove () |
Returns the node with the lowest F score from the heap. | |
Public Attributes | |
float | growthFactor = 2 |
int | numberOfItems |
Private Attributes | |
NodeRun[] | binaryHeap |
Binary heap implementation.
Binary heaps are really fast for ordering nodes in a way that makes it possible to get the node with the lowest F score. Also known as a priority queue.
void Rebuild | ( | ) |
Rebuilds the heap by trickeling down all items.
Usually called after the hTarget on a path has been changed