Debian Codegraph @

doc/classes/NavigationMesh.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="NavigationMesh" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A navigation mesh that defines traversable areas and obstacles.
5 </brief_description>
6 <description>
7 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.
8 </description>
9 <tutorials>
10 <link title="Using NavigationMeshes">$DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html</link>
11 <link title="3D Navigation Demo">https://godotengine.org/asset-library/asset/2743</link>
12 </tutorials>
13 <methods>
14 <method name="add_polygon">
15 <return type="void" />
16 <param index="0" name="polygon" type="PackedInt32Array" />
17 <description>
18 Adds a polygon using the indices of the vertices you get when calling [method get_vertices].
19 </description>
20 </method>
21 <method name="clear">
22 <return type="void" />
23 <description>
24 Clears the internal arrays for vertices and polygon indices.
25 </description>
26 </method>
27 <method name="clear_polygons">
28 <return type="void" />
29 <description>
30 Clears the array of polygons, but it doesn't clear the array of vertices.
31 </description>
32 </method>
33 <method name="create_from_mesh">
34 <return type="void" />
35 <param index="0" name="mesh" type="Mesh" />
36 <description>
37 Initializes the navigation mesh by setting the vertices and indices according to a [Mesh].
38 [b]Note:[/b] The given [param mesh] must be of type [constant Mesh.PRIMITIVE_TRIANGLES] and have an index array.
39 </description>
40 </method>
41 <method name="get_collision_mask_value" qualifiers="const">
42 <return type="bool" />
43 <param index="0" name="layer_number" type="int" />
44 <description>
45 Returns whether or not the specified layer of the [member geometry_collision_mask] is enabled, given a [param layer_number] between 1 and 32.
46 </description>
47 </method>
48 <method name="get_polygon">
49 <return type="PackedInt32Array" />
50 <param index="0" name="idx" type="int" />
51 <description>
52 Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon.
53 </description>
54 </method>
55 <method name="get_polygon_count" qualifiers="const">
56 <return type="int" />
57 <description>
58 Returns the number of polygons in the navigation mesh.
59 </description>
60 </method>
61 <method name="get_vertices" qualifiers="const">
62 <return type="PackedVector3Array" />
63 <description>
64 Returns a [PackedVector3Array] containing all the vertices being used to create the polygons.
65 </description>
66 </method>
67 <method name="set_collision_mask_value">
68 <return type="void" />
69 <param index="0" name="layer_number" type="int" />
70 <param index="1" name="value" type="bool" />
71 <description>
72 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.
73 </description>
74 </method>
75 <method name="set_vertices">
76 <return type="void" />
77 <param index="0" name="vertices" type="PackedVector3Array" />
78 <description>
79 Sets the vertices that can be then indexed to create polygons with the [method add_polygon] method.
80 </description>
81 </method>
82 </methods>
83 <members>
84 <member name="agent_height" type="float" setter="set_agent_height" getter="get_agent_height" default="1.5">
85 The minimum floor to ceiling height that will still allow the floor area to be considered walkable.
86 [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_height].
87 </member>
88 <member name="agent_max_climb" type="float" setter="set_agent_max_climb" getter="get_agent_max_climb" default="0.25">
89 The minimum ledge height that is considered to still be traversable.
90 [b]Note:[/b] While baking, this value will be rounded down to the nearest multiple of [member cell_height].
91 </member>
92 <member name="agent_max_slope" type="float" setter="set_agent_max_slope" getter="get_agent_max_slope" default="45.0">
93 The maximum slope that is considered walkable, in degrees.
94 </member>
95 <member name="agent_radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="0.5">
96 The distance to erode/shrink the walkable area of the heightfield away from obstructions.
97 [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size].
98 [b]Note:[/b] The radius must be equal or higher than [code]0.0[/code]. If the radius is [code]0.0[/code], it won't be possible to fix invalid outline overlaps and other precision errors during the baking process. As a result, some obstacles may be excluded incorrectly from the final navigation mesh, or may delete the navigation mesh's polygons.
99 </member>
100 <member name="border_size" type="float" setter="set_border_size" getter="get_border_size" default="0.0">
101 The size of the non-navigable border around the bake bounding area.
102 In conjunction with the [member filter_baking_aabb] and a [member edge_max_error] value at [code]1.0[/code] or below the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by [member agent_radius].
103 [b]Note:[/b] If this value is not [code]0.0[/code], it will be rounded up to the nearest multiple of [member cell_size] during baking.
104 </member>
105 <member name="cell_height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.25">
106 The cell height used to rasterize the navigation mesh vertices on the Y axis. Must match with the cell height on the navigation map.
107 </member>
108 <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.25">
109 The cell size used to rasterize the navigation mesh vertices on the XZ plane. Must match with the cell size on the navigation map.
110 </member>
111 <member name="detail_sample_distance" type="float" setter="set_detail_sample_distance" getter="get_detail_sample_distance" default="6.0">
112 The sampling distance to use when generating the detail mesh, in cell unit.
113 </member>
114 <member name="detail_sample_max_error" type="float" setter="set_detail_sample_max_error" getter="get_detail_sample_max_error" default="1.0">
115 The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
116 </member>
117 <member name="edge_max_error" type="float" setter="set_edge_max_error" getter="get_edge_max_error" default="1.3">
118 The maximum distance a simplified contour's border edges should deviate the original raw contour.
119 </member>
120 <member name="edge_max_length" type="float" setter="set_edge_max_length" getter="get_edge_max_length" default="0.0">
121 The maximum allowed length for contour edges along the border of the mesh. A value of [code]0.0[/code] disables this feature.
122 [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size].
123 </member>
124 <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)">
125 If the baking [AABB] has a volume the navigation mesh baking will be restricted to its enclosing area.
126 </member>
127 <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)">
128 The position offset applied to the [member filter_baking_aabb] [AABB].
129 </member>
130 <member name="filter_ledge_spans" type="bool" setter="set_filter_ledge_spans" getter="get_filter_ledge_spans" default="false">
131 If [code]true[/code], marks spans that are ledges as non-walkable.
132 </member>
133 <member name="filter_low_hanging_obstacles" type="bool" setter="set_filter_low_hanging_obstacles" getter="get_filter_low_hanging_obstacles" default="false">
134 If [code]true[/code], marks non-walkable spans as walkable if their maximum is within [member agent_max_climb] of a walkable neighbor.
135 </member>
136 <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">
137 If [code]true[/code], marks walkable spans as not walkable if the clearance above the span is less than [member agent_height].
138 </member>
139 <member name="geometry_collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="4294967295">
140 The physics layers to scan for static colliders.
141 Only used when [member geometry_parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH].
142 </member>
143 <member name="geometry_parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" enum="NavigationMesh.ParsedGeometryType" default="2">
144 Determines which type of nodes will be parsed as geometry.
145 </member>
146 <member name="geometry_source_geometry_mode" type="int" setter="set_source_geometry_mode" getter="get_source_geometry_mode" enum="NavigationMesh.SourceGeometryMode" default="0">
147 The source of the geometry used when baking.
148 </member>
149 <member name="geometry_source_group_name" type="StringName" setter="set_source_group_name" getter="get_source_group_name" default="&amp;&quot;navigation_mesh_source_group&quot;">
150 The name of the group to scan for geometry.
151 Only used when [member geometry_source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT].
152 </member>
153 <member name="region_merge_size" type="float" setter="set_region_merge_size" getter="get_region_merge_size" default="20.0">
154 Any regions with a size smaller than this will be merged with larger regions if possible.
155 [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.
156 </member>
157 <member name="region_min_size" type="float" setter="set_region_min_size" getter="get_region_min_size" default="2.0">
158 The minimum size of a region for it to be created.
159 [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.
160 </member>
161 <member name="sample_partition_type" type="int" setter="set_sample_partition_type" getter="get_sample_partition_type" enum="NavigationMesh.SamplePartitionType" default="0">
162 Partitioning algorithm for creating the navigation mesh polys.
163 </member>
164 <member name="vertices_per_polygon" type="float" setter="set_vertices_per_polygon" getter="get_vertices_per_polygon" default="6.0">
165 The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
166 </member>
167 </members>
168 <constants>
169 <constant name="SAMPLE_PARTITION_WATERSHED" value="0" enum="SamplePartitionType">
170 Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas.
171 </constant>
172 <constant name="SAMPLE_PARTITION_MONOTONE" value="1" enum="SamplePartitionType">
173 Monotone partitioning. Use this if you want fast navigation mesh generation.
174 </constant>
175 <constant name="SAMPLE_PARTITION_LAYERS" value="2" enum="SamplePartitionType">
176 Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles.
177 </constant>
178 <constant name="SAMPLE_PARTITION_MAX" value="3" enum="SamplePartitionType">
179 Represents the size of the [enum SamplePartitionType] enum.
180 </constant>
181 <constant name="PARSED_GEOMETRY_MESH_INSTANCES" value="0" enum="ParsedGeometryType">
182 Parses mesh instances as geometry. This includes [MeshInstance3D], [CSGShape3D], and [GridMap] nodes.
183 </constant>
184 <constant name="PARSED_GEOMETRY_STATIC_COLLIDERS" value="1" enum="ParsedGeometryType">
185 Parses [StaticBody3D] colliders as geometry. The collider should be in any of the layers specified by [member geometry_collision_mask].
186 </constant>
187 <constant name="PARSED_GEOMETRY_BOTH" value="2" enum="ParsedGeometryType">
188 Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS].
189 </constant>
190 <constant name="PARSED_GEOMETRY_MAX" value="3" enum="ParsedGeometryType">
191 Represents the size of the [enum ParsedGeometryType] enum.
192 </constant>
193 <constant name="SOURCE_GEOMETRY_ROOT_NODE_CHILDREN" value="0" enum="SourceGeometryMode">
194 Scans the child nodes of the root node recursively for geometry.
195 </constant>
196 <constant name="SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN" value="1" enum="SourceGeometryMode">
197 Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member geometry_source_group_name].
198 </constant>
199 <constant name="SOURCE_GEOMETRY_GROUPS_EXPLICIT" value="2" enum="SourceGeometryMode">
200 Uses nodes in a group for geometry. The group is specified by [member geometry_source_group_name].
201 </constant>
202 <constant name="SOURCE_GEOMETRY_MAX" value="3" enum="SourceGeometryMode">
203 Represents the size of the [enum SourceGeometryMode] enum.
204 </constant>
205 </constants>
206 </class>