spatial-monorepo / wayfinding/src / findGridPath
Function: findGridPath()
findGridPath(
grid,start,end,opts?):GridPathResult
Defined in: packages/wayfinding/src/jump-point-search.ts:57
Runs Jump Point Search (the pathfinding npm package — same dependency the Haltian Empathic Building reference uses) over an OccupancyGrid between two grid cells.
Disambiguates "already at destination" from a genuine no-path result: the underlying library's findPath returns an empty array for BOTH start === end AND for no path existing (confirmed directly from its source — expandPath on a single-node backtrace returns []), which is a known sharp edge in the HEB reference this engine is modelled on (Wayfinding v2 plan §2.2, final paragraph). This wrapper short-circuits the trivial case before calling into the library, so found: false here always means "no path exists".
