Function GridGraph.GetNeighbourDirections
GetNeighbourDirections
(NumNeighbours neighbours)
Neighbour direction indices to use depending on how many neighbours each node should have.
Public
Static
int[] GetNeighbourDirections (
neighbours |
Neighbour direction indices to use depending on how many neighbours each node should have.
The following illustration shows the direction indices for all 8 neighbours, Z
|
|
6 2 5
\ | /
-- 3 - X - 1 ----- X
/ | \
7 0 4
|
|
For other neighbour counts, a subset of these will be returned.
These can then be used to index into the neighbourOffsets, neighbourCosts, neighbourXOffsets, and neighbourZOffsets arrays.