API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classPathfinder
Runs path queries against any NavigationSpace. One pathfinder owns the search buffers and reuses them across every query, including queries against different spaces of different sizes, so a search itself allocates nothing once the buffers have reached their size. The result objects are freshly allocated by design: callers hold on to a path, and pooling something a caller retains trades a little garbage for use-after-reuse bugs. A pathfinder holds no world state and no lifecycle - construct one per system that needs paths, or share one, as long as queries do not interleave with a mutation of the space being searched.
import { Pathfinder } from '@codexo/exojs-pathfinding'Runs path queries against any NavigationSpace.
One pathfinder owns the search buffers and reuses them across every query, including queries against different spaces of different sizes, so a search itself allocates nothing once the buffers have reached their size. The result objects are freshly allocated by design: callers hold on to a path, and pooling something a caller retains trades a little garbage for use-after-reuse bugs.
A pathfinder holds no world state and no lifecycle - construct one per system that needs paths, or share one, as long as queries do not interleave with a mutation of the space being searched.
new(): PathfinderfindPath(space: NavigationSpaceThe search core's view of a world: integer node ids, a neighbour relation and a heuristic. GridSpace and WaypointGraph implement it, and so can application cod…<Payload>, start: number, goal: number, options: FindPathOptionsOptions for Pathfinder.findPath and Pathfinder.findPathBetween.): PathResultResult of Pathfinder.findPath and Pathfinder.findPathBetween.<Payload>findPathBetween(space: NavigationSpaceThe search core's view of a world: integer node ids, a neighbour relation and a heuristic. GridSpace and WaypointGraph implement it, and so can application cod…<Payload>, startX: number, startY: number, goalX: number, goalY: number, options: FindPathOptionsOptions for Pathfinder.findPath and Pathfinder.findPathBetween.): PathResultResult of Pathfinder.findPath and Pathfinder.findPathBetween.<Payload>floodFrom(space: NavigationSpaceThe search core's view of a world: integer node ids, a neighbour relation and a heuristic. GridSpace and WaypointGraph implement it, and so can application cod…, origin: number, options: FloodOptionsOptions for Pathfinder.floodFrom.): FloodRegionResult of Pathfinder.floodFrom: every node reached, with its cost.