Skip to content

five-on-it / packages/ai/src/pathfinding / gridGraph

Function: gridGraph() ​

gridGraph(grid, costs, extra?): SearchGraph

Defined in: packages/ai/src/pathfinding.ts:348

A grid as a search graph: eight neighbours, a diagonal only when both cells it cuts between are free, the step costing its length times the cell's cost, and extra (if given) a further multiplier per cell, for penalties that come and go.

Parameters ​

grid ​

NavGrid

costs ​

Float32Array

extra? ​

(cell) => number

Returns ​

SearchGraph