API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classWaypointGraph
A directed graph of hand-placed waypoints. This is the representation for worlds a grid cannot describe: a platformer where traversal is a topology of walk, jump and fall links rather than cell walkability, or a purely abstract graph with no geometry at all. Nodes carry an optional position, edges carry a cost, a WaypointEdgeOptions.kind and an arbitrary payload, and the resulting path reports the edges it took so the game can execute each step in its own way. With positions the search is A* over straight-line distance; without them the heuristic is zero and the same search degrades cleanly to Dijkstra.
import { WaypointGraph } from '@codexo/exojs-pathfinding'A directed graph of hand-placed waypoints.
This is the representation for worlds a grid cannot describe: a platformer where traversal is a topology of walk, jump and fall links rather than cell walkability, or a purely abstract graph with no geometry at all. Nodes carry an optional position, edges carry a cost, a WaypointEdgeOptions.kind and an arbitrary payload, and the resulting path reports the edges it took so the game can execute each step in its own way.
With positions the search is A* over straight-line distance; without them the heuristic is zero and the same search degrades cleanly to Dijkstra.
new(): WaypointGraph<Payload>addEdge(from: number, to: number, options: WaypointEdgeOptionsOptions for WaypointGraph.addEdge and WaypointGraph.connect.<Payload>): voidaddNode(x?: number, y?: number): numberconnect(a: number, b: number, options: WaypointEdgeOptionsOptions for WaypointGraph.addEdge and WaypointGraph.connect.<Payload>): voiddescribeEdge(from: number, to: number): PathEdgeOne traversal step of a path, as described by the space it came from. Spaces that model traversal kinds - WaypointGraph is the one in this package - report the…<Payload> | nullheuristic(node: number, goal: number): numbernearestNode(x: number, y: number): numberneighbors(node: number, _agentSize: number, outNodes: Int32Array, outCosts: Float64Array): numberpointToNode(x: number, y: number): numberremoveEdge(from: number, to: number): voidremoveNode(node: number): voidmaxDegree: numbernodeCapacity: numbernodeCount: numberrevision: number