# Sandbox.Navigation.NavMesh

Navigation Mesh - allowing AI to navigate a world

- Kind: class
- Namespace: `Sandbox.Navigation`
- Assembly: `Sandbox.Engine`
- Modifiers: sealed

## Properties

- [`AgentHeight`](/api/Sandbox.Navigation.NavMesh/AgentHeight): Height of the agent
- [`AgentMaxSlope`](/api/Sandbox.Navigation.NavMesh/AgentMaxSlope): The maximum slope an agent can walk up (in degrees)
- [`AgentRadius`](/api/Sandbox.Navigation.NavMesh/AgentRadius): The radius of the agent. This will change how much gap is left on the edges of surfaces, so they don't clip into walls.
- [`AgentStepSize`](/api/Sandbox.Navigation.NavMesh/AgentStepSize): The maximum height an agent can climb (step)
- [`Bounds`](/api/Sandbox.Navigation.NavMesh/Bounds): The bounds to generate the navmesh within. Won't take effect until regenerated or reloaded.
- [`CustomBounds`](/api/Sandbox.Navigation.NavMesh/CustomBounds): By Default , the navmesh will calculate bounds based on the world geometry, but if you want to override that, you can set custom bounds here.
- [`DeferGeneration`](/api/Sandbox.Navigation.NavMesh/DeferGeneration): Skip tile generation during scene load. Tiles can then be generated on demand via [Sandbox.Navigation.NavMesh.GenerateTile](/api/Sandbox.Navigation.NavMesh/GenerateTile), [Sandbox.Navigation.NavMesh.RequestTileGeneration](/api/Sandbox.Navigation.NavMesh/RequestTileGeneration), etc.
- [`DrawMesh`](/api/Sandbox.Navigation.NavMesh/DrawMesh): Draw the navigation mesh in the editor
- [`EditorAutoUpdate`](/api/Sandbox.Navigation.NavMesh/EditorAutoUpdate): Constantly update the navigation mesh in the editor
- [`ExcludedBodies`](/api/Sandbox.Navigation.NavMesh/ExcludedBodies): Don't include these bodies in the generation
- [`IncludedBodies`](/api/Sandbox.Navigation.NavMesh/IncludedBodies): If any, we'll only include bodies with this tag
- [`IncludeKeyframedBodies`](/api/Sandbox.Navigation.NavMesh/IncludeKeyframedBodies): Should the generator include keyframed bodies
- [`IncludeStaticBodies`](/api/Sandbox.Navigation.NavMesh/IncludeStaticBodies): Should the generator include static bodies
- [`IsDirty`](/api/Sandbox.Navigation.NavMesh/IsDirty): The navigation mesh is dirty and needs a complete rebuild
- [`IsEnabled`](/api/Sandbox.Navigation.NavMesh/IsEnabled): Determines wether the navigation mesh is enabled and should be generated
- [`IsGenerating`](/api/Sandbox.Navigation.NavMesh/IsGenerating): The navigation mesh is generating

## Methods

- [`BakeNavMesh`](/api/Sandbox.Navigation.NavMesh/BakeNavMesh)
- [`CalculatePath`](/api/Sandbox.Navigation.NavMesh/CalculatePath): Computes a navigation path between the specified start and target positions on the navmesh. Uses the same pathfinding algorithm as [Sandbox.NavMeshAgent](/api/Sandbox.NavMeshAgent), taking agent configuration into account if provided. The result is suitable for direct use with [Sandbox.NavMeshAgent.SetPath](/api/Sandbox.NavMeshAgent/SetPath). If a complete path cannot be found, the result may indicate an incomplete or failed path.
- [`CalculatePathAsync`](/api/Sandbox.Navigation.NavMesh/CalculatePathAsync): Captures agent constraints when called and calculates on a worker. Cancellation is checked during path search.
- [`Dispose`](/api/Sandbox.Navigation.NavMesh/Dispose)
- [`Generate`](/api/Sandbox.Navigation.NavMesh/Generate)
- [`GenerateTile`](/api/Sandbox.Navigation.NavMesh/GenerateTile): Generates or regenerates the navmesh tile at the given world position. This function is thread safe but can only be called from the main thread.
- [`GenerateTiles`](/api/Sandbox.Navigation.NavMesh/GenerateTiles): Generates or regenerates the navmesh tiles overlapping with the given bounds. This function is thread safe but can only be called from the main thread.
- [`GetClosestEdge`](/api/Sandbox.Navigation.NavMesh/GetClosestEdge)
- [`GetClosestPoint`](/api/Sandbox.Navigation.NavMesh/GetClosestPoint)
- [`GetRandomPoint`](/api/Sandbox.Navigation.NavMesh/GetRandomPoint)
- [`GetSimplePath`](/api/Sandbox.Navigation.NavMesh/GetSimplePath)
- [`RequestTileGeneration`](/api/Sandbox.Navigation.NavMesh/RequestTileGeneration): Queues the navmesh tile at the given world position for incremental generation over subsequent frames. Fire-and-forget alternative to [Sandbox.Navigation.NavMesh.GenerateTile](/api/Sandbox.Navigation.NavMesh/GenerateTile).
- [`RequestTilesGeneration`](/api/Sandbox.Navigation.NavMesh/RequestTilesGeneration): Queues all navmesh tiles overlapping with the given bounds for incremental generation over subsequent frames. Fire-and-forget alternative to [Sandbox.Navigation.NavMesh.GenerateTiles](/api/Sandbox.Navigation.NavMesh/GenerateTiles).
- [`SetDirty`](/api/Sandbox.Navigation.NavMesh/SetDirty): Set the navgiation a dirty, so it will rebuild over the next few frames. If you need an immediate rebuild, call [Sandbox.Navigation.NavMesh.Generate](/api/Sandbox.Navigation.NavMesh/Generate) instead.
- [`UnloadTile`](/api/Sandbox.Navigation.NavMesh/UnloadTile): Removes the navmesh tile at the given world position.
- [`UnloadTiles`](/api/Sandbox.Navigation.NavMesh/UnloadTiles): Removes all navmesh tiles overlapping with the given bounds.
