class_navigationmesh.rst 41 KB

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