2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-12-17 19:12:00 +00:00
<class name= "NavigationMesh" inherits= "Resource" is_experimental= "true" version= "4.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2021-08-11 08:23:14 +00:00
A mesh to approximate the walkable areas and obstacles.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2021-08-11 08:23:14 +00:00
A navigation mesh is a collection of polygons that define which areas of an environment are traversable to aid agents in pathfinding through complicated spaces.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
2020-10-01 08:34:47 +00:00
<link title= "3D Navmesh Demo" > https://godotengine.org/asset-library/asset/124</link>
2023-01-11 05:05:04 +00:00
<link title= "Using NavigationMeshes" > $DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html</link>
2017-09-12 20:42:36 +00:00
</tutorials>
<methods >
<method name= "add_polygon" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "polygon" type= "PackedInt32Array" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-11 08:23:14 +00:00
Adds a polygon using the indices of the vertices you get when calling [method get_vertices].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "clear_polygons" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-11 08:23:14 +00:00
Clears the array of polygons, but it doesn't clear the array of vertices.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "create_from_mesh" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "mesh" type= "Mesh" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-11 08:23:14 +00:00
Initializes the navigation mesh by setting the vertices and indices according to a [Mesh].
2022-08-12 13:36:48 +00:00
[b]Note:[/b] The given [param mesh] must be of type [constant Mesh.PRIMITIVE_TRIANGLES] and have an index array.
2017-09-12 20:42:36 +00:00
</description>
</method>
2021-08-11 23:01:38 +00:00
<method name= "get_collision_mask_value" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "layer_number" type= "int" />
2019-05-28 16:08:13 +00:00
<description >
2022-08-12 13:36:48 +00:00
Returns whether or not the specified layer of the [member geometry_collision_mask] is enabled, given a [param layer_number] between 1 and 32.
2019-05-28 16:08:13 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_polygon" >
2021-07-30 13:28:05 +00:00
<return type= "PackedInt32Array" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-11 08:23:14 +00:00
Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_polygon_count" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2021-08-11 08:23:14 +00:00
Returns the number of polygons in the navigation mesh.
2017-09-12 20:42:36 +00:00
</description>
</method>
2017-12-07 07:29:38 +00:00
<method name= "get_vertices" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "PackedVector3Array" />
2017-12-07 07:29:38 +00:00
<description >
2021-08-11 08:23:14 +00:00
Returns a [PackedVector3Array] containing all the vertices being used to create the polygons.
2017-12-07 07:29:38 +00:00
</description>
</method>
2021-08-11 23:01:38 +00:00
<method name= "set_collision_mask_value" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "layer_number" type= "int" />
<param index= "1" name= "value" type= "bool" />
2019-05-28 16:08:13 +00:00
<description >
2022-08-12 13:36:48 +00:00
Based on [param value], enables or disables the specified layer in the [member geometry_collision_mask], given a [param layer_number] between 1 and 32.
2019-05-28 16:08:13 +00:00
</description>
</method>
2017-12-07 07:29:38 +00:00
<method name= "set_vertices" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "vertices" type= "PackedVector3Array" />
2017-12-07 07:29:38 +00:00
<description >
2021-08-11 08:23:14 +00:00
Sets the vertices that can be then indexed to create polygons with the [method add_polygon] method.
2017-12-07 07:29:38 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
</methods>
<members >
2022-06-08 14:31:51 +00:00
<member name= "agent_height" type= "float" setter= "set_agent_height" getter= "get_agent_height" default= "1.5" >
2021-08-11 08:23:14 +00:00
The minimum floor to ceiling height that will still allow the floor area to be considered walkable.
2022-06-08 14:31:51 +00:00
[b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_height].
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "agent_max_climb" type= "float" setter= "set_agent_max_climb" getter= "get_agent_max_climb" default= "0.25" >
2021-08-11 08:23:14 +00:00
The minimum ledge height that is considered to still be traversable.
2022-06-08 14:31:51 +00:00
[b]Note:[/b] While baking, this value will be rounded down to the nearest multiple of [member cell_height].
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "agent_max_slope" type= "float" setter= "set_agent_max_slope" getter= "get_agent_max_slope" default= "45.0" >
2021-08-11 08:23:14 +00:00
The maximum slope that is considered walkable, in degrees.
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "agent_radius" type= "float" setter= "set_agent_radius" getter= "get_agent_radius" default= "0.5" >
2021-08-11 08:23:14 +00:00
The distance to erode/shrink the walkable area of the heightfield away from obstructions.
2022-06-08 14:31:51 +00:00
[b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size].
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "cell_height" type= "float" setter= "set_cell_height" getter= "get_cell_height" default= "0.25" >
2021-08-11 08:23:14 +00:00
The Y axis cell size to use for fields.
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "cell_size" type= "float" setter= "set_cell_size" getter= "get_cell_size" default= "0.25" >
2021-08-11 08:23:14 +00:00
The XZ plane cell size to use for fields.
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "detail_sample_distance" type= "float" setter= "set_detail_sample_distance" getter= "get_detail_sample_distance" default= "6.0" >
2021-08-11 08:23:14 +00:00
The sampling distance to use when generating the detail mesh, in cell unit.
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "detail_sample_max_error" type= "float" setter= "set_detail_sample_max_error" getter= "get_detail_sample_max_error" default= "1.0" >
2021-08-11 08:23:14 +00:00
The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "edge_max_error" type= "float" setter= "set_edge_max_error" getter= "get_edge_max_error" default= "1.3" >
2021-08-11 08:23:14 +00:00
The maximum distance a simplfied contour's border edges should deviate the original raw contour.
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "edge_max_length" type= "float" setter= "set_edge_max_length" getter= "get_edge_max_length" default= "12.0" >
2021-08-11 08:23:14 +00:00
The maximum allowed length for contour edges along the border of the mesh.
2022-06-08 14:31:51 +00:00
[b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size].
2017-09-13 18:56:01 +00:00
</member>
2022-06-23 11:54:41 +00:00
<member name= "filter_baking_aabb" type= "AABB" setter= "set_filter_baking_aabb" getter= "get_filter_baking_aabb" default= "AABB(0, 0, 0, 0, 0, 0)" >
If the baking [AABB] has a volume the navigation mesh baking will be restricted to its enclosing area.
</member>
<member name= "filter_baking_aabb_offset" type= "Vector3" setter= "set_filter_baking_aabb_offset" getter= "get_filter_baking_aabb_offset" default= "Vector3(0, 0, 0)" >
The position offset applied to the [member filter_baking_aabb] [AABB].
</member>
2022-06-08 14:31:51 +00:00
<member name= "filter_ledge_spans" type= "bool" setter= "set_filter_ledge_spans" getter= "get_filter_ledge_spans" default= "false" >
2021-08-11 08:23:14 +00:00
If [code]true[/code], marks spans that are ledges as non-walkable.
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "filter_low_hanging_obstacles" type= "bool" setter= "set_filter_low_hanging_obstacles" getter= "get_filter_low_hanging_obstacles" default= "false" >
If [code]true[/code], marks non-walkable spans as walkable if their maximum is within [member agent_max_climb] of a walkable neighbor.
</member>
<member name= "filter_walkable_low_height_spans" type= "bool" setter= "set_filter_walkable_low_height_spans" getter= "get_filter_walkable_low_height_spans" default= "false" >
If [code]true[/code], marks walkable spans as not walkable if the clearance above the span is less than [member agent_height].
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "geometry_collision_mask" type= "int" setter= "set_collision_mask" getter= "get_collision_mask" default= "4294967295" >
2021-08-11 08:23:14 +00:00
The physics layers to scan for static colliders.
2022-06-08 14:31:51 +00:00
Only used when [member geometry_parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH].
2019-05-28 16:08:13 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "geometry_parsed_geometry_type" type= "int" setter= "set_parsed_geometry_type" getter= "get_parsed_geometry_type" enum= "NavigationMesh.ParsedGeometryType" default= "0" >
2021-08-11 08:23:14 +00:00
Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values.
2019-05-28 16:08:13 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "geometry_source_geometry_mode" type= "int" setter= "set_source_geometry_mode" getter= "get_source_geometry_mode" enum= "NavigationMesh.SourceGeometryMode" default= "0" >
2021-08-11 08:23:14 +00:00
The source of the geometry used when baking. See [enum SourceGeometryMode] for possible values.
2019-10-16 09:33:47 +00:00
</member>
2022-12-11 17:02:35 +00:00
<member name= "geometry_source_group_name" type= "StringName" setter= "set_source_group_name" getter= "get_source_group_name" default= "&"navigation_mesh_source_group"" >
2021-08-11 08:23:14 +00:00
The name of the group to scan for geometry.
2022-06-08 14:31:51 +00:00
Only used when [member geometry_source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT].
2019-10-16 09:33:47 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "region_merge_size" type= "float" setter= "set_region_merge_size" getter= "get_region_merge_size" default= "20.0" >
2021-08-11 08:23:14 +00:00
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.
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "region_min_size" type= "float" setter= "set_region_min_size" getter= "get_region_min_size" default= "2.0" >
2020-09-09 14:21:18 +00:00
The minimum size of a region for it to be created.
2021-08-11 08:23:14 +00:00
[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.
2017-09-13 18:56:01 +00:00
</member>
2022-06-08 14:31:51 +00:00
<member name= "sample_partition_type" type= "int" setter= "set_sample_partition_type" getter= "get_sample_partition_type" enum= "NavigationMesh.SamplePartitionType" default= "0" >
2021-08-11 08:23:14 +00:00
Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] for possible values.
2017-09-13 18:56:01 +00:00
</member>
2022-12-18 04:07:10 +00:00
<member name= "vertices_per_polygon" type= "float" setter= "set_vertices_per_polygon" getter= "get_vertices_per_polygon" default= "6.0" >
The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
</member>
2017-09-12 20:42:36 +00:00
</members>
<constants >
2021-08-11 08:23:14 +00:00
<constant name= "SAMPLE_PARTITION_WATERSHED" value= "0" enum= "SamplePartitionType" >
Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas.
2017-09-13 18:56:01 +00:00
</constant>
2021-08-11 08:23:14 +00:00
<constant name= "SAMPLE_PARTITION_MONOTONE" value= "1" enum= "SamplePartitionType" >
Monotone partitioning. Use this if you want fast navigation mesh generation.
2017-09-13 18:56:01 +00:00
</constant>
2021-08-11 08:23:14 +00:00
<constant name= "SAMPLE_PARTITION_LAYERS" value= "2" enum= "SamplePartitionType" >
Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles.
2017-09-13 18:56:01 +00:00
</constant>
2021-08-11 08:23:14 +00:00
<constant name= "SAMPLE_PARTITION_MAX" value= "3" enum= "SamplePartitionType" >
Represents the size of the [enum SamplePartitionType] enum.
2019-05-28 16:08:13 +00:00
</constant>
2021-08-11 08:23:14 +00:00
<constant name= "PARSED_GEOMETRY_MESH_INSTANCES" value= "0" enum= "ParsedGeometryType" >
Parses mesh instances as geometry. This includes [MeshInstance3D], [CSGShape3D], and [GridMap] nodes.
2019-05-28 16:08:13 +00:00
</constant>
2021-08-11 08:23:14 +00:00
<constant name= "PARSED_GEOMETRY_STATIC_COLLIDERS" value= "1" enum= "ParsedGeometryType" >
2022-06-08 14:31:51 +00:00
Parses [StaticBody3D] colliders as geometry. The collider should be in any of the layers specified by [member geometry_collision_mask].
2021-08-11 08:23:14 +00:00
</constant>
<constant name= "PARSED_GEOMETRY_BOTH" value= "2" enum= "ParsedGeometryType" >
Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS].
</constant>
<constant name= "PARSED_GEOMETRY_MAX" value= "3" enum= "ParsedGeometryType" >
Represents the size of the [enum ParsedGeometryType] enum.
</constant>
2022-12-11 17:02:35 +00:00
<constant name= "SOURCE_GEOMETRY_ROOT_NODE_CHILDREN" value= "0" enum= "SourceGeometryMode" >
Scans the child nodes of the root node recursively for geometry.
2021-08-11 08:23:14 +00:00
</constant>
<constant name= "SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN" value= "1" enum= "SourceGeometryMode" >
2022-06-08 14:31:51 +00:00
Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member geometry_source_group_name].
2021-08-11 08:23:14 +00:00
</constant>
<constant name= "SOURCE_GEOMETRY_GROUPS_EXPLICIT" value= "2" enum= "SourceGeometryMode" >
2022-06-08 14:31:51 +00:00
Uses nodes in a group for geometry. The group is specified by [member geometry_source_group_name].
2021-08-11 08:23:14 +00:00
</constant>
<constant name= "SOURCE_GEOMETRY_MAX" value= "3" enum= "SourceGeometryMode" >
Represents the size of the [enum SourceGeometryMode] enum.
2019-05-28 16:08:13 +00:00
</constant>
2017-09-12 20:42:36 +00:00
</constants>
</class>