public class GridFinderOptions extends PathFinderOptions
NavigationGridGraph.| Modifier and Type | Field and Description |
|---|---|
boolean |
allowDiagonal
Wether diagonal movement is allowed within the grid.
|
float |
diagonalMovementCost
The cost of moving one cell over both the x and y axis
|
boolean |
dontCrossCorners
When true, diagonal movement requires both neighbors to be open.
|
boolean |
isYDown
When false, (0,0) is located at the bottom left of the grid.
|
float |
orthogonalMovementCost
The cost of moving one cell over the x or y axis
|
heuristic| Constructor and Description |
|---|
GridFinderOptions()
Constructs a new GridFinderOptions with the default values:
|
GridFinderOptions(boolean allowDiagonals,
boolean dontCrossCorners,
Heuristic heuristic,
boolean isyDown,
float orthogonalMovementCost,
float diagonalMovementCost) |
public boolean allowDiagonal
Note: This will be ignored in JumpPointFinder, as diagonal movement is required for it
Default value is true
public boolean dontCrossCorners
Example: To go from (1,1) to (2,2) when this is set to true, where (x) denotes a non walkable cell, the following applies
Valid Invalid
+---+---+---+ +---+---+---+
| | | 0 | | | x | 0 |
+---+---+---+ +---+---+---+
when True | | 0 | | | | 0 | |
+---+---+---+ +---+---+---+
| | | | | | | |
+---+---+---+ +---+---+---+
+---+---+---+
| | x | 0 |
+---+---+---+
when false | | 0 | | none
+---+---+---+
| | | |
+---+---+---+
If allowDiagonal is false, this setting is ignored.
Default value is true
public boolean isYDown
Default value is false
public float orthogonalMovementCost
public float diagonalMovementCost
public GridFinderOptions()
allowDiagonal= truedontCrossCorners= truePathFinderOptions.heuristic=ManhattanDistanceisYDown= falseorthogonalMovementCost= 1diagonalMovementCost= 1.4
public GridFinderOptions(boolean allowDiagonals,
boolean dontCrossCorners,
Heuristic heuristic,
boolean isyDown,
float orthogonalMovementCost,
float diagonalMovementCost)