pub struct NavPoly {
pub id: NavPolyId,
pub verts: Vec<Vec2>,
pub centroid: Vec2,
pub area: AreaFlags,
pub cost: f32,
pub portals: Vec<usize>,
}Expand description
A convex polygon on the navigation mesh.
Fields§
§id: NavPolyId§verts: Vec<Vec2>§centroid: Vec2§area: AreaFlags§cost: f32§portals: Vec<usize>Implementations§
pub fn new(id: NavPolyId, verts: Vec<Vec2>, area: AreaFlags, cost: f32) -> Self
Sourcepub fn contains_point(&self, p: Vec2) -> bool
pub fn contains_point(&self, p: Vec2) -> bool
Test whether a 2-D point lies inside this convex polygon (CCW winding).
Sourcepub fn closest_point(&self, p: Vec2) -> Vec2
pub fn closest_point(&self, p: Vec2) -> Vec2
Closest point on the polygon boundary (or inside) to p.
Sourcepub fn signed_area(&self) -> f32
pub fn signed_area(&self) -> f32
Signed area (positive = CCW).
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