five-on-it / packages/ai/src/pathfinding / layeredGraph
Function: layeredGraph()
layeredGraph(
layers,costs,extra?):SearchGraph
Defined in: packages/ai/src/pathfinding.ts:308
A layered navigation as a search graph over its nodes (the ground and the floors over it): every node linked to a node (forEachLink of @foi/world: up the stairs onto a floor, never off its edge), a diagonal only past both cells it cuts between, the step costing its length times the node's cost, and extra (if given) a further multiplier per node, for penalties that come and go.
Parameters
layers
costs
Float32Array
extra?
(node) => number