pub struct NavMesh2D { /* private fields */ }Expand description
Convex polygon 2D navigation mesh with portal graph A* and Simple Stupid Funnel smoothing.
Implementations§
Sourcepub fn from_polygons(polygons: Vec<NavPolygon2D>) -> Self
pub fn from_polygons(polygons: Vec<NavPolygon2D>) -> Self
Sourcepub fn find_polygon(&self, point: Vec2) -> Option<usize>
pub fn find_polygon(&self, point: Vec2) -> Option<usize>
Sourcepub fn find_path_into(
&mut self,
start: Vec2,
goal: Vec2,
out_path: &mut Vec<Vec2>,
) -> bool
pub fn find_path_into( &mut self, start: Vec2, goal: Vec2, out_path: &mut Vec<Vec2>, ) -> bool
Finds a taut string-pulled waypoint path writing directly into reusable buffer out_path.
§Arguments
Vec2- Start world position on the navmesh.Vec2- Goal world position on the navmesh.&mut Vec<Vec2>- Reusable output waypoint buffer.
§Returns
bool-trueif a connected corridor exists andout_pathwas populated.
pub fn get_polygons(&self) -> &Vec<NavPolygon2D>
pub fn get_mut_polygons(&mut self) -> &mut Vec<NavPolygon2D>
pub fn set_polygons(&mut self, val: Vec<NavPolygon2D>) -> &mut Self
pub fn get_adjacency(&self) -> &Vec<Vec<NavPortal2D>>
pub fn get_mut_adjacency(&mut self) -> &mut Vec<Vec<NavPortal2D>>
pub fn set_adjacency(&mut self, val: Vec<Vec<NavPortal2D>>) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more