pub struct NavmeshCell { /* private fields */ }Expand description
One convex walkable polygon in a navmesh, keyed by a stable cell_id.
Cell ids are the durable identity used by dynamic availability updates; portal
endpoints must lie on the cell boundary. Construction does not validate—call
Self::validate (or Navmesh::validate) before search.
Implementations§
Sourcepub fn new(cell_id: impl Into<String>, vertices: Vec<Point2>) -> NavmeshCell
pub fn new(cell_id: impl Into<String>, vertices: Vec<Point2>) -> NavmeshCell
Creates an unvalidated cell; geometry and id contracts are checked by Self::validate.
Sourcepub fn vertices(&self) -> &[Point2]
pub fn vertices(&self) -> &[Point2]
Convex polygon ring in world coordinates (CCW or CW; validation checks area).
Sourcepub fn validate(&self) -> Result<(), NavmeshValidationError>
pub fn validate(&self) -> Result<(), NavmeshValidationError>
Checks non-empty id, at least three vertices, non-zero area, and convexity.
§Errors
Returns NavmeshValidationError when the cell id or polygon geometry
violates the navmesh contract.
Sourcepub fn contains_point_inclusive(&self, point: Point2) -> bool
pub fn contains_point_inclusive(&self, point: Point2) -> bool
Inclusive membership: interior points and boundary edges (including vertices) count.
Sourcepub fn has_boundary_segment(&self, start: Point2, end: Point2) -> bool
pub fn has_boundary_segment(&self, start: Point2, end: Point2) -> bool
Whether both endpoints of a portal segment lie on a single cell boundary edge.
Trait Implementations§
Source§fn clone(&self) -> NavmeshCell
fn clone(&self) -> NavmeshCell
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more