Expand description
A* pathfinding, Dijkstra maps, Jump Point Search, and hierarchical pathfinding.
§Example
use proof_engine::ai::pathfinding::{PathGrid, AStarPathfinder};
use glam::Vec2;
let mut grid = PathGrid::new(20, 20, 1.0);
grid.set_walkable(5, 5, false); // obstacle
let finder = AStarPathfinder::new();
if let Some(path) = finder.find_path(&grid, Vec2::new(0.0, 0.0), Vec2::new(10.0, 10.0)) {
println!("Found path with {} waypoints", path.len());
}Structs§
- AStar
Pathfinder - Full A* pathfinder operating on a
PathGrid. - Dijkstra
Map - A distance field computed simultaneously from multiple source cells. Useful for “all enemies chase the player” scenarios — compute once, use many.
- Hierarchical
Pathfinder - Two-level hierarchical pathfinder. Performs a coarse A* over chunks, then refines within each chunk.
- Hierarchy
Chunk - A chunk in the hierarchical pathfinder.
- Jump
Point Search - Jump Point Search — optimized A* for uniform-cost grids. Significantly reduces nodes expanded on open terrain.
- Path
- A resolved path as a sequence of world positions.
- Path
Grid - A uniform grid used for all grid-based pathfinding algorithms.
- Path
Node - A single node used internally during A* search.
- Path
Request - A pathfinding request.
- Pathfinding
Stats - Statistics collected during a pathfinding run.
Enums§
- Heuristic
- Available heuristic functions for A*.
- Path
Result - The result of a pathfinding operation.
Functions§
- smooth_
path - Remove redundant waypoints using line-of-sight checks (string-pulling).
- spline_
path - Catmull-Rom spline interpolation for smooth curved paths.