Skip to content

Allow Diagonal #37

Description

@akubeejays

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions