PathfinderHeap

PathfinderHeap

Pathfinder that uses a binary heap to prioritize different node weights

Constructor

new PathfinderHeap(grid, diagonal)

Source:
Parameters:
Name Type Description
grid Grid

input grid, each cell has to be a number weight where 0 = wall or pass the getWeight function in the options

diagonal Boolean

also allow moving diagonal

Methods

calc(start, end) → {Array}

Source:

Calculate a path from start to end

Parameters:
Name Type Description
start Vector | Object

start point

end Vector | Object

end point

Returns:

Array of points in the form {x:0, y:0}

Type
Array