pub struct HeightNavigationMesh<CS: CoordinateSystem> {
pub polygons: Vec<HeightPolygon>,
pub vertices: Vec<CS::Coordinate>,
pub triangles: Vec<[u8; 3]>,
}Expand description
An (optional) part of the navigation mesh dedicated to “refining” the height of a point.
NavigationMesh is used for the actual pathfinding. However, in order to
get there we need to know where to start (and end) the search. Or in other
words, we need to know which polygons the search should start and end at.
Navgation meshes may have very coarse/simplified polygons for improving search efficiency. However this can come at the cost of accurately representing the height of the geometry. This means an agent “on the ground” may actually be above or below the nav mesh. This “height mesh” is explicitly for accurately representing the height so that agents on the ground will be recognized as being on the correct node. In other words, we use the height mesh to figure out where the agent is, then use the regular nav mesh to do the actual pathfinding.
Fields§
§polygons: Vec<HeightPolygon>The list of height polygons that correspond to the original polygons.
The length of this Vec must match the number of
NavigationMesh::polygons.
vertices: Vec<CS::Coordinate>The list of vertices that make up the height mesh.
These are a pool of vertices that can be used to create the triangles.
triangles: Vec<[u8; 3]>The list of triangles that make up the height mesh.
The indices that make up the triangle are relative to
HeightPolygon::base_vertex_index. The indices must be oriented
counter-clockwise.
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
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