Skip to content

GridGraphOptions

Defined in: GridGraph.ts:6

cols: number

Defined in: GridGraph.ts:7


optional cost?: (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).

number

number

number


optional diagonalMovement?: DiagonalMovement

Defined in: GridGraph.ts:25

Default "no-corner-cutting".


optional heuristic?: HeuristicName

Defined in: GridGraph.ts:27

Default: "octile" when diagonals are allowed, else "manhattan".


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.

number

number

boolean


optional origin?: 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: number

Defined in: GridGraph.ts:10


tileWidth: number

Defined in: GridGraph.ts:9