grid_pathfinding icon indicating copy to clipboard operation
grid_pathfinding copied to clipboard

Can't restrict diagonals

Open jdm opened this issue 2 years ago • 1 comments

Hello! I appreciate this crate's straightforward interface, but it would be most useful to me if there were some way to restrict the paths so that diagonals movements were never considered. I tried replacing all moore_neighbourhood with neuman_neighbourghood and move_distance with manhattan_distance, but I got stuck on the use of moore_neighbour, so it seems like the diagonal assumption is pretty baked in right now.

jdm avatar Dec 29 '22 01:12 jdm

Hi! Good that you bring this up, this definitely sounds like a good generalization. The assumption of diagonals is indeed pretty much baked into the algorithm as it stands, in particular the JPS implementation. It should be possible to add an allow_diagonals flag or something equivalent however.

tbvanderwoude avatar May 17 '23 12:05 tbvanderwoude