A* Pathfinding Project
3.7.3
The A* Pathfinding Project for Unity 3D
|
Implements heuristic optimizations. More...
Implements heuristic optimizations.
Public Member Functions | |
uint | GetHeuristic (int nodeIndex1, int nodeIndex2) |
void | OnDrawGizmos () |
void | RecalculateCosts () |
void | RecalculatePivots () |
Public Attributes | |
bool | dirty |
HeuristicOptimizationMode | mode |
Transform | pivotPointRoot |
All children of this transform will be used as pivot points. | |
int | seed |
int | spreadOutCount = 1 |
Private Member Functions | |
void | EnsureCapacity (int index) |
void | GetClosestWalkableNodesToChildrenRecursively (Transform tr, List< GraphNode > nodes) |
uint | GetRandom () |
Simple linear congruential generator. | |
Private Attributes | |
uint[] | costs = new uint[8] |
Costs laid out as n*[int],n*[int],n*[int] where n is the number of pivot points. | |
System.Object | lockObj = new object() |
int | maxNodeIndex |
int | pivotCount |
GraphNode[] | pivots |
uint | ra = 12820163 |
uint | rc = 1140671485 |
uint | rval = 0 |
|
private |
|
private |
uint GetHeuristic | ( | int | nodeIndex1, |
int | nodeIndex2 | ||
) |
|
private |
Simple linear congruential generator.
void OnDrawGizmos | ( | ) |
void RecalculateCosts | ( | ) |
void RecalculatePivots | ( | ) |
|
private |
Costs laid out as n*[int],n*[int],n*[int] where n is the number of pivot points.
Each node has n integers which is the cost from that node to the pivot node. They are at around the same place in the array for simplicity and for cache locality.
cost(nodeIndex, pivotIndex) = costs[nodeIndex*pivotCount+pivotIndex]
bool dirty |
|
private |
|
private |
|
private |
Transform pivotPointRoot |
All children of this transform will be used as pivot points.
|
private |
|
private |
|
private |
|
private |
int seed |
int spreadOutCount = 1 |