A mesh that defines the areas traversable by navigation agents that are safe from obstructions.
A NavigationMesh is used in pathfinding to describe the traversable area that is safe from collision and other obstructions, assuming an agent's center position at zero radius. The mesh data can be created and baked to polygons with the [NavigationMeshGenerator] by parsing source geometry from the [SceneTree]. The mesh data can also be created without baking by adding the required arrays of vertices and polygon indices with a script. When making procedual changes, a call to [method commit_changes] is required to apply these changes and to synchronize them with the [NavigationServer].
https://godotengine.org/asset-library/asset/124
Adds a polygon using the indices of the vertices you get when calling [method get_vertices].
Clears both the internal polygons and vertices arrays.
Clears the array of polygons, but it doesn't clear the array of vertices.
Applies all changes to vertices and polygons and synchronizes with the NavigationServer.
Initializes the navigation mesh by setting the vertices and indices according to a [Mesh].
Returns whether the specified [code]bit[/code] of the [member geometry_collision_mask] is set.
Returns a [PoolIntArray] containing the indices of the vertices of a created polygon.
Returns the number of polygons in the navigation mesh.
Returns a [PoolVector3Array] containing all the vertices being used to create the polygons.
If [code]value[/code] is [code]true[/code], sets the specified [code]bit[/code] in the [member geometry_collision_mask]. If [code]value[/code] is [code]false[/code], clears the specified [code]bit[/code] in the [member geometry_collision_mask].
Sets the vertices that need to be indexed with the [method add_polygon] or [method set_polygons] methods. When finished changing the navigation mesh call [method commit_changes] in order to synchronize the changes with the [NavigationServer].
- The minimum floor to ceiling height that will still allow the floor area to be considered walkable. [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_height].
- The minimum ledge height that is considered to still be traversable. [b]Note:[/b] While baking, this value will be rounded down to the nearest multiple of [member cell_height].
- The maximum slope that is considered walkable, in degrees.
- The distance to erode/shrink the walkable area of the heightfield away from obstructions. [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size].
- The Y axis cell size to use for fields.
- The XZ plane cell size to use for fields.
- The sampling distance to use when generating the detail mesh, in cell unit.
- The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
- The maximum distance a simplfied contour's border edges should deviate the original raw contour.
- The maximum allowed length for contour edges along the border of the mesh. [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size].
- If the baking [AABB] has a volume the navigation mesh baking will be restricted to its enclosing area.
- The position offset applied to the [member filter_baking_aabb] [AABB].
- The physics layers to scan for static colliders. Only used when [member geometry_parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH].
- Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values.
- The source of the geometry used when baking. See [enum SourceGeometryMode] for possible values.
- The name of the group to scan for geometry. Only used when [member geometry_source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT].
- The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
- Any regions with a size smaller than this will be merged with larger regions if possible. [b]Note:[/b] This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400.
- The minimum size of a region for it to be created. [b]Note:[/b] This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64.
Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas.
Monotone partitioning. Use this if you want fast navigation mesh generation.
Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles.
Represents the size of the [enum SamplePartitionType] enum.
Parses mesh instances as geometry. This includes [MeshInstance], [CSGShape], and [GridMap] nodes.
Parses [StaticBody] colliders as geometry. The collider should be in any of the layers specified by [member geometry_collision_mask].
Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS].
Represents the size of the [enum ParsedGeometryType] enum.
Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member geometry_source_group_name].
Uses nodes in a group for geometry. The group is specified by [member geometry_source_group_name].
Represents the size of the [enum SourceGeometryMode] enum.