pub struct NavMesh { /* private fields */ }Expand description
Safe bindings to dtNavMesh Handles life time of the dtNavMesh and will release resources when dropped
Implementations§
Sourcepub fn get_tile_and_poly_by_ref(
&self,
poly_ref: PolyRef,
) -> DivertResult<(MeshTile, Polygon)>
pub fn get_tile_and_poly_by_ref( &self, poly_ref: PolyRef, ) -> DivertResult<(MeshTile, Polygon)>
Gets the tile and polygon for the specified polygon reference.
Sourcepub fn calc_tile_location(&self, position: &Vector) -> (i32, i32)
pub fn calc_tile_location(&self, position: &Vector) -> (i32, i32)
Calculates the tile grid location for the specified world position.
Sourcepub fn get_poly_ref_base(&self, tile: &dtMeshTile) -> Option<dtPolyRef>
pub fn get_poly_ref_base(&self, tile: &dtMeshTile) -> Option<dtPolyRef>
Gets the polygon reference for the tile’s base polygon.
Sourcepub fn get_tile_at(
&self,
tile_x: i32,
tile_y: i32,
layer: i32,
) -> Option<&dtMeshTile>
pub fn get_tile_at( &self, tile_x: i32, tile_y: i32, layer: i32, ) -> Option<&dtMeshTile>
Gets the tile at the specified grid location.
Sourcepub fn new(nav_mesh_params: &NavMeshParams) -> DivertResult<Self>
pub fn new(nav_mesh_params: &NavMeshParams) -> DivertResult<Self>
Allocates and initializes a dtNavMesh for NavMesh to handle Errors if allocation returns a null pointer, or the dtNavMesh->init function returns a failed status
Sourcepub fn add_tile(&mut self, input_data: Vec<u8>) -> DivertResult<TileRef>
pub fn add_tile(&mut self, input_data: Vec<u8>) -> DivertResult<TileRef>
Accepts a byte vector representing a dtTile, adding it to the inner dtNavMesh The byte vector is forgotten after being added to the dtNavMesh Forgetting the memory is critical, because the memory is now owned by the dtNavMesh
Sourcepub fn create_query<'b>(&self, max_nodes: i32) -> DivertResult<NavMeshQuery<'b>>
pub fn create_query<'b>(&self, max_nodes: i32) -> DivertResult<NavMeshQuery<'b>>
Allocates and initializes a dtNavMeshQuery for NavMeshQuery to handle Errors if allocation returns a null pointer, or the dtNavMeshQuery->init function returns a failed status