PathFinder
PathFinder copied to clipboard
A* disable crossing via diagonal corners
Is it possible? Title says all.
Yes, see for example https://github.com/Sahnvour/PathFinder/blob/master/examples/image.cpp#L138 . In these loops, for each pixel we look at its (up to) 9 neighbours and add them as children, ie. accessible nodes. If you don't want to allow moving in diagonal, just add the up/down and left/right neighbours.