You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,19 @@ var finder = new PF.AStarFinder({
126
126
});
127
127
```
128
128
129
+
When diagonal movement is enabled, you might want to prevent the path from touching the corners of the occupied grid blocks. This is usually desirable if the objects using the path have physical width and can also move between the grid cells.
130
+
131
+
To enable the corner crossing prevention:
132
+
133
+
```javascript
134
+
var finder =newPF.AStarFinder({
135
+
allowDiagonal:true,
136
+
dontCrossCorners:true
137
+
});
138
+
```
139
+
140
+
Note that `dontCrossCorners` only makes sense when `allowDiagonal` is also used. Currently all algorithms except `JumpPointFinder` support this feature.
141
+
129
142
For `AStarFinder`, `BestFirstFinder` and all their `Bi` relatives, you may indicate which heuristic function to use.
130
143
131
144
The predefined heuristics are `PF.Heuristic.manhattan`(defalut), `PF.Heuristic.chebyshev` and `PF.Heuristic.euclidean`.
0 commit comments