Skip to content

Allow Diagonal #37

@akubeejays

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

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