class_navigationmesh.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.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. Tutorials
  10. ---------
  11. - `3D Navmesh Demo <https://godotengine.org/asset-library/asset/124>`_
  12. Properties
  13. ----------
  14. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  15. | :ref:`float<class_float>` | :ref:`agent/height<class_NavigationMesh_property_agent/height>` | ``2.0`` |
  16. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  17. | :ref:`float<class_float>` | :ref:`agent/max_climb<class_NavigationMesh_property_agent/max_climb>` | ``0.9`` |
  18. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  19. | :ref:`float<class_float>` | :ref:`agent/max_slope<class_NavigationMesh_property_agent/max_slope>` | ``45.0`` |
  20. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  21. | :ref:`float<class_float>` | :ref:`agent/radius<class_NavigationMesh_property_agent/radius>` | ``0.6`` |
  22. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  23. | :ref:`float<class_float>` | :ref:`cell/height<class_NavigationMesh_property_cell/height>` | ``0.2`` |
  24. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  25. | :ref:`float<class_float>` | :ref:`cell/size<class_NavigationMesh_property_cell/size>` | ``0.3`` |
  26. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`float<class_float>` | :ref:`detail/sample_distance<class_NavigationMesh_property_detail/sample_distance>` | ``6.0`` |
  28. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  29. | :ref:`float<class_float>` | :ref:`detail/sample_max_error<class_NavigationMesh_property_detail/sample_max_error>` | ``1.0`` |
  30. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`edge/max_error<class_NavigationMesh_property_edge/max_error>` | ``1.3`` |
  32. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  33. | :ref:`float<class_float>` | :ref:`edge/max_length<class_NavigationMesh_property_edge/max_length>` | ``12.0`` |
  34. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`filter/filter_walkable_low_height_spans<class_NavigationMesh_property_filter/filter_walkable_low_height_spans>` | ``false`` |
  36. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  37. | :ref:`bool<class_bool>` | :ref:`filter/ledge_spans<class_NavigationMesh_property_filter/ledge_spans>` | ``false`` |
  38. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  39. | :ref:`bool<class_bool>` | :ref:`filter/low_hanging_obstacles<class_NavigationMesh_property_filter/low_hanging_obstacles>` | ``false`` |
  40. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  41. | :ref:`int<class_int>` | :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>` | |
  42. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  43. | :ref:`int<class_int>` | :ref:`geometry/parsed_geometry_type<class_NavigationMesh_property_geometry/parsed_geometry_type>` | ``0`` |
  44. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  45. | :ref:`int<class_int>` | :ref:`geometry/source_geometry_mode<class_NavigationMesh_property_geometry/source_geometry_mode>` | ``0`` |
  46. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  47. | :ref:`String<class_String>` | :ref:`geometry/source_group_name<class_NavigationMesh_property_geometry/source_group_name>` | |
  48. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  49. | :ref:`float<class_float>` | :ref:`polygon/verts_per_poly<class_NavigationMesh_property_polygon/verts_per_poly>` | ``6.0`` |
  50. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  51. | :ref:`float<class_float>` | :ref:`region/merge_size<class_NavigationMesh_property_region/merge_size>` | ``20.0`` |
  52. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  53. | :ref:`float<class_float>` | :ref:`region/min_size<class_NavigationMesh_property_region/min_size>` | ``8.0`` |
  54. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  55. | :ref:`int<class_int>` | :ref:`sample_partition_type/sample_partition_type<class_NavigationMesh_property_sample_partition_type/sample_partition_type>` | ``0`` |
  56. +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
  57. Methods
  58. -------
  59. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`add_polygon<class_NavigationMesh_method_add_polygon>` **(** :ref:`PoolIntArray<class_PoolIntArray>` polygon **)** |
  61. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`clear_polygons<class_NavigationMesh_method_clear_polygons>` **(** **)** |
  63. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | void | :ref:`create_from_mesh<class_NavigationMesh_method_create_from_mesh>` **(** :ref:`Mesh<class_Mesh>` mesh **)** |
  65. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_NavigationMesh_method_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** |const| |
  67. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_polygon<class_NavigationMesh_method_get_polygon>` **(** :ref:`int<class_int>` idx **)** |
  69. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`get_polygon_count<class_NavigationMesh_method_get_polygon_count>` **(** **)** |const| |
  71. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`PoolVector3Array<class_PoolVector3Array>` | :ref:`get_vertices<class_NavigationMesh_method_get_vertices>` **(** **)** |const| |
  73. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`set_collision_mask_bit<class_NavigationMesh_method_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
  75. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`set_vertices<class_NavigationMesh_method_set_vertices>` **(** :ref:`PoolVector3Array<class_PoolVector3Array>` vertices **)** |
  77. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. Constants
  79. ---------
  80. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_WATERSHED:
  81. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_MONOTONE:
  82. .. _class_NavigationMesh_constant_SAMPLE_PARTITION_LAYERS:
  83. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_MESH_INSTANCES:
  84. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_STATIC_COLLIDERS:
  85. .. _class_NavigationMesh_constant_PARSED_GEOMETRY_BOTH:
  86. - **SAMPLE_PARTITION_WATERSHED** = **0**
  87. - **SAMPLE_PARTITION_MONOTONE** = **1**
  88. - **SAMPLE_PARTITION_LAYERS** = **2**
  89. - **PARSED_GEOMETRY_MESH_INSTANCES** = **0**
  90. - **PARSED_GEOMETRY_STATIC_COLLIDERS** = **1**
  91. - **PARSED_GEOMETRY_BOTH** = **2**
  92. Property Descriptions
  93. ---------------------
  94. .. _class_NavigationMesh_property_agent/height:
  95. - :ref:`float<class_float>` **agent/height**
  96. +-----------+-------------------------+
  97. | *Default* | ``2.0`` |
  98. +-----------+-------------------------+
  99. | *Setter* | set_agent_height(value) |
  100. +-----------+-------------------------+
  101. | *Getter* | get_agent_height() |
  102. +-----------+-------------------------+
  103. ----
  104. .. _class_NavigationMesh_property_agent/max_climb:
  105. - :ref:`float<class_float>` **agent/max_climb**
  106. +-----------+----------------------------+
  107. | *Default* | ``0.9`` |
  108. +-----------+----------------------------+
  109. | *Setter* | set_agent_max_climb(value) |
  110. +-----------+----------------------------+
  111. | *Getter* | get_agent_max_climb() |
  112. +-----------+----------------------------+
  113. ----
  114. .. _class_NavigationMesh_property_agent/max_slope:
  115. - :ref:`float<class_float>` **agent/max_slope**
  116. +-----------+----------------------------+
  117. | *Default* | ``45.0`` |
  118. +-----------+----------------------------+
  119. | *Setter* | set_agent_max_slope(value) |
  120. +-----------+----------------------------+
  121. | *Getter* | get_agent_max_slope() |
  122. +-----------+----------------------------+
  123. ----
  124. .. _class_NavigationMesh_property_agent/radius:
  125. - :ref:`float<class_float>` **agent/radius**
  126. +-----------+-------------------------+
  127. | *Default* | ``0.6`` |
  128. +-----------+-------------------------+
  129. | *Setter* | set_agent_radius(value) |
  130. +-----------+-------------------------+
  131. | *Getter* | get_agent_radius() |
  132. +-----------+-------------------------+
  133. ----
  134. .. _class_NavigationMesh_property_cell/height:
  135. - :ref:`float<class_float>` **cell/height**
  136. +-----------+------------------------+
  137. | *Default* | ``0.2`` |
  138. +-----------+------------------------+
  139. | *Setter* | set_cell_height(value) |
  140. +-----------+------------------------+
  141. | *Getter* | get_cell_height() |
  142. +-----------+------------------------+
  143. ----
  144. .. _class_NavigationMesh_property_cell/size:
  145. - :ref:`float<class_float>` **cell/size**
  146. +-----------+----------------------+
  147. | *Default* | ``0.3`` |
  148. +-----------+----------------------+
  149. | *Setter* | set_cell_size(value) |
  150. +-----------+----------------------+
  151. | *Getter* | get_cell_size() |
  152. +-----------+----------------------+
  153. ----
  154. .. _class_NavigationMesh_property_detail/sample_distance:
  155. - :ref:`float<class_float>` **detail/sample_distance**
  156. +-----------+-----------------------------------+
  157. | *Default* | ``6.0`` |
  158. +-----------+-----------------------------------+
  159. | *Setter* | set_detail_sample_distance(value) |
  160. +-----------+-----------------------------------+
  161. | *Getter* | get_detail_sample_distance() |
  162. +-----------+-----------------------------------+
  163. ----
  164. .. _class_NavigationMesh_property_detail/sample_max_error:
  165. - :ref:`float<class_float>` **detail/sample_max_error**
  166. +-----------+------------------------------------+
  167. | *Default* | ``1.0`` |
  168. +-----------+------------------------------------+
  169. | *Setter* | set_detail_sample_max_error(value) |
  170. +-----------+------------------------------------+
  171. | *Getter* | get_detail_sample_max_error() |
  172. +-----------+------------------------------------+
  173. ----
  174. .. _class_NavigationMesh_property_edge/max_error:
  175. - :ref:`float<class_float>` **edge/max_error**
  176. +-----------+---------------------------+
  177. | *Default* | ``1.3`` |
  178. +-----------+---------------------------+
  179. | *Setter* | set_edge_max_error(value) |
  180. +-----------+---------------------------+
  181. | *Getter* | get_edge_max_error() |
  182. +-----------+---------------------------+
  183. ----
  184. .. _class_NavigationMesh_property_edge/max_length:
  185. - :ref:`float<class_float>` **edge/max_length**
  186. +-----------+----------------------------+
  187. | *Default* | ``12.0`` |
  188. +-----------+----------------------------+
  189. | *Setter* | set_edge_max_length(value) |
  190. +-----------+----------------------------+
  191. | *Getter* | get_edge_max_length() |
  192. +-----------+----------------------------+
  193. ----
  194. .. _class_NavigationMesh_property_filter/filter_walkable_low_height_spans:
  195. - :ref:`bool<class_bool>` **filter/filter_walkable_low_height_spans**
  196. +-----------+---------------------------------------------+
  197. | *Default* | ``false`` |
  198. +-----------+---------------------------------------------+
  199. | *Setter* | set_filter_walkable_low_height_spans(value) |
  200. +-----------+---------------------------------------------+
  201. | *Getter* | get_filter_walkable_low_height_spans() |
  202. +-----------+---------------------------------------------+
  203. ----
  204. .. _class_NavigationMesh_property_filter/ledge_spans:
  205. - :ref:`bool<class_bool>` **filter/ledge_spans**
  206. +-----------+-------------------------------+
  207. | *Default* | ``false`` |
  208. +-----------+-------------------------------+
  209. | *Setter* | set_filter_ledge_spans(value) |
  210. +-----------+-------------------------------+
  211. | *Getter* | get_filter_ledge_spans() |
  212. +-----------+-------------------------------+
  213. ----
  214. .. _class_NavigationMesh_property_filter/low_hanging_obstacles:
  215. - :ref:`bool<class_bool>` **filter/low_hanging_obstacles**
  216. +-----------+-----------------------------------------+
  217. | *Default* | ``false`` |
  218. +-----------+-----------------------------------------+
  219. | *Setter* | set_filter_low_hanging_obstacles(value) |
  220. +-----------+-----------------------------------------+
  221. | *Getter* | get_filter_low_hanging_obstacles() |
  222. +-----------+-----------------------------------------+
  223. ----
  224. .. _class_NavigationMesh_property_geometry/collision_mask:
  225. - :ref:`int<class_int>` **geometry/collision_mask**
  226. +----------+---------------------------+
  227. | *Setter* | set_collision_mask(value) |
  228. +----------+---------------------------+
  229. | *Getter* | get_collision_mask() |
  230. +----------+---------------------------+
  231. ----
  232. .. _class_NavigationMesh_property_geometry/parsed_geometry_type:
  233. - :ref:`int<class_int>` **geometry/parsed_geometry_type**
  234. +-----------+---------------------------------+
  235. | *Default* | ``0`` |
  236. +-----------+---------------------------------+
  237. | *Setter* | set_parsed_geometry_type(value) |
  238. +-----------+---------------------------------+
  239. | *Getter* | get_parsed_geometry_type() |
  240. +-----------+---------------------------------+
  241. ----
  242. .. _class_NavigationMesh_property_geometry/source_geometry_mode:
  243. - :ref:`int<class_int>` **geometry/source_geometry_mode**
  244. +-----------+---------------------------------+
  245. | *Default* | ``0`` |
  246. +-----------+---------------------------------+
  247. | *Setter* | set_source_geometry_mode(value) |
  248. +-----------+---------------------------------+
  249. | *Getter* | get_source_geometry_mode() |
  250. +-----------+---------------------------------+
  251. ----
  252. .. _class_NavigationMesh_property_geometry/source_group_name:
  253. - :ref:`String<class_String>` **geometry/source_group_name**
  254. +----------+------------------------------+
  255. | *Setter* | set_source_group_name(value) |
  256. +----------+------------------------------+
  257. | *Getter* | get_source_group_name() |
  258. +----------+------------------------------+
  259. ----
  260. .. _class_NavigationMesh_property_polygon/verts_per_poly:
  261. - :ref:`float<class_float>` **polygon/verts_per_poly**
  262. +-----------+---------------------------+
  263. | *Default* | ``6.0`` |
  264. +-----------+---------------------------+
  265. | *Setter* | set_verts_per_poly(value) |
  266. +-----------+---------------------------+
  267. | *Getter* | get_verts_per_poly() |
  268. +-----------+---------------------------+
  269. ----
  270. .. _class_NavigationMesh_property_region/merge_size:
  271. - :ref:`float<class_float>` **region/merge_size**
  272. +-----------+------------------------------+
  273. | *Default* | ``20.0`` |
  274. +-----------+------------------------------+
  275. | *Setter* | set_region_merge_size(value) |
  276. +-----------+------------------------------+
  277. | *Getter* | get_region_merge_size() |
  278. +-----------+------------------------------+
  279. ----
  280. .. _class_NavigationMesh_property_region/min_size:
  281. - :ref:`float<class_float>` **region/min_size**
  282. +-----------+----------------------------+
  283. | *Default* | ``8.0`` |
  284. +-----------+----------------------------+
  285. | *Setter* | set_region_min_size(value) |
  286. +-----------+----------------------------+
  287. | *Getter* | get_region_min_size() |
  288. +-----------+----------------------------+
  289. ----
  290. .. _class_NavigationMesh_property_sample_partition_type/sample_partition_type:
  291. - :ref:`int<class_int>` **sample_partition_type/sample_partition_type**
  292. +-----------+----------------------------------+
  293. | *Default* | ``0`` |
  294. +-----------+----------------------------------+
  295. | *Setter* | set_sample_partition_type(value) |
  296. +-----------+----------------------------------+
  297. | *Getter* | get_sample_partition_type() |
  298. +-----------+----------------------------------+
  299. Method Descriptions
  300. -------------------
  301. .. _class_NavigationMesh_method_add_polygon:
  302. - void **add_polygon** **(** :ref:`PoolIntArray<class_PoolIntArray>` polygon **)**
  303. ----
  304. .. _class_NavigationMesh_method_clear_polygons:
  305. - void **clear_polygons** **(** **)**
  306. ----
  307. .. _class_NavigationMesh_method_create_from_mesh:
  308. - void **create_from_mesh** **(** :ref:`Mesh<class_Mesh>` mesh **)**
  309. ----
  310. .. _class_NavigationMesh_method_get_collision_mask_bit:
  311. - :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** |const|
  312. ----
  313. .. _class_NavigationMesh_method_get_polygon:
  314. - :ref:`PoolIntArray<class_PoolIntArray>` **get_polygon** **(** :ref:`int<class_int>` idx **)**
  315. ----
  316. .. _class_NavigationMesh_method_get_polygon_count:
  317. - :ref:`int<class_int>` **get_polygon_count** **(** **)** |const|
  318. ----
  319. .. _class_NavigationMesh_method_get_vertices:
  320. - :ref:`PoolVector3Array<class_PoolVector3Array>` **get_vertices** **(** **)** |const|
  321. ----
  322. .. _class_NavigationMesh_method_set_collision_mask_bit:
  323. - void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
  324. ----
  325. .. _class_NavigationMesh_method_set_vertices:
  326. - void **set_vertices** **(** :ref:`PoolVector3Array<class_PoolVector3Array>` vertices **)**
  327. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  328. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  329. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`