pub trait NavGrid {
// Required methods
fn size(&self) -> UVec2;
fn cost(&self, cell: UVec2) -> Option<f32>;
// Provided method
fn walkable(&self, cell: UVec2) -> bool { ... }
}Expand description
Read-only access to a bounded navigation grid.
Implement this for an existing tilemap, voxel slice or array so searches
borrow its cells instead of copying them. Cell (x, y) exists for
x < size().x and y < size().y.
Required Methods§
Sourcefn cost(&self, cell: UVec2) -> Option<f32>
fn cost(&self, cell: UVec2) -> Option<f32>
Cost of entering cell, or None when it is blocked.
Only called for cells inside size. Searches reject a
cost that is not finite or is below PathOptions::min_cost (or not
positive for distance fields and smoothing) with
PathError::InvalidCost.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".