grid_pathfinding
grid_pathfinding copied to clipboard
Can't restrict diagonals
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.
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.