-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Diagonal #37
Comments
https://github.com/qiao/PathFinding.js/blob/master/src/core/Grid.js#L170
For the current implementation, if |
Is there any code changes you can recommend for me to change to allow this until it is made into the final release? Regards, On 12 Jul 2013, at 13:42, Xueqiao Xu [email protected] wrote:
|
Yes, you can modify the code starting from this line: https://github.com/qiao/PathFinding.js/blob/master/src/core/Grid.js#L170 delete the |
Perfect J From: Xueqiao Xu [mailto:[email protected]] Yes, you can modify the code starting from this line: https://github.com/qiao/PathFinding.js/blob/master/src/core/Grid.js#L170 delete the if-else block and assign d0, d1, d2 and d3 to be all true and that's done. — |
I use PathFinding.js with this modification too. |
Will be fixed once #63 is done. |
Hi @horaguchi #63 is mostly done apart from polishing the docs. But the code is not yet released in a new version (I don't have the access to release to npmjs yet :( ) so you'll have to use the code from the repo. Read the user guide for more information. |
@imor Sorry for the late reply: I tried it and it works correctly :). Thank you very much. |
I tried to allow diagonal but it does not find a solution when "dontcrosscorners" is set to false. is any one else facing the same issue and can anyone help me with a solution ?
var matrix = [
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 0, 1, 0, 1, 1],
[1, 1, 1, 0, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
];
var grid = new PF.Grid(7, 5, matrix);
var finder = new PF.AStarFinder({
allowDiagonal: true,
dontCrossCorners: false
});
var path = finder.findPath(2, 2, 4, 2, grid);
The text was updated successfully, but these errors were encountered: