PathFinder icon indicating copy to clipboard operation
PathFinder copied to clipboard

A* disable crossing via diagonal corners

Open playingoDEERUX opened this issue 4 years ago • 1 comments

Is it possible? Title says all.

playingoDEERUX avatar Aug 12 '20 00:08 playingoDEERUX

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.

Sahnvour avatar Aug 12 '20 11:08 Sahnvour