class_navigationmesh.rst 34 KB

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