Skip to main content

PolygonShortestPathMap

Trait PolygonShortestPathMap 

Source
pub trait PolygonShortestPathMap {
    // Required methods
    fn name(&self) -> &'static str;
    fn source(&self) -> Point2;
    fn query(&self, goal: Point2) -> PolygonSearchResult;
}
Expand description

Prepared map that answers shortest-path queries from a fixed source.

Built once via PolygonShortestPathMapBuilder; subsequent query calls must use goals in the same scene geometry the map was prepared from.

Required Methods§

Source

fn name(&self) -> &'static str

Stable algorithm / builder identity for reports and portfolios.

Source

fn source(&self) -> Point2

Scene-space source the map was rooted at during preprocess.

Source

fn query(&self, goal: Point2) -> PolygonSearchResult

Shortest free-space path from Self::source to goal.

Invalid goals (non-traversable free space, including sealed boundary) return PolygonSearchError::InvalidGoal. Reachable goals return a Euclidean polyline; unreachable valid goals return no-path (NoPath outcome), not a validation error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§