class_navigationmesh.rst 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/NavigationMesh.xml.
  6. .. _class_NavigationMesh:
  7. NavigationMesh
  8. ==============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A mesh to approximate the walkable areas and obstacles.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - `3D Navmesh Demo <https://godotengine.org/asset-library/asset/124>`__
  19. - :doc:`Using NavigationMeshes <../tutorials/navigation/navigation_using_navigationmeshes>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  26. | :ref:`float<class_float>` | :ref:`agent_height<class_NavigationMesh_property_agent_height>` | ``1.5`` |
  27. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`agent_max_climb<class_NavigationMesh_property_agent_max_climb>` | ``0.25`` |
  29. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`agent_max_slope<class_NavigationMesh_property_agent_max_slope>` | ``45.0`` |
  31. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`agent_radius<class_NavigationMesh_property_agent_radius>` | ``0.5`` |
  33. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`cell_height<class_NavigationMesh_property_cell_height>` | ``0.25`` |
  35. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`cell_size<class_NavigationMesh_property_cell_size>` | ``0.25`` |
  37. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`detail_sample_distance<class_NavigationMesh_property_detail_sample_distance>` | ``6.0`` |
  39. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  40. | :ref:`float<class_float>` | :ref:`detail_sample_max_error<class_NavigationMesh_property_detail_sample_max_error>` | ``1.0`` |
  41. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  42. | :ref:`float<class_float>` | :ref:`edge_max_error<class_NavigationMesh_property_edge_max_error>` | ``1.3`` |
  43. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  44. | :ref:`float<class_float>` | :ref:`edge_max_length<class_NavigationMesh_property_edge_max_length>` | ``12.0`` |
  45. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  46. | :ref:`AABB<class_AABB>` | :ref:`filter_baking_aabb<class_NavigationMesh_property_filter_baking_aabb>` | ``AABB(0, 0, 0, 0, 0, 0)`` |
  47. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  48. | :ref:`Vector3<class_Vector3>` | :ref:`filter_baking_aabb_offset<class_NavigationMesh_property_filter_baking_aabb_offset>` | ``Vector3(0, 0, 0)`` |
  49. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`filter_ledge_spans<class_NavigationMesh_property_filter_ledge_spans>` | ``false`` |
  51. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`filter_low_hanging_obstacles<class_NavigationMesh_property_filter_low_hanging_obstacles>` | ``false`` |
  53. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`filter_walkable_low_height_spans<class_NavigationMesh_property_filter_walkable_low_height_spans>` | ``false`` |
  55. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`geometry_collision_mask<class_NavigationMesh_property_geometry_collision_mask>` | ``4294967295`` |
  57. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  58. | :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` | :ref:`geometry_parsed_geometry_type<class_NavigationMesh_property_geometry_parsed_geometry_type>` | ``0`` |
  59. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  60. | :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` | :ref:`geometry_source_geometry_mode<class_NavigationMesh_property_geometry_source_geometry_mode>` | ``0`` |
  61. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  62. | :ref:`StringName<class_StringName>` | :ref:`geometry_source_group_name<class_NavigationMesh_property_geometry_source_group_name>` | ``&"navigation_mesh_source_group"`` |
  63. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  64. | :ref:`float<class_float>` | :ref:`region_merge_size<class_NavigationMesh_property_region_merge_size>` | ``20.0`` |
  65. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  66. | :ref:`float<class_float>` | :ref:`region_min_size<class_NavigationMesh_property_region_min_size>` | ``2.0`` |
  67. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  68. | :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` | :ref:`sample_partition_type<class_NavigationMesh_property_sample_partition_type>` | ``0`` |
  69. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  70. | :ref:`float<class_float>` | :ref:`vertices_per_polygon<class_NavigationMesh_property_vertices_per_polygon>` | ``6.0`` |
  71. +---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------------------------------+
  72. .. rst-class:: classref-reftable-group
  73. Methods
  74. -------
  75. .. table::
  76. :widths: auto
  77. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`add_polygon<class_NavigationMesh_method_add_polygon>` **(** :ref:`PackedInt32Array<class_PackedInt32Array>` polygon **)** |
  79. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`clear_polygons<class_NavigationMesh_method_clear_polygons>` **(** **)** |
  81. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`create_from_mesh<class_NavigationMesh_method_create_from_mesh>` **(** :ref:`Mesh<class_Mesh>` mesh **)** |
  83. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_value<class_NavigationMesh_method_get_collision_mask_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  85. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_polygon<class_NavigationMesh_method_get_polygon>` **(** :ref:`int<class_int>` idx **)** |
  87. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`int<class_int>` | :ref:`get_polygon_count<class_NavigationMesh_method_get_polygon_count>` **(** **)** |const| |
  89. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`PackedVector3Array<class_PackedVector3Array>` | :ref:`get_vertices<class_NavigationMesh_method_get_vertices>` **(** **)** |const| |
  91. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`set_collision_mask_value<class_NavigationMesh_method_set_collision_mask_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  93. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | void | :ref:`set_vertices<class_NavigationMesh_method_set_vertices>` **(** :ref:`PackedVector3Array<class_PackedVector3Array>` vertices **)** |
  95. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. .. rst-class:: classref-section-separator
  97. ----
  98. .. rst-class:: classref-descriptions-group
  99. Enumerations
  100. ------------
  101. .. _enum_NavigationMesh_SamplePartitionType:
  102. .. rst-class:: classref-enumeration
  103. enum **SamplePartitionType**:
  104. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_WATERSHED:
  105. .. rst-class:: classref-enumeration-constant
  106. :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` **SAMPLE_PARTITION_WATERSHED** = ``0``
  107. Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas.
  108. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_MONOTONE:
  109. .. rst-class:: classref-enumeration-constant
  110. :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` **SAMPLE_PARTITION_MONOTONE** = ``1``
  111. Monotone partitioning. Use this if you want fast navigation mesh generation.
  112. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_LAYERS:
  113. .. rst-class:: classref-enumeration-constant
  114. :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` **SAMPLE_PARTITION_LAYERS** = ``2``
  115. Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles.
  116. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_MAX:
  117. .. rst-class:: classref-enumeration-constant
  118. :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` **SAMPLE_PARTITION_MAX** = ``3``
  119. Represents the size of the :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` enum.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _enum_NavigationMesh_ParsedGeometryType:
  123. .. rst-class:: classref-enumeration
  124. enum **ParsedGeometryType**:
  125. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_MESH_INSTANCES:
  126. .. rst-class:: classref-enumeration-constant
  127. :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` **PARSED_GEOMETRY_MESH_INSTANCES** = ``0``
  128. Parses mesh instances as geometry. This includes :ref:`MeshInstance3D<class_MeshInstance3D>`, :ref:`CSGShape3D<class_CSGShape3D>`, and :ref:`GridMap<class_GridMap>` nodes.
  129. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_STATIC_COLLIDERS:
  130. .. rst-class:: classref-enumeration-constant
  131. :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` **PARSED_GEOMETRY_STATIC_COLLIDERS** = ``1``
  132. Parses :ref:`StaticBody3D<class_StaticBody3D>` colliders as geometry. The collider should be in any of the layers specified by :ref:`geometry_collision_mask<class_NavigationMesh_property_geometry_collision_mask>`.
  133. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_BOTH:
  134. .. rst-class:: classref-enumeration-constant
  135. :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` **PARSED_GEOMETRY_BOTH** = ``2``
  136. Both :ref:`PARSED_GEOMETRY_MESH_INSTANCES<class_NavigationMesh_constant_PARSED_GEOMETRY_MESH_INSTANCES>` and :ref:`PARSED_GEOMETRY_STATIC_COLLIDERS<class_NavigationMesh_constant_PARSED_GEOMETRY_STATIC_COLLIDERS>`.
  137. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_MAX:
  138. .. rst-class:: classref-enumeration-constant
  139. :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` **PARSED_GEOMETRY_MAX** = ``3``
  140. Represents the size of the :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` enum.
  141. .. rst-class:: classref-item-separator
  142. ----
  143. .. _enum_NavigationMesh_SourceGeometryMode:
  144. .. rst-class:: classref-enumeration
  145. enum **SourceGeometryMode**:
  146. .. _class_NavigationMesh_constant_SOURCE_GEOMETRY_ROOT_NODE_CHILDREN:
  147. .. rst-class:: classref-enumeration-constant
  148. :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` **SOURCE_GEOMETRY_ROOT_NODE_CHILDREN** = ``0``
  149. Scans the child nodes of the root node recursively for geometry.
  150. .. _class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN:
  151. .. rst-class:: classref-enumeration-constant
  152. :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` **SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN** = ``1``
  153. Scans nodes in a group and their child nodes recursively for geometry. The group is specified by :ref:`geometry_source_group_name<class_NavigationMesh_property_geometry_source_group_name>`.
  154. .. _class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_EXPLICIT:
  155. .. rst-class:: classref-enumeration-constant
  156. :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` **SOURCE_GEOMETRY_GROUPS_EXPLICIT** = ``2``
  157. Uses nodes in a group for geometry. The group is specified by :ref:`geometry_source_group_name<class_NavigationMesh_property_geometry_source_group_name>`.
  158. .. _class_NavigationMesh_constant_SOURCE_GEOMETRY_MAX:
  159. .. rst-class:: classref-enumeration-constant
  160. :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` **SOURCE_GEOMETRY_MAX** = ``3``
  161. Represents the size of the :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` enum.
  162. .. rst-class:: classref-section-separator
  163. ----
  164. .. rst-class:: classref-descriptions-group
  165. Property Descriptions
  166. ---------------------
  167. .. _class_NavigationMesh_property_agent_height:
  168. .. rst-class:: classref-property
  169. :ref:`float<class_float>` **agent_height** = ``1.5``
  170. .. rst-class:: classref-property-setget
  171. - void **set_agent_height** **(** :ref:`float<class_float>` value **)**
  172. - :ref:`float<class_float>` **get_agent_height** **(** **)**
  173. The minimum floor to ceiling height that will still allow the floor area to be considered walkable.
  174. \ **Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell_height<class_NavigationMesh_property_cell_height>`.
  175. .. rst-class:: classref-item-separator
  176. ----
  177. .. _class_NavigationMesh_property_agent_max_climb:
  178. .. rst-class:: classref-property
  179. :ref:`float<class_float>` **agent_max_climb** = ``0.25``
  180. .. rst-class:: classref-property-setget
  181. - void **set_agent_max_climb** **(** :ref:`float<class_float>` value **)**
  182. - :ref:`float<class_float>` **get_agent_max_climb** **(** **)**
  183. The minimum ledge height that is considered to still be traversable.
  184. \ **Note:** While baking, this value will be rounded down to the nearest multiple of :ref:`cell_height<class_NavigationMesh_property_cell_height>`.
  185. .. rst-class:: classref-item-separator
  186. ----
  187. .. _class_NavigationMesh_property_agent_max_slope:
  188. .. rst-class:: classref-property
  189. :ref:`float<class_float>` **agent_max_slope** = ``45.0``
  190. .. rst-class:: classref-property-setget
  191. - void **set_agent_max_slope** **(** :ref:`float<class_float>` value **)**
  192. - :ref:`float<class_float>` **get_agent_max_slope** **(** **)**
  193. The maximum slope that is considered walkable, in degrees.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_NavigationMesh_property_agent_radius:
  197. .. rst-class:: classref-property
  198. :ref:`float<class_float>` **agent_radius** = ``0.5``
  199. .. rst-class:: classref-property-setget
  200. - void **set_agent_radius** **(** :ref:`float<class_float>` value **)**
  201. - :ref:`float<class_float>` **get_agent_radius** **(** **)**
  202. The distance to erode/shrink the walkable area of the heightfield away from obstructions.
  203. \ **Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell_size<class_NavigationMesh_property_cell_size>`.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_NavigationMesh_property_cell_height:
  207. .. rst-class:: classref-property
  208. :ref:`float<class_float>` **cell_height** = ``0.25``
  209. .. rst-class:: classref-property-setget
  210. - void **set_cell_height** **(** :ref:`float<class_float>` value **)**
  211. - :ref:`float<class_float>` **get_cell_height** **(** **)**
  212. The Y axis cell size to use for fields.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_NavigationMesh_property_cell_size:
  216. .. rst-class:: classref-property
  217. :ref:`float<class_float>` **cell_size** = ``0.25``
  218. .. rst-class:: classref-property-setget
  219. - void **set_cell_size** **(** :ref:`float<class_float>` value **)**
  220. - :ref:`float<class_float>` **get_cell_size** **(** **)**
  221. The XZ plane cell size to use for fields.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_NavigationMesh_property_detail_sample_distance:
  225. .. rst-class:: classref-property
  226. :ref:`float<class_float>` **detail_sample_distance** = ``6.0``
  227. .. rst-class:: classref-property-setget
  228. - void **set_detail_sample_distance** **(** :ref:`float<class_float>` value **)**
  229. - :ref:`float<class_float>` **get_detail_sample_distance** **(** **)**
  230. The sampling distance to use when generating the detail mesh, in cell unit.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_NavigationMesh_property_detail_sample_max_error:
  234. .. rst-class:: classref-property
  235. :ref:`float<class_float>` **detail_sample_max_error** = ``1.0``
  236. .. rst-class:: classref-property-setget
  237. - void **set_detail_sample_max_error** **(** :ref:`float<class_float>` value **)**
  238. - :ref:`float<class_float>` **get_detail_sample_max_error** **(** **)**
  239. The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
  240. .. rst-class:: classref-item-separator
  241. ----
  242. .. _class_NavigationMesh_property_edge_max_error:
  243. .. rst-class:: classref-property
  244. :ref:`float<class_float>` **edge_max_error** = ``1.3``
  245. .. rst-class:: classref-property-setget
  246. - void **set_edge_max_error** **(** :ref:`float<class_float>` value **)**
  247. - :ref:`float<class_float>` **get_edge_max_error** **(** **)**
  248. The maximum distance a simplfied contour's border edges should deviate the original raw contour.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_NavigationMesh_property_edge_max_length:
  252. .. rst-class:: classref-property
  253. :ref:`float<class_float>` **edge_max_length** = ``12.0``
  254. .. rst-class:: classref-property-setget
  255. - void **set_edge_max_length** **(** :ref:`float<class_float>` value **)**
  256. - :ref:`float<class_float>` **get_edge_max_length** **(** **)**
  257. The maximum allowed length for contour edges along the border of the mesh.
  258. \ **Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell_size<class_NavigationMesh_property_cell_size>`.
  259. .. rst-class:: classref-item-separator
  260. ----
  261. .. _class_NavigationMesh_property_filter_baking_aabb:
  262. .. rst-class:: classref-property
  263. :ref:`AABB<class_AABB>` **filter_baking_aabb** = ``AABB(0, 0, 0, 0, 0, 0)``
  264. .. rst-class:: classref-property-setget
  265. - void **set_filter_baking_aabb** **(** :ref:`AABB<class_AABB>` value **)**
  266. - :ref:`AABB<class_AABB>` **get_filter_baking_aabb** **(** **)**
  267. If the baking :ref:`AABB<class_AABB>` has a volume the navigation mesh baking will be restricted to its enclosing area.
  268. .. rst-class:: classref-item-separator
  269. ----
  270. .. _class_NavigationMesh_property_filter_baking_aabb_offset:
  271. .. rst-class:: classref-property
  272. :ref:`Vector3<class_Vector3>` **filter_baking_aabb_offset** = ``Vector3(0, 0, 0)``
  273. .. rst-class:: classref-property-setget
  274. - void **set_filter_baking_aabb_offset** **(** :ref:`Vector3<class_Vector3>` value **)**
  275. - :ref:`Vector3<class_Vector3>` **get_filter_baking_aabb_offset** **(** **)**
  276. The position offset applied to the :ref:`filter_baking_aabb<class_NavigationMesh_property_filter_baking_aabb>` :ref:`AABB<class_AABB>`.
  277. .. rst-class:: classref-item-separator
  278. ----
  279. .. _class_NavigationMesh_property_filter_ledge_spans:
  280. .. rst-class:: classref-property
  281. :ref:`bool<class_bool>` **filter_ledge_spans** = ``false``
  282. .. rst-class:: classref-property-setget
  283. - void **set_filter_ledge_spans** **(** :ref:`bool<class_bool>` value **)**
  284. - :ref:`bool<class_bool>` **get_filter_ledge_spans** **(** **)**
  285. If ``true``, marks spans that are ledges as non-walkable.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_NavigationMesh_property_filter_low_hanging_obstacles:
  289. .. rst-class:: classref-property
  290. :ref:`bool<class_bool>` **filter_low_hanging_obstacles** = ``false``
  291. .. rst-class:: classref-property-setget
  292. - void **set_filter_low_hanging_obstacles** **(** :ref:`bool<class_bool>` value **)**
  293. - :ref:`bool<class_bool>` **get_filter_low_hanging_obstacles** **(** **)**
  294. If ``true``, marks non-walkable spans as walkable if their maximum is within :ref:`agent_max_climb<class_NavigationMesh_property_agent_max_climb>` of a walkable neighbor.
  295. .. rst-class:: classref-item-separator
  296. ----
  297. .. _class_NavigationMesh_property_filter_walkable_low_height_spans:
  298. .. rst-class:: classref-property
  299. :ref:`bool<class_bool>` **filter_walkable_low_height_spans** = ``false``
  300. .. rst-class:: classref-property-setget
  301. - void **set_filter_walkable_low_height_spans** **(** :ref:`bool<class_bool>` value **)**
  302. - :ref:`bool<class_bool>` **get_filter_walkable_low_height_spans** **(** **)**
  303. If ``true``, marks walkable spans as not walkable if the clearance above the span is less than :ref:`agent_height<class_NavigationMesh_property_agent_height>`.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_NavigationMesh_property_geometry_collision_mask:
  307. .. rst-class:: classref-property
  308. :ref:`int<class_int>` **geometry_collision_mask** = ``4294967295``
  309. .. rst-class:: classref-property-setget
  310. - void **set_collision_mask** **(** :ref:`int<class_int>` value **)**
  311. - :ref:`int<class_int>` **get_collision_mask** **(** **)**
  312. The physics layers to scan for static colliders.
  313. Only used when :ref:`geometry_parsed_geometry_type<class_NavigationMesh_property_geometry_parsed_geometry_type>` is :ref:`PARSED_GEOMETRY_STATIC_COLLIDERS<class_NavigationMesh_constant_PARSED_GEOMETRY_STATIC_COLLIDERS>` or :ref:`PARSED_GEOMETRY_BOTH<class_NavigationMesh_constant_PARSED_GEOMETRY_BOTH>`.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_NavigationMesh_property_geometry_parsed_geometry_type:
  317. .. rst-class:: classref-property
  318. :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` **geometry_parsed_geometry_type** = ``0``
  319. .. rst-class:: classref-property-setget
  320. - void **set_parsed_geometry_type** **(** :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` value **)**
  321. - :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` **get_parsed_geometry_type** **(** **)**
  322. Determines which type of nodes will be parsed as geometry. See :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` for possible values.
  323. .. rst-class:: classref-item-separator
  324. ----
  325. .. _class_NavigationMesh_property_geometry_source_geometry_mode:
  326. .. rst-class:: classref-property
  327. :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` **geometry_source_geometry_mode** = ``0``
  328. .. rst-class:: classref-property-setget
  329. - void **set_source_geometry_mode** **(** :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` value **)**
  330. - :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` **get_source_geometry_mode** **(** **)**
  331. The source of the geometry used when baking. See :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` for possible values.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_NavigationMesh_property_geometry_source_group_name:
  335. .. rst-class:: classref-property
  336. :ref:`StringName<class_StringName>` **geometry_source_group_name** = ``&"navigation_mesh_source_group"``
  337. .. rst-class:: classref-property-setget
  338. - void **set_source_group_name** **(** :ref:`StringName<class_StringName>` value **)**
  339. - :ref:`StringName<class_StringName>` **get_source_group_name** **(** **)**
  340. The name of the group to scan for geometry.
  341. Only used when :ref:`geometry_source_geometry_mode<class_NavigationMesh_property_geometry_source_geometry_mode>` is :ref:`SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN<class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN>` or :ref:`SOURCE_GEOMETRY_GROUPS_EXPLICIT<class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_EXPLICIT>`.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_NavigationMesh_property_region_merge_size:
  345. .. rst-class:: classref-property
  346. :ref:`float<class_float>` **region_merge_size** = ``20.0``
  347. .. rst-class:: classref-property-setget
  348. - void **set_region_merge_size** **(** :ref:`float<class_float>` value **)**
  349. - :ref:`float<class_float>` **get_region_merge_size** **(** **)**
  350. Any regions with a size smaller than this will be merged with larger regions if possible.
  351. \ **Note:** 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.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_NavigationMesh_property_region_min_size:
  355. .. rst-class:: classref-property
  356. :ref:`float<class_float>` **region_min_size** = ``2.0``
  357. .. rst-class:: classref-property-setget
  358. - void **set_region_min_size** **(** :ref:`float<class_float>` value **)**
  359. - :ref:`float<class_float>` **get_region_min_size** **(** **)**
  360. The minimum size of a region for it to be created.
  361. \ **Note:** 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.
  362. .. rst-class:: classref-item-separator
  363. ----
  364. .. _class_NavigationMesh_property_sample_partition_type:
  365. .. rst-class:: classref-property
  366. :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` **sample_partition_type** = ``0``
  367. .. rst-class:: classref-property-setget
  368. - void **set_sample_partition_type** **(** :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` value **)**
  369. - :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` **get_sample_partition_type** **(** **)**
  370. Partitioning algorithm for creating the navigation mesh polys. See :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` for possible values.
  371. .. rst-class:: classref-item-separator
  372. ----
  373. .. _class_NavigationMesh_property_vertices_per_polygon:
  374. .. rst-class:: classref-property
  375. :ref:`float<class_float>` **vertices_per_polygon** = ``6.0``
  376. .. rst-class:: classref-property-setget
  377. - void **set_vertices_per_polygon** **(** :ref:`float<class_float>` value **)**
  378. - :ref:`float<class_float>` **get_vertices_per_polygon** **(** **)**
  379. The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
  380. .. rst-class:: classref-section-separator
  381. ----
  382. .. rst-class:: classref-descriptions-group
  383. Method Descriptions
  384. -------------------
  385. .. _class_NavigationMesh_method_add_polygon:
  386. .. rst-class:: classref-method
  387. void **add_polygon** **(** :ref:`PackedInt32Array<class_PackedInt32Array>` polygon **)**
  388. Adds a polygon using the indices of the vertices you get when calling :ref:`get_vertices<class_NavigationMesh_method_get_vertices>`.
  389. .. rst-class:: classref-item-separator
  390. ----
  391. .. _class_NavigationMesh_method_clear_polygons:
  392. .. rst-class:: classref-method
  393. void **clear_polygons** **(** **)**
  394. Clears the array of polygons, but it doesn't clear the array of vertices.
  395. .. rst-class:: classref-item-separator
  396. ----
  397. .. _class_NavigationMesh_method_create_from_mesh:
  398. .. rst-class:: classref-method
  399. void **create_from_mesh** **(** :ref:`Mesh<class_Mesh>` mesh **)**
  400. Initializes the navigation mesh by setting the vertices and indices according to a :ref:`Mesh<class_Mesh>`.
  401. \ **Note:** The given ``mesh`` must be of type :ref:`Mesh.PRIMITIVE_TRIANGLES<class_Mesh_constant_PRIMITIVE_TRIANGLES>` and have an index array.
  402. .. rst-class:: classref-item-separator
  403. ----
  404. .. _class_NavigationMesh_method_get_collision_mask_value:
  405. .. rst-class:: classref-method
  406. :ref:`bool<class_bool>` **get_collision_mask_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  407. Returns whether or not the specified layer of the :ref:`geometry_collision_mask<class_NavigationMesh_property_geometry_collision_mask>` is enabled, given a ``layer_number`` between 1 and 32.
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_NavigationMesh_method_get_polygon:
  411. .. rst-class:: classref-method
  412. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_polygon** **(** :ref:`int<class_int>` idx **)**
  413. Returns a :ref:`PackedInt32Array<class_PackedInt32Array>` containing the indices of the vertices of a created polygon.
  414. .. rst-class:: classref-item-separator
  415. ----
  416. .. _class_NavigationMesh_method_get_polygon_count:
  417. .. rst-class:: classref-method
  418. :ref:`int<class_int>` **get_polygon_count** **(** **)** |const|
  419. Returns the number of polygons in the navigation mesh.
  420. .. rst-class:: classref-item-separator
  421. ----
  422. .. _class_NavigationMesh_method_get_vertices:
  423. .. rst-class:: classref-method
  424. :ref:`PackedVector3Array<class_PackedVector3Array>` **get_vertices** **(** **)** |const|
  425. Returns a :ref:`PackedVector3Array<class_PackedVector3Array>` containing all the vertices being used to create the polygons.
  426. .. rst-class:: classref-item-separator
  427. ----
  428. .. _class_NavigationMesh_method_set_collision_mask_value:
  429. .. rst-class:: classref-method
  430. void **set_collision_mask_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  431. Based on ``value``, enables or disables the specified layer in the :ref:`geometry_collision_mask<class_NavigationMesh_property_geometry_collision_mask>`, given a ``layer_number`` between 1 and 32.
  432. .. rst-class:: classref-item-separator
  433. ----
  434. .. _class_NavigationMesh_method_set_vertices:
  435. .. rst-class:: classref-method
  436. void **set_vertices** **(** :ref:`PackedVector3Array<class_PackedVector3Array>` vertices **)**
  437. Sets the vertices that can be then indexed to create polygons with the :ref:`add_polygon<class_NavigationMesh_method_add_polygon>` method.
  438. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  439. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  440. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  441. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  442. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  443. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`