GridGraphOptions
Defined in: GridGraph.ts:6
Properties
Section titled “Properties”cols:
number
Defined in: GridGraph.ts:7
optionalcost?: (col,row) =>number
Defined in: GridGraph.ts:23
Per-cell multiplier on the step entering that cell. Default () => 1.
Must return >= 1 for optimal paths — the heuristic assumes a minimum
cell cost of 1, so sub-1 costs make it overestimate (a path is still
returned, just not guaranteed shortest).
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”number
diagonalMovement?
Section titled “diagonalMovement?”
optionaldiagonalMovement?:DiagonalMovement
Defined in: GridGraph.ts:25
Default "no-corner-cutting".
heuristic?
Section titled “heuristic?”
optionalheuristic?:HeuristicName
Defined in: GridGraph.ts:27
Default: "octile" when diagonals are allowed, else "manhattan".
isWalkable
Section titled “isWalkable”isWalkable: (
col,row) =>boolean
Defined in: GridGraph.ts:16
Called on every findPath, never cached — a predicate whose result
changes between calls (a door opening) changes the next path with no
rebuild.
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”boolean
origin?
Section titled “origin?”
optionalorigin?:Vec2Like
Defined in: GridGraph.ts:29
World-pixel position of cell (0,0)’s top-left corner. Default (0,0).
rows:
number
Defined in: GridGraph.ts:8
tileHeight
Section titled “tileHeight”tileHeight:
number
Defined in: GridGraph.ts:10
tileWidth
Section titled “tileWidth”tileWidth:
number
Defined in: GridGraph.ts:9