PathFinding.js
PathFinding.js copied to clipboard
allowDiagonal in some cells
Hello, can i set what cells are diagonable? Is that possible with PathFinding? Or just is true or false for everything?
Might have to be done via the matrix.
Cheers,
Rohan Deshpande - Director
Creativelifeform - Websites / Applications / Brands - www.creativelifeform.com +61450891696 / Twitter http://www.twitter.com/creativlifeform / Facebook http://www.facebook.com/pages/creativelifeform/176704680741 / LinkedIn http://www.linkedin.com/in/creativelifeform Studio 13, 13-29 Nichols St. Surry Hills NSW 2010 Sydney, AUSTRALIA
On Tue, Jun 3, 2014 at 1:01 PM, Josema Enzo [email protected] wrote:
Hello, can i set what cells are diagonable? Is that possible with PathFinding? Or just is true or false for everything?
— Reply to this email directly or view it on GitHub https://github.com/qiao/PathFinding.js/issues/57.
The matrix is to set if is walkable or not. But not to define what cells are diagonables.
Ah right I see. Hmm not sure then. You can maybe work this out through vectors?
Cheers,
Rohan Deshpande - Director
Creativelifeform - Websites / Applications / Brands - www.creativelifeform.com +61450891696 / Twitter http://www.twitter.com/creativlifeform / Facebook http://www.facebook.com/pages/creativelifeform/176704680741 / LinkedIn http://www.linkedin.com/in/creativelifeform Studio 13, 13-29 Nichols St. Surry Hills NSW 2010 Sydney, AUSTRALIA
On Tue, Jun 3, 2014 at 2:00 PM, Josema Enzo [email protected] wrote:
The matrix is to set if is walkable or not. But not to define what cells are diagonables.
— Reply to this email directly or view it on GitHub https://github.com/qiao/PathFinding.js/issues/57#issuecomment-44917724.
@Josenzo Can you share your use case. Why do you want to disable diagonal movement for some of the cells?
Actually i was wrong. Is not disable diagonal movement. Is cross corners in some cells and dont allow it in others. For example. Imagine a map with obtacles and players. In the map you have obstacles like a walls that use all the space of the cell. This obstacle cant be diagonable. However others obstacles as a tree or another player with his character is a obstacle as well. But those obstacles can be diagonables.
If this is not clear i can draw a example.
I understand. This is not currently possible in PathFinding.js. You might want to take a look at https://github.com/qiao/PathFinding.js/issues/17 which is not the same as your issue but somewhat related. The solution would be to replace the allowDiagonal option with a per-diagonal-movement level flag in the grid.