class_navigationmesh.rst 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the NavigationMesh.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_NavigationMesh:
  6. NavigationMesh
  7. ==============
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. A mesh to approximate the walkable areas and obstacles.
  10. Description
  11. -----------
  12. 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.
  13. Tutorials
  14. ---------
  15. - `3D Navmesh Demo <https://godotengine.org/asset-library/asset/124>`__
  16. Properties
  17. ----------
  18. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  19. | :ref:`float<class_float>` | :ref:`agent/height<class_NavigationMesh_property_agent/height>` | ``2.0`` |
  20. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  21. | :ref:`float<class_float>` | :ref:`agent/max_climb<class_NavigationMesh_property_agent/max_climb>` | ``0.9`` |
  22. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  23. | :ref:`float<class_float>` | :ref:`agent/max_slope<class_NavigationMesh_property_agent/max_slope>` | ``45.0`` |
  24. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  25. | :ref:`float<class_float>` | :ref:`agent/radius<class_NavigationMesh_property_agent/radius>` | ``0.6`` |
  26. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`float<class_float>` | :ref:`cell/height<class_NavigationMesh_property_cell/height>` | ``0.2`` |
  28. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  29. | :ref:`float<class_float>` | :ref:`cell/size<class_NavigationMesh_property_cell/size>` | ``0.3`` |
  30. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`detail/sample_distance<class_NavigationMesh_property_detail/sample_distance>` | ``6.0`` |
  32. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  33. | :ref:`float<class_float>` | :ref:`detail/sample_max_error<class_NavigationMesh_property_detail/sample_max_error>` | ``1.0`` |
  34. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  35. | :ref:`float<class_float>` | :ref:`edge/max_error<class_NavigationMesh_property_edge/max_error>` | ``1.3`` |
  36. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  37. | :ref:`float<class_float>` | :ref:`edge/max_length<class_NavigationMesh_property_edge/max_length>` | ``12.0`` |
  38. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  39. | :ref:`bool<class_bool>` | :ref:`filter/filter_walkable_low_height_spans<class_NavigationMesh_property_filter/filter_walkable_low_height_spans>` | ``false`` |
  40. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  41. | :ref:`bool<class_bool>` | :ref:`filter/ledge_spans<class_NavigationMesh_property_filter/ledge_spans>` | ``false`` |
  42. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  43. | :ref:`bool<class_bool>` | :ref:`filter/low_hanging_obstacles<class_NavigationMesh_property_filter/low_hanging_obstacles>` | ``false`` |
  44. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  45. | :ref:`int<class_int>` | :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>` | |
  46. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  47. | :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` | :ref:`geometry/parsed_geometry_type<class_NavigationMesh_property_geometry/parsed_geometry_type>` | ``0`` |
  48. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  49. | :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` | :ref:`geometry/source_geometry_mode<class_NavigationMesh_property_geometry/source_geometry_mode>` | ``0`` |
  50. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  51. | :ref:`String<class_String>` | :ref:`geometry/source_group_name<class_NavigationMesh_property_geometry/source_group_name>` | |
  52. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  53. | :ref:`float<class_float>` | :ref:`polygon/verts_per_poly<class_NavigationMesh_property_polygon/verts_per_poly>` | ``6.0`` |
  54. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  55. | :ref:`float<class_float>` | :ref:`region/merge_size<class_NavigationMesh_property_region/merge_size>` | ``20.0`` |
  56. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  57. | :ref:`float<class_float>` | :ref:`region/min_size<class_NavigationMesh_property_region/min_size>` | ``8.0`` |
  58. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  59. | :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` | :ref:`sample_partition_type/sample_partition_type<class_NavigationMesh_property_sample_partition_type/sample_partition_type>` | ``0`` |
  60. +---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  61. Methods
  62. -------
  63. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | void | :ref:`add_polygon<class_NavigationMesh_method_add_polygon>` **(** :ref:`PoolIntArray<class_PoolIntArray>` polygon **)** |
  65. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | void | :ref:`clear_polygons<class_NavigationMesh_method_clear_polygons>` **(** **)** |
  67. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`create_from_mesh<class_NavigationMesh_method_create_from_mesh>` **(** :ref:`Mesh<class_Mesh>` mesh **)** |
  69. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_NavigationMesh_method_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** |const| |
  71. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_polygon<class_NavigationMesh_method_get_polygon>` **(** :ref:`int<class_int>` idx **)** |
  73. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`get_polygon_count<class_NavigationMesh_method_get_polygon_count>` **(** **)** |const| |
  75. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`PoolVector3Array<class_PoolVector3Array>` | :ref:`get_vertices<class_NavigationMesh_method_get_vertices>` **(** **)** |const| |
  77. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`set_collision_mask_bit<class_NavigationMesh_method_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  79. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`set_vertices<class_NavigationMesh_method_set_vertices>` **(** :ref:`PoolVector3Array<class_PoolVector3Array>` vertices **)** |
  81. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. Enumerations
  83. ------------
  84. .. _enum_NavigationMesh_SamplePartitionType:
  85. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_WATERSHED:
  86. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_MONOTONE:
  87. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_LAYERS:
  88. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_MAX:
  89. enum **SamplePartitionType**:
  90. - **SAMPLE_PARTITION_WATERSHED** = **0** --- Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas.
  91. - **SAMPLE_PARTITION_MONOTONE** = **1** --- Monotone partitioning. Use this if you want fast navigation mesh generation.
  92. - **SAMPLE_PARTITION_LAYERS** = **2** --- Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles.
  93. - **SAMPLE_PARTITION_MAX** = **3** --- Represents the size of the :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` enum.
  94. ----
  95. .. _enum_NavigationMesh_ParsedGeometryType:
  96. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_MESH_INSTANCES:
  97. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_STATIC_COLLIDERS:
  98. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_BOTH:
  99. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_MAX:
  100. enum **ParsedGeometryType**:
  101. - **PARSED_GEOMETRY_MESH_INSTANCES** = **0** --- Parses mesh instances as geometry. This includes :ref:`MeshInstance<class_MeshInstance>`, :ref:`CSGShape<class_CSGShape>`, and :ref:`GridMap<class_GridMap>` nodes.
  102. - **PARSED_GEOMETRY_STATIC_COLLIDERS** = **1** --- Parses :ref:`StaticBody<class_StaticBody>` colliders as geometry. The collider should be in any of the layers specified by :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>`.
  103. - **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>`.
  104. - **PARSED_GEOMETRY_MAX** = **3** --- Represents the size of the :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` enum.
  105. ----
  106. .. _enum_NavigationMesh_SourceGeometryMode:
  107. .. _class_NavigationMesh_constant_SOURCE_GEOMETRY_NAVMESH_CHILDREN:
  108. .. _class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN:
  109. .. _class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_EXPLICIT:
  110. .. _class_NavigationMesh_constant_SOURCE_GEOMETRY_MAX:
  111. enum **SourceGeometryMode**:
  112. - **SOURCE_GEOMETRY_NAVMESH_CHILDREN** = **0** --- Scans the child nodes of :ref:`NavigationMeshInstance<class_NavigationMeshInstance>` recursively for geometry.
  113. - **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>`.
  114. - **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>`.
  115. - **SOURCE_GEOMETRY_MAX** = **3** --- Represents the size of the :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` enum.
  116. Property Descriptions
  117. ---------------------
  118. .. _class_NavigationMesh_property_agent/height:
  119. - :ref:`float<class_float>` **agent/height**
  120. +-----------+-------------------------+
  121. | *Default* | ``2.0`` |
  122. +-----------+-------------------------+
  123. | *Setter* | set_agent_height(value) |
  124. +-----------+-------------------------+
  125. | *Getter* | get_agent_height() |
  126. +-----------+-------------------------+
  127. The minimum floor to ceiling height that will still allow the floor area to be considered walkable.
  128. **Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell/height<class_NavigationMesh_property_cell/height>`.
  129. ----
  130. .. _class_NavigationMesh_property_agent/max_climb:
  131. - :ref:`float<class_float>` **agent/max_climb**
  132. +-----------+----------------------------+
  133. | *Default* | ``0.9`` |
  134. +-----------+----------------------------+
  135. | *Setter* | set_agent_max_climb(value) |
  136. +-----------+----------------------------+
  137. | *Getter* | get_agent_max_climb() |
  138. +-----------+----------------------------+
  139. The minimum ledge height that is considered to still be traversable.
  140. **Note:** While baking, this value will be rounded down to the nearest multiple of :ref:`cell/height<class_NavigationMesh_property_cell/height>`.
  141. ----
  142. .. _class_NavigationMesh_property_agent/max_slope:
  143. - :ref:`float<class_float>` **agent/max_slope**
  144. +-----------+----------------------------+
  145. | *Default* | ``45.0`` |
  146. +-----------+----------------------------+
  147. | *Setter* | set_agent_max_slope(value) |
  148. +-----------+----------------------------+
  149. | *Getter* | get_agent_max_slope() |
  150. +-----------+----------------------------+
  151. The maximum slope that is considered walkable, in degrees.
  152. ----
  153. .. _class_NavigationMesh_property_agent/radius:
  154. - :ref:`float<class_float>` **agent/radius**
  155. +-----------+-------------------------+
  156. | *Default* | ``0.6`` |
  157. +-----------+-------------------------+
  158. | *Setter* | set_agent_radius(value) |
  159. +-----------+-------------------------+
  160. | *Getter* | get_agent_radius() |
  161. +-----------+-------------------------+
  162. The distance to erode/shrink the walkable area of the heightfield away from obstructions.
  163. **Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell/size<class_NavigationMesh_property_cell/size>`.
  164. ----
  165. .. _class_NavigationMesh_property_cell/height:
  166. - :ref:`float<class_float>` **cell/height**
  167. +-----------+------------------------+
  168. | *Default* | ``0.2`` |
  169. +-----------+------------------------+
  170. | *Setter* | set_cell_height(value) |
  171. +-----------+------------------------+
  172. | *Getter* | get_cell_height() |
  173. +-----------+------------------------+
  174. The Y axis cell size to use for fields.
  175. ----
  176. .. _class_NavigationMesh_property_cell/size:
  177. - :ref:`float<class_float>` **cell/size**
  178. +-----------+----------------------+
  179. | *Default* | ``0.3`` |
  180. +-----------+----------------------+
  181. | *Setter* | set_cell_size(value) |
  182. +-----------+----------------------+
  183. | *Getter* | get_cell_size() |
  184. +-----------+----------------------+
  185. The XZ plane cell size to use for fields.
  186. ----
  187. .. _class_NavigationMesh_property_detail/sample_distance:
  188. - :ref:`float<class_float>` **detail/sample_distance**
  189. +-----------+-----------------------------------+
  190. | *Default* | ``6.0`` |
  191. +-----------+-----------------------------------+
  192. | *Setter* | set_detail_sample_distance(value) |
  193. +-----------+-----------------------------------+
  194. | *Getter* | get_detail_sample_distance() |
  195. +-----------+-----------------------------------+
  196. The sampling distance to use when generating the detail mesh, in cell unit.
  197. ----
  198. .. _class_NavigationMesh_property_detail/sample_max_error:
  199. - :ref:`float<class_float>` **detail/sample_max_error**
  200. +-----------+------------------------------------+
  201. | *Default* | ``1.0`` |
  202. +-----------+------------------------------------+
  203. | *Setter* | set_detail_sample_max_error(value) |
  204. +-----------+------------------------------------+
  205. | *Getter* | get_detail_sample_max_error() |
  206. +-----------+------------------------------------+
  207. The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
  208. ----
  209. .. _class_NavigationMesh_property_edge/max_error:
  210. - :ref:`float<class_float>` **edge/max_error**
  211. +-----------+---------------------------+
  212. | *Default* | ``1.3`` |
  213. +-----------+---------------------------+
  214. | *Setter* | set_edge_max_error(value) |
  215. +-----------+---------------------------+
  216. | *Getter* | get_edge_max_error() |
  217. +-----------+---------------------------+
  218. The maximum distance a simplfied contour's border edges should deviate the original raw contour.
  219. ----
  220. .. _class_NavigationMesh_property_edge/max_length:
  221. - :ref:`float<class_float>` **edge/max_length**
  222. +-----------+----------------------------+
  223. | *Default* | ``12.0`` |
  224. +-----------+----------------------------+
  225. | *Setter* | set_edge_max_length(value) |
  226. +-----------+----------------------------+
  227. | *Getter* | get_edge_max_length() |
  228. +-----------+----------------------------+
  229. The maximum allowed length for contour edges along the border of the mesh.
  230. **Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell/size<class_NavigationMesh_property_cell/size>`.
  231. ----
  232. .. _class_NavigationMesh_property_filter/filter_walkable_low_height_spans:
  233. - :ref:`bool<class_bool>` **filter/filter_walkable_low_height_spans**
  234. +-----------+---------------------------------------------+
  235. | *Default* | ``false`` |
  236. +-----------+---------------------------------------------+
  237. | *Setter* | set_filter_walkable_low_height_spans(value) |
  238. +-----------+---------------------------------------------+
  239. | *Getter* | get_filter_walkable_low_height_spans() |
  240. +-----------+---------------------------------------------+
  241. 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>`.
  242. ----
  243. .. _class_NavigationMesh_property_filter/ledge_spans:
  244. - :ref:`bool<class_bool>` **filter/ledge_spans**
  245. +-----------+-------------------------------+
  246. | *Default* | ``false`` |
  247. +-----------+-------------------------------+
  248. | *Setter* | set_filter_ledge_spans(value) |
  249. +-----------+-------------------------------+
  250. | *Getter* | get_filter_ledge_spans() |
  251. +-----------+-------------------------------+
  252. If ``true``, marks spans that are ledges as non-walkable.
  253. ----
  254. .. _class_NavigationMesh_property_filter/low_hanging_obstacles:
  255. - :ref:`bool<class_bool>` **filter/low_hanging_obstacles**
  256. +-----------+-----------------------------------------+
  257. | *Default* | ``false`` |
  258. +-----------+-----------------------------------------+
  259. | *Setter* | set_filter_low_hanging_obstacles(value) |
  260. +-----------+-----------------------------------------+
  261. | *Getter* | get_filter_low_hanging_obstacles() |
  262. +-----------+-----------------------------------------+
  263. 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.
  264. ----
  265. .. _class_NavigationMesh_property_geometry/collision_mask:
  266. - :ref:`int<class_int>` **geometry/collision_mask**
  267. +----------+---------------------------+
  268. | *Setter* | set_collision_mask(value) |
  269. +----------+---------------------------+
  270. | *Getter* | get_collision_mask() |
  271. +----------+---------------------------+
  272. The physics layers to scan for static colliders.
  273. 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>`.
  274. ----
  275. .. _class_NavigationMesh_property_geometry/parsed_geometry_type:
  276. - :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` **geometry/parsed_geometry_type**
  277. +-----------+---------------------------------+
  278. | *Default* | ``0`` |
  279. +-----------+---------------------------------+
  280. | *Setter* | set_parsed_geometry_type(value) |
  281. +-----------+---------------------------------+
  282. | *Getter* | get_parsed_geometry_type() |
  283. +-----------+---------------------------------+
  284. Determines which type of nodes will be parsed as geometry. See :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` for possible values.
  285. ----
  286. .. _class_NavigationMesh_property_geometry/source_geometry_mode:
  287. - :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` **geometry/source_geometry_mode**
  288. +-----------+---------------------------------+
  289. | *Default* | ``0`` |
  290. +-----------+---------------------------------+
  291. | *Setter* | set_source_geometry_mode(value) |
  292. +-----------+---------------------------------+
  293. | *Getter* | get_source_geometry_mode() |
  294. +-----------+---------------------------------+
  295. The source of the geometry used when baking. See :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` for possible values.
  296. ----
  297. .. _class_NavigationMesh_property_geometry/source_group_name:
  298. - :ref:`String<class_String>` **geometry/source_group_name**
  299. +----------+------------------------------+
  300. | *Setter* | set_source_group_name(value) |
  301. +----------+------------------------------+
  302. | *Getter* | get_source_group_name() |
  303. +----------+------------------------------+
  304. The name of the group to scan for geometry.
  305. 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>`.
  306. ----
  307. .. _class_NavigationMesh_property_polygon/verts_per_poly:
  308. - :ref:`float<class_float>` **polygon/verts_per_poly**
  309. +-----------+---------------------------+
  310. | *Default* | ``6.0`` |
  311. +-----------+---------------------------+
  312. | *Setter* | set_verts_per_poly(value) |
  313. +-----------+---------------------------+
  314. | *Getter* | get_verts_per_poly() |
  315. +-----------+---------------------------+
  316. The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
  317. ----
  318. .. _class_NavigationMesh_property_region/merge_size:
  319. - :ref:`float<class_float>` **region/merge_size**
  320. +-----------+------------------------------+
  321. | *Default* | ``20.0`` |
  322. +-----------+------------------------------+
  323. | *Setter* | set_region_merge_size(value) |
  324. +-----------+------------------------------+
  325. | *Getter* | get_region_merge_size() |
  326. +-----------+------------------------------+
  327. Any regions with a size smaller than this will be merged with larger regions if possible.
  328. **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.
  329. ----
  330. .. _class_NavigationMesh_property_region/min_size:
  331. - :ref:`float<class_float>` **region/min_size**
  332. +-----------+----------------------------+
  333. | *Default* | ``8.0`` |
  334. +-----------+----------------------------+
  335. | *Setter* | set_region_min_size(value) |
  336. +-----------+----------------------------+
  337. | *Getter* | get_region_min_size() |
  338. +-----------+----------------------------+
  339. The minimum size of a region for it to be created.
  340. **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.
  341. ----
  342. .. _class_NavigationMesh_property_sample_partition_type/sample_partition_type:
  343. - :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` **sample_partition_type/sample_partition_type**
  344. +-----------+----------------------------------+
  345. | *Default* | ``0`` |
  346. +-----------+----------------------------------+
  347. | *Setter* | set_sample_partition_type(value) |
  348. +-----------+----------------------------------+
  349. | *Getter* | get_sample_partition_type() |
  350. +-----------+----------------------------------+
  351. Partitioning algorithm for creating the navigation mesh polys. See :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` for possible values.
  352. Method Descriptions
  353. -------------------
  354. .. _class_NavigationMesh_method_add_polygon:
  355. - void **add_polygon** **(** :ref:`PoolIntArray<class_PoolIntArray>` polygon **)**
  356. Adds a polygon using the indices of the vertices you get when calling :ref:`get_vertices<class_NavigationMesh_method_get_vertices>`.
  357. ----
  358. .. _class_NavigationMesh_method_clear_polygons:
  359. - void **clear_polygons** **(** **)**
  360. Clears the array of polygons, but it doesn't clear the array of vertices.
  361. ----
  362. .. _class_NavigationMesh_method_create_from_mesh:
  363. - void **create_from_mesh** **(** :ref:`Mesh<class_Mesh>` mesh **)**
  364. Initializes the navigation mesh by setting the vertices and indices according to a :ref:`Mesh<class_Mesh>`.
  365. ----
  366. .. _class_NavigationMesh_method_get_collision_mask_bit:
  367. - :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** |const|
  368. Returns whether the specified ``bit`` of the :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>` is set.
  369. ----
  370. .. _class_NavigationMesh_method_get_polygon:
  371. - :ref:`PoolIntArray<class_PoolIntArray>` **get_polygon** **(** :ref:`int<class_int>` idx **)**
  372. Returns a :ref:`PoolIntArray<class_PoolIntArray>` containing the indices of the vertices of a created polygon.
  373. ----
  374. .. _class_NavigationMesh_method_get_polygon_count:
  375. - :ref:`int<class_int>` **get_polygon_count** **(** **)** |const|
  376. Returns the number of polygons in the navigation mesh.
  377. ----
  378. .. _class_NavigationMesh_method_get_vertices:
  379. - :ref:`PoolVector3Array<class_PoolVector3Array>` **get_vertices** **(** **)** |const|
  380. Returns a :ref:`PoolVector3Array<class_PoolVector3Array>` containing all the vertices being used to create the polygons.
  381. ----
  382. .. _class_NavigationMesh_method_set_collision_mask_bit:
  383. - void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  384. If ``value`` is ``true``, sets the specified ``bit`` in the :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>`.
  385. If ``value`` is ``false``, clears the specified ``bit`` in the :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>`.
  386. ----
  387. .. _class_NavigationMesh_method_set_vertices:
  388. - void **set_vertices** **(** :ref:`PoolVector3Array<class_PoolVector3Array>` vertices **)**
  389. Sets the vertices that can be then indexed to create polygons with the :ref:`add_polygon<class_NavigationMesh_method_add_polygon>` method.
  390. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  391. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  392. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`