class_navigationserver2d.rst 167 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.3/doc/classes/NavigationServer2D.xml.
  6. .. _class_NavigationServer2D:
  7. NavigationServer2D
  8. ==================
  9. **Experimental:** This class may be changed or removed in future versions.
  10. **Inherits:** :ref:`Object<class_Object>`
  11. A server interface for low-level 2D navigation access.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. NavigationServer2D is the server that handles navigation maps, regions and agents. It does not handle A\* navigation from :ref:`AStar2D<class_AStar2D>` or :ref:`AStarGrid2D<class_AStarGrid2D>`.
  16. Maps are divided into regions, which are composed of navigation polygons. Together, they define the traversable areas in the 2D world.
  17. \ **Note:** Most **NavigationServer2D** changes take effect after the next physics frame and not immediately. This includes all changes made to maps, regions or agents by navigation-related nodes in the scene tree or made through scripts.
  18. For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than ``edge_connection_margin`` to the respective other edge's vertex.
  19. You may assign navigation layers to regions with :ref:`region_set_navigation_layers<class_NavigationServer2D_method_region_set_navigation_layers>`, which then can be checked upon when requesting a path with :ref:`map_get_path<class_NavigationServer2D_method_map_get_path>`. This can be used to allow or deny certain areas for some objects.
  20. To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity.
  21. \ **Note:** The collision avoidance system ignores regions. Using the modified velocity directly may move an agent outside of the traversable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine.
  22. This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying.
  23. .. rst-class:: classref-introduction-group
  24. Tutorials
  25. ---------
  26. - :doc:`Using NavigationServer <../tutorials/navigation/navigation_using_navigationservers>`
  27. - `Navigation Polygon 2D Demo <https://godotengine.org/asset-library/asset/2722>`__
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`RID<class_RID>` | :ref:`agent_create<class_NavigationServer2D_method_agent_create>`\ (\ ) |
  35. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`agent_get_avoidance_enabled<class_NavigationServer2D_method_agent_get_avoidance_enabled>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  37. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`int<class_int>` | :ref:`agent_get_avoidance_layers<class_NavigationServer2D_method_agent_get_avoidance_layers>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  39. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`agent_get_avoidance_mask<class_NavigationServer2D_method_agent_get_avoidance_mask>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  41. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`float<class_float>` | :ref:`agent_get_avoidance_priority<class_NavigationServer2D_method_agent_get_avoidance_priority>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  43. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`RID<class_RID>` | :ref:`agent_get_map<class_NavigationServer2D_method_agent_get_map>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  45. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`int<class_int>` | :ref:`agent_get_max_neighbors<class_NavigationServer2D_method_agent_get_max_neighbors>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  47. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`float<class_float>` | :ref:`agent_get_max_speed<class_NavigationServer2D_method_agent_get_max_speed>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  49. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`float<class_float>` | :ref:`agent_get_neighbor_distance<class_NavigationServer2D_method_agent_get_neighbor_distance>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  51. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`agent_get_paused<class_NavigationServer2D_method_agent_get_paused>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  53. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Vector2<class_Vector2>` | :ref:`agent_get_position<class_NavigationServer2D_method_agent_get_position>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  55. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`float<class_float>` | :ref:`agent_get_radius<class_NavigationServer2D_method_agent_get_radius>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  57. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`float<class_float>` | :ref:`agent_get_time_horizon_agents<class_NavigationServer2D_method_agent_get_time_horizon_agents>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  59. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`float<class_float>` | :ref:`agent_get_time_horizon_obstacles<class_NavigationServer2D_method_agent_get_time_horizon_obstacles>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  61. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Vector2<class_Vector2>` | :ref:`agent_get_velocity<class_NavigationServer2D_method_agent_get_velocity>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  63. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`agent_has_avoidance_callback<class_NavigationServer2D_method_agent_has_avoidance_callback>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  65. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`bool<class_bool>` | :ref:`agent_is_map_changed<class_NavigationServer2D_method_agent_is_map_changed>`\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| |
  67. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | |void| | :ref:`agent_set_avoidance_callback<class_NavigationServer2D_method_agent_set_avoidance_callback>`\ (\ agent\: :ref:`RID<class_RID>`, callback\: :ref:`Callable<class_Callable>`\ ) |
  69. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | |void| | :ref:`agent_set_avoidance_enabled<class_NavigationServer2D_method_agent_set_avoidance_enabled>`\ (\ agent\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  71. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | |void| | :ref:`agent_set_avoidance_layers<class_NavigationServer2D_method_agent_set_avoidance_layers>`\ (\ agent\: :ref:`RID<class_RID>`, layers\: :ref:`int<class_int>`\ ) |
  73. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | |void| | :ref:`agent_set_avoidance_mask<class_NavigationServer2D_method_agent_set_avoidance_mask>`\ (\ agent\: :ref:`RID<class_RID>`, mask\: :ref:`int<class_int>`\ ) |
  75. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | |void| | :ref:`agent_set_avoidance_priority<class_NavigationServer2D_method_agent_set_avoidance_priority>`\ (\ agent\: :ref:`RID<class_RID>`, priority\: :ref:`float<class_float>`\ ) |
  77. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | |void| | :ref:`agent_set_map<class_NavigationServer2D_method_agent_set_map>`\ (\ agent\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) |
  79. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | |void| | :ref:`agent_set_max_neighbors<class_NavigationServer2D_method_agent_set_max_neighbors>`\ (\ agent\: :ref:`RID<class_RID>`, count\: :ref:`int<class_int>`\ ) |
  81. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | |void| | :ref:`agent_set_max_speed<class_NavigationServer2D_method_agent_set_max_speed>`\ (\ agent\: :ref:`RID<class_RID>`, max_speed\: :ref:`float<class_float>`\ ) |
  83. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | |void| | :ref:`agent_set_neighbor_distance<class_NavigationServer2D_method_agent_set_neighbor_distance>`\ (\ agent\: :ref:`RID<class_RID>`, distance\: :ref:`float<class_float>`\ ) |
  85. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | |void| | :ref:`agent_set_paused<class_NavigationServer2D_method_agent_set_paused>`\ (\ agent\: :ref:`RID<class_RID>`, paused\: :ref:`bool<class_bool>`\ ) |
  87. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | |void| | :ref:`agent_set_position<class_NavigationServer2D_method_agent_set_position>`\ (\ agent\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
  89. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | |void| | :ref:`agent_set_radius<class_NavigationServer2D_method_agent_set_radius>`\ (\ agent\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) |
  91. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | |void| | :ref:`agent_set_time_horizon_agents<class_NavigationServer2D_method_agent_set_time_horizon_agents>`\ (\ agent\: :ref:`RID<class_RID>`, time_horizon\: :ref:`float<class_float>`\ ) |
  93. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | |void| | :ref:`agent_set_time_horizon_obstacles<class_NavigationServer2D_method_agent_set_time_horizon_obstacles>`\ (\ agent\: :ref:`RID<class_RID>`, time_horizon\: :ref:`float<class_float>`\ ) |
  95. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | |void| | :ref:`agent_set_velocity<class_NavigationServer2D_method_agent_set_velocity>`\ (\ agent\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) |
  97. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | |void| | :ref:`agent_set_velocity_forced<class_NavigationServer2D_method_agent_set_velocity_forced>`\ (\ agent\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) |
  99. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | |void| | :ref:`bake_from_source_geometry_data<class_NavigationServer2D_method_bake_from_source_geometry_data>`\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData2D<class_NavigationMeshSourceGeometryData2D>`, callback\: :ref:`Callable<class_Callable>` = Callable()\ ) |
  101. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | |void| | :ref:`bake_from_source_geometry_data_async<class_NavigationServer2D_method_bake_from_source_geometry_data_async>`\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData2D<class_NavigationMeshSourceGeometryData2D>`, callback\: :ref:`Callable<class_Callable>` = Callable()\ ) |
  103. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | |void| | :ref:`free_rid<class_NavigationServer2D_method_free_rid>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |
  105. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`bool<class_bool>` | :ref:`get_debug_enabled<class_NavigationServer2D_method_get_debug_enabled>`\ (\ ) |const| |
  107. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`get_maps<class_NavigationServer2D_method_get_maps>`\ (\ ) |const| |
  109. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`bool<class_bool>` | :ref:`is_baking_navigation_polygon<class_NavigationServer2D_method_is_baking_navigation_polygon>`\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) |const| |
  111. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`RID<class_RID>` | :ref:`link_create<class_NavigationServer2D_method_link_create>`\ (\ ) |
  113. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`bool<class_bool>` | :ref:`link_get_enabled<class_NavigationServer2D_method_link_get_enabled>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  115. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`Vector2<class_Vector2>` | :ref:`link_get_end_position<class_NavigationServer2D_method_link_get_end_position>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  117. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`float<class_float>` | :ref:`link_get_enter_cost<class_NavigationServer2D_method_link_get_enter_cost>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  119. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`RID<class_RID>` | :ref:`link_get_map<class_NavigationServer2D_method_link_get_map>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  121. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`int<class_int>` | :ref:`link_get_navigation_layers<class_NavigationServer2D_method_link_get_navigation_layers>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  123. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`int<class_int>` | :ref:`link_get_owner_id<class_NavigationServer2D_method_link_get_owner_id>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  125. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`Vector2<class_Vector2>` | :ref:`link_get_start_position<class_NavigationServer2D_method_link_get_start_position>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  127. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`float<class_float>` | :ref:`link_get_travel_cost<class_NavigationServer2D_method_link_get_travel_cost>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  129. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`bool<class_bool>` | :ref:`link_is_bidirectional<class_NavigationServer2D_method_link_is_bidirectional>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  131. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | |void| | :ref:`link_set_bidirectional<class_NavigationServer2D_method_link_set_bidirectional>`\ (\ link\: :ref:`RID<class_RID>`, bidirectional\: :ref:`bool<class_bool>`\ ) |
  133. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | |void| | :ref:`link_set_enabled<class_NavigationServer2D_method_link_set_enabled>`\ (\ link\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  135. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | |void| | :ref:`link_set_end_position<class_NavigationServer2D_method_link_set_end_position>`\ (\ link\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
  137. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | |void| | :ref:`link_set_enter_cost<class_NavigationServer2D_method_link_set_enter_cost>`\ (\ link\: :ref:`RID<class_RID>`, enter_cost\: :ref:`float<class_float>`\ ) |
  139. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | |void| | :ref:`link_set_map<class_NavigationServer2D_method_link_set_map>`\ (\ link\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) |
  141. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | |void| | :ref:`link_set_navigation_layers<class_NavigationServer2D_method_link_set_navigation_layers>`\ (\ link\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`\ ) |
  143. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | |void| | :ref:`link_set_owner_id<class_NavigationServer2D_method_link_set_owner_id>`\ (\ link\: :ref:`RID<class_RID>`, owner_id\: :ref:`int<class_int>`\ ) |
  145. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | |void| | :ref:`link_set_start_position<class_NavigationServer2D_method_link_set_start_position>`\ (\ link\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
  147. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | |void| | :ref:`link_set_travel_cost<class_NavigationServer2D_method_link_set_travel_cost>`\ (\ link\: :ref:`RID<class_RID>`, travel_cost\: :ref:`float<class_float>`\ ) |
  149. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`RID<class_RID>` | :ref:`map_create<class_NavigationServer2D_method_map_create>`\ (\ ) |
  151. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | |void| | :ref:`map_force_update<class_NavigationServer2D_method_map_force_update>`\ (\ map\: :ref:`RID<class_RID>`\ ) |
  153. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`map_get_agents<class_NavigationServer2D_method_map_get_agents>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  155. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`float<class_float>` | :ref:`map_get_cell_size<class_NavigationServer2D_method_map_get_cell_size>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  157. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`Vector2<class_Vector2>` | :ref:`map_get_closest_point<class_NavigationServer2D_method_map_get_closest_point>`\ (\ map\: :ref:`RID<class_RID>`, to_point\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  159. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`RID<class_RID>` | :ref:`map_get_closest_point_owner<class_NavigationServer2D_method_map_get_closest_point_owner>`\ (\ map\: :ref:`RID<class_RID>`, to_point\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  161. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`float<class_float>` | :ref:`map_get_edge_connection_margin<class_NavigationServer2D_method_map_get_edge_connection_margin>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  163. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`int<class_int>` | :ref:`map_get_iteration_id<class_NavigationServer2D_method_map_get_iteration_id>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  165. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`float<class_float>` | :ref:`map_get_link_connection_radius<class_NavigationServer2D_method_map_get_link_connection_radius>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  167. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`map_get_links<class_NavigationServer2D_method_map_get_links>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  169. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`map_get_obstacles<class_NavigationServer2D_method_map_get_obstacles>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  171. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`map_get_path<class_NavigationServer2D_method_map_get_path>`\ (\ map\: :ref:`RID<class_RID>`, origin\: :ref:`Vector2<class_Vector2>`, destination\: :ref:`Vector2<class_Vector2>`, optimize\: :ref:`bool<class_bool>`, navigation_layers\: :ref:`int<class_int>` = 1\ ) |const| |
  173. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`Vector2<class_Vector2>` | :ref:`map_get_random_point<class_NavigationServer2D_method_map_get_random_point>`\ (\ map\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`, uniformly\: :ref:`bool<class_bool>`\ ) |const| |
  175. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`map_get_regions<class_NavigationServer2D_method_map_get_regions>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  177. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`bool<class_bool>` | :ref:`map_get_use_edge_connections<class_NavigationServer2D_method_map_get_use_edge_connections>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  179. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`bool<class_bool>` | :ref:`map_is_active<class_NavigationServer2D_method_map_is_active>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  181. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | |void| | :ref:`map_set_active<class_NavigationServer2D_method_map_set_active>`\ (\ map\: :ref:`RID<class_RID>`, active\: :ref:`bool<class_bool>`\ ) |
  183. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | |void| | :ref:`map_set_cell_size<class_NavigationServer2D_method_map_set_cell_size>`\ (\ map\: :ref:`RID<class_RID>`, cell_size\: :ref:`float<class_float>`\ ) |
  185. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | |void| | :ref:`map_set_edge_connection_margin<class_NavigationServer2D_method_map_set_edge_connection_margin>`\ (\ map\: :ref:`RID<class_RID>`, margin\: :ref:`float<class_float>`\ ) |
  187. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | |void| | :ref:`map_set_link_connection_radius<class_NavigationServer2D_method_map_set_link_connection_radius>`\ (\ map\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) |
  189. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | |void| | :ref:`map_set_use_edge_connections<class_NavigationServer2D_method_map_set_use_edge_connections>`\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  191. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`RID<class_RID>` | :ref:`obstacle_create<class_NavigationServer2D_method_obstacle_create>`\ (\ ) |
  193. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | :ref:`bool<class_bool>` | :ref:`obstacle_get_avoidance_enabled<class_NavigationServer2D_method_obstacle_get_avoidance_enabled>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  195. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | :ref:`int<class_int>` | :ref:`obstacle_get_avoidance_layers<class_NavigationServer2D_method_obstacle_get_avoidance_layers>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  197. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | :ref:`RID<class_RID>` | :ref:`obstacle_get_map<class_NavigationServer2D_method_obstacle_get_map>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  199. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`bool<class_bool>` | :ref:`obstacle_get_paused<class_NavigationServer2D_method_obstacle_get_paused>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  201. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`Vector2<class_Vector2>` | :ref:`obstacle_get_position<class_NavigationServer2D_method_obstacle_get_position>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  203. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`float<class_float>` | :ref:`obstacle_get_radius<class_NavigationServer2D_method_obstacle_get_radius>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  205. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | :ref:`Vector2<class_Vector2>` | :ref:`obstacle_get_velocity<class_NavigationServer2D_method_obstacle_get_velocity>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  207. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`obstacle_get_vertices<class_NavigationServer2D_method_obstacle_get_vertices>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  209. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | |void| | :ref:`obstacle_set_avoidance_enabled<class_NavigationServer2D_method_obstacle_set_avoidance_enabled>`\ (\ obstacle\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  211. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | |void| | :ref:`obstacle_set_avoidance_layers<class_NavigationServer2D_method_obstacle_set_avoidance_layers>`\ (\ obstacle\: :ref:`RID<class_RID>`, layers\: :ref:`int<class_int>`\ ) |
  213. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | |void| | :ref:`obstacle_set_map<class_NavigationServer2D_method_obstacle_set_map>`\ (\ obstacle\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) |
  215. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | |void| | :ref:`obstacle_set_paused<class_NavigationServer2D_method_obstacle_set_paused>`\ (\ obstacle\: :ref:`RID<class_RID>`, paused\: :ref:`bool<class_bool>`\ ) |
  217. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | |void| | :ref:`obstacle_set_position<class_NavigationServer2D_method_obstacle_set_position>`\ (\ obstacle\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
  219. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | |void| | :ref:`obstacle_set_radius<class_NavigationServer2D_method_obstacle_set_radius>`\ (\ obstacle\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) |
  221. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | |void| | :ref:`obstacle_set_velocity<class_NavigationServer2D_method_obstacle_set_velocity>`\ (\ obstacle\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) |
  223. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | |void| | :ref:`obstacle_set_vertices<class_NavigationServer2D_method_obstacle_set_vertices>`\ (\ obstacle\: :ref:`RID<class_RID>`, vertices\: :ref:`PackedVector2Array<class_PackedVector2Array>`\ ) |
  225. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | |void| | :ref:`parse_source_geometry_data<class_NavigationServer2D_method_parse_source_geometry_data>`\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData2D<class_NavigationMeshSourceGeometryData2D>`, root_node\: :ref:`Node<class_Node>`, callback\: :ref:`Callable<class_Callable>` = Callable()\ ) |
  227. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | |void| | :ref:`query_path<class_NavigationServer2D_method_query_path>`\ (\ parameters\: :ref:`NavigationPathQueryParameters2D<class_NavigationPathQueryParameters2D>`, result\: :ref:`NavigationPathQueryResult2D<class_NavigationPathQueryResult2D>`\ ) |const| |
  229. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | :ref:`RID<class_RID>` | :ref:`region_create<class_NavigationServer2D_method_region_create>`\ (\ ) |
  231. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | :ref:`Vector2<class_Vector2>` | :ref:`region_get_connection_pathway_end<class_NavigationServer2D_method_region_get_connection_pathway_end>`\ (\ region\: :ref:`RID<class_RID>`, connection\: :ref:`int<class_int>`\ ) |const| |
  233. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | :ref:`Vector2<class_Vector2>` | :ref:`region_get_connection_pathway_start<class_NavigationServer2D_method_region_get_connection_pathway_start>`\ (\ region\: :ref:`RID<class_RID>`, connection\: :ref:`int<class_int>`\ ) |const| |
  235. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | :ref:`int<class_int>` | :ref:`region_get_connections_count<class_NavigationServer2D_method_region_get_connections_count>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  237. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | :ref:`bool<class_bool>` | :ref:`region_get_enabled<class_NavigationServer2D_method_region_get_enabled>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  239. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | :ref:`float<class_float>` | :ref:`region_get_enter_cost<class_NavigationServer2D_method_region_get_enter_cost>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  241. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | :ref:`RID<class_RID>` | :ref:`region_get_map<class_NavigationServer2D_method_region_get_map>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  243. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | :ref:`int<class_int>` | :ref:`region_get_navigation_layers<class_NavigationServer2D_method_region_get_navigation_layers>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  245. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | :ref:`int<class_int>` | :ref:`region_get_owner_id<class_NavigationServer2D_method_region_get_owner_id>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  247. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | :ref:`Vector2<class_Vector2>` | :ref:`region_get_random_point<class_NavigationServer2D_method_region_get_random_point>`\ (\ region\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`, uniformly\: :ref:`bool<class_bool>`\ ) |const| |
  249. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | :ref:`Transform2D<class_Transform2D>` | :ref:`region_get_transform<class_NavigationServer2D_method_region_get_transform>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  251. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | :ref:`float<class_float>` | :ref:`region_get_travel_cost<class_NavigationServer2D_method_region_get_travel_cost>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  253. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | :ref:`bool<class_bool>` | :ref:`region_get_use_edge_connections<class_NavigationServer2D_method_region_get_use_edge_connections>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  255. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | :ref:`bool<class_bool>` | :ref:`region_owns_point<class_NavigationServer2D_method_region_owns_point>`\ (\ region\: :ref:`RID<class_RID>`, point\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  257. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | |void| | :ref:`region_set_enabled<class_NavigationServer2D_method_region_set_enabled>`\ (\ region\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  259. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | |void| | :ref:`region_set_enter_cost<class_NavigationServer2D_method_region_set_enter_cost>`\ (\ region\: :ref:`RID<class_RID>`, enter_cost\: :ref:`float<class_float>`\ ) |
  261. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | |void| | :ref:`region_set_map<class_NavigationServer2D_method_region_set_map>`\ (\ region\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) |
  263. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | |void| | :ref:`region_set_navigation_layers<class_NavigationServer2D_method_region_set_navigation_layers>`\ (\ region\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`\ ) |
  265. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | |void| | :ref:`region_set_navigation_polygon<class_NavigationServer2D_method_region_set_navigation_polygon>`\ (\ region\: :ref:`RID<class_RID>`, navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) |
  267. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | |void| | :ref:`region_set_owner_id<class_NavigationServer2D_method_region_set_owner_id>`\ (\ region\: :ref:`RID<class_RID>`, owner_id\: :ref:`int<class_int>`\ ) |
  269. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | |void| | :ref:`region_set_transform<class_NavigationServer2D_method_region_set_transform>`\ (\ region\: :ref:`RID<class_RID>`, transform\: :ref:`Transform2D<class_Transform2D>`\ ) |
  271. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | |void| | :ref:`region_set_travel_cost<class_NavigationServer2D_method_region_set_travel_cost>`\ (\ region\: :ref:`RID<class_RID>`, travel_cost\: :ref:`float<class_float>`\ ) |
  273. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | |void| | :ref:`region_set_use_edge_connections<class_NavigationServer2D_method_region_set_use_edge_connections>`\ (\ region\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  275. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | |void| | :ref:`set_debug_enabled<class_NavigationServer2D_method_set_debug_enabled>`\ (\ enabled\: :ref:`bool<class_bool>`\ ) |
  277. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`simplify_path<class_NavigationServer2D_method_simplify_path>`\ (\ path\: :ref:`PackedVector2Array<class_PackedVector2Array>`, epsilon\: :ref:`float<class_float>`\ ) |
  279. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :ref:`RID<class_RID>` | :ref:`source_geometry_parser_create<class_NavigationServer2D_method_source_geometry_parser_create>`\ (\ ) |
  281. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | |void| | :ref:`source_geometry_parser_set_callback<class_NavigationServer2D_method_source_geometry_parser_set_callback>`\ (\ parser\: :ref:`RID<class_RID>`, callback\: :ref:`Callable<class_Callable>`\ ) |
  283. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. .. rst-class:: classref-section-separator
  285. ----
  286. .. rst-class:: classref-descriptions-group
  287. Signals
  288. -------
  289. .. _class_NavigationServer2D_signal_map_changed:
  290. .. rst-class:: classref-signal
  291. **map_changed**\ (\ map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_signal_map_changed>`
  292. Emitted when a navigation map is updated, when a region moves or is modified.
  293. .. rst-class:: classref-item-separator
  294. ----
  295. .. _class_NavigationServer2D_signal_navigation_debug_changed:
  296. .. rst-class:: classref-signal
  297. **navigation_debug_changed**\ (\ ) :ref:`🔗<class_NavigationServer2D_signal_navigation_debug_changed>`
  298. Emitted when navigation debug settings are changed. Only available in debug builds.
  299. .. rst-class:: classref-section-separator
  300. ----
  301. .. rst-class:: classref-descriptions-group
  302. Method Descriptions
  303. -------------------
  304. .. _class_NavigationServer2D_method_agent_create:
  305. .. rst-class:: classref-method
  306. :ref:`RID<class_RID>` **agent_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_agent_create>`
  307. Creates the agent.
  308. .. rst-class:: classref-item-separator
  309. ----
  310. .. _class_NavigationServer2D_method_agent_get_avoidance_enabled:
  311. .. rst-class:: classref-method
  312. :ref:`bool<class_bool>` **agent_get_avoidance_enabled**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_avoidance_enabled>`
  313. Return ``true`` if the specified ``agent`` uses avoidance.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_NavigationServer2D_method_agent_get_avoidance_layers:
  317. .. rst-class:: classref-method
  318. :ref:`int<class_int>` **agent_get_avoidance_layers**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_avoidance_layers>`
  319. Returns the ``avoidance_layers`` bitmask of the specified ``agent``.
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_NavigationServer2D_method_agent_get_avoidance_mask:
  323. .. rst-class:: classref-method
  324. :ref:`int<class_int>` **agent_get_avoidance_mask**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_avoidance_mask>`
  325. Returns the ``avoidance_mask`` bitmask of the specified ``agent``.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_NavigationServer2D_method_agent_get_avoidance_priority:
  329. .. rst-class:: classref-method
  330. :ref:`float<class_float>` **agent_get_avoidance_priority**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_avoidance_priority>`
  331. Returns the ``avoidance_priority`` of the specified ``agent``.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_NavigationServer2D_method_agent_get_map:
  335. .. rst-class:: classref-method
  336. :ref:`RID<class_RID>` **agent_get_map**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_map>`
  337. Returns the navigation map :ref:`RID<class_RID>` the requested ``agent`` is currently assigned to.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _class_NavigationServer2D_method_agent_get_max_neighbors:
  341. .. rst-class:: classref-method
  342. :ref:`int<class_int>` **agent_get_max_neighbors**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_max_neighbors>`
  343. Returns the maximum number of other agents the specified ``agent`` takes into account in the navigation.
  344. .. rst-class:: classref-item-separator
  345. ----
  346. .. _class_NavigationServer2D_method_agent_get_max_speed:
  347. .. rst-class:: classref-method
  348. :ref:`float<class_float>` **agent_get_max_speed**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_max_speed>`
  349. Returns the maximum speed of the specified ``agent``.
  350. .. rst-class:: classref-item-separator
  351. ----
  352. .. _class_NavigationServer2D_method_agent_get_neighbor_distance:
  353. .. rst-class:: classref-method
  354. :ref:`float<class_float>` **agent_get_neighbor_distance**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_neighbor_distance>`
  355. Returns the maximum distance to other agents the specified ``agent`` takes into account in the navigation.
  356. .. rst-class:: classref-item-separator
  357. ----
  358. .. _class_NavigationServer2D_method_agent_get_paused:
  359. .. rst-class:: classref-method
  360. :ref:`bool<class_bool>` **agent_get_paused**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_paused>`
  361. Returns ``true`` if the specified ``agent`` is paused.
  362. .. rst-class:: classref-item-separator
  363. ----
  364. .. _class_NavigationServer2D_method_agent_get_position:
  365. .. rst-class:: classref-method
  366. :ref:`Vector2<class_Vector2>` **agent_get_position**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_position>`
  367. Returns the position of the specified ``agent`` in world space.
  368. .. rst-class:: classref-item-separator
  369. ----
  370. .. _class_NavigationServer2D_method_agent_get_radius:
  371. .. rst-class:: classref-method
  372. :ref:`float<class_float>` **agent_get_radius**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_radius>`
  373. Returns the radius of the specified ``agent``.
  374. .. rst-class:: classref-item-separator
  375. ----
  376. .. _class_NavigationServer2D_method_agent_get_time_horizon_agents:
  377. .. rst-class:: classref-method
  378. :ref:`float<class_float>` **agent_get_time_horizon_agents**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_time_horizon_agents>`
  379. Returns the minimal amount of time for which the specified ``agent``'s velocities that are computed by the simulation are safe with respect to other agents.
  380. .. rst-class:: classref-item-separator
  381. ----
  382. .. _class_NavigationServer2D_method_agent_get_time_horizon_obstacles:
  383. .. rst-class:: classref-method
  384. :ref:`float<class_float>` **agent_get_time_horizon_obstacles**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_time_horizon_obstacles>`
  385. Returns the minimal amount of time for which the specified ``agent``'s velocities that are computed by the simulation are safe with respect to static avoidance obstacles.
  386. .. rst-class:: classref-item-separator
  387. ----
  388. .. _class_NavigationServer2D_method_agent_get_velocity:
  389. .. rst-class:: classref-method
  390. :ref:`Vector2<class_Vector2>` **agent_get_velocity**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_velocity>`
  391. Returns the velocity of the specified ``agent``.
  392. .. rst-class:: classref-item-separator
  393. ----
  394. .. _class_NavigationServer2D_method_agent_has_avoidance_callback:
  395. .. rst-class:: classref-method
  396. :ref:`bool<class_bool>` **agent_has_avoidance_callback**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_has_avoidance_callback>`
  397. Return ``true`` if the specified ``agent`` has an avoidance callback.
  398. .. rst-class:: classref-item-separator
  399. ----
  400. .. _class_NavigationServer2D_method_agent_is_map_changed:
  401. .. rst-class:: classref-method
  402. :ref:`bool<class_bool>` **agent_is_map_changed**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_is_map_changed>`
  403. Returns true if the map got changed the previous frame.
  404. .. rst-class:: classref-item-separator
  405. ----
  406. .. _class_NavigationServer2D_method_agent_set_avoidance_callback:
  407. .. rst-class:: classref-method
  408. |void| **agent_set_avoidance_callback**\ (\ agent\: :ref:`RID<class_RID>`, callback\: :ref:`Callable<class_Callable>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_callback>`
  409. Sets the callback :ref:`Callable<class_Callable>` that gets called after each avoidance processing step for the ``agent``. The calculated ``safe_velocity`` will be dispatched with a signal to the object just before the physics calculations.
  410. \ **Note:** Created callbacks are always processed independently of the SceneTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use :ref:`agent_set_avoidance_callback<class_NavigationServer2D_method_agent_set_avoidance_callback>` again with an empty :ref:`Callable<class_Callable>`.
  411. .. rst-class:: classref-item-separator
  412. ----
  413. .. _class_NavigationServer2D_method_agent_set_avoidance_enabled:
  414. .. rst-class:: classref-method
  415. |void| **agent_set_avoidance_enabled**\ (\ agent\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_enabled>`
  416. If ``enabled`` is ``true``, the specified ``agent`` uses avoidance.
  417. .. rst-class:: classref-item-separator
  418. ----
  419. .. _class_NavigationServer2D_method_agent_set_avoidance_layers:
  420. .. rst-class:: classref-method
  421. |void| **agent_set_avoidance_layers**\ (\ agent\: :ref:`RID<class_RID>`, layers\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_layers>`
  422. Set the agent's ``avoidance_layers`` bitmask.
  423. .. rst-class:: classref-item-separator
  424. ----
  425. .. _class_NavigationServer2D_method_agent_set_avoidance_mask:
  426. .. rst-class:: classref-method
  427. |void| **agent_set_avoidance_mask**\ (\ agent\: :ref:`RID<class_RID>`, mask\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_mask>`
  428. Set the agent's ``avoidance_mask`` bitmask.
  429. .. rst-class:: classref-item-separator
  430. ----
  431. .. _class_NavigationServer2D_method_agent_set_avoidance_priority:
  432. .. rst-class:: classref-method
  433. |void| **agent_set_avoidance_priority**\ (\ agent\: :ref:`RID<class_RID>`, priority\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_priority>`
  434. Set the agent's ``avoidance_priority`` with a ``priority`` between 0.0 (lowest priority) to 1.0 (highest priority).
  435. The specified ``agent`` does not adjust the velocity for other agents that would match the ``avoidance_mask`` but have a lower ``avoidance_priority``. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent.
  436. .. rst-class:: classref-item-separator
  437. ----
  438. .. _class_NavigationServer2D_method_agent_set_map:
  439. .. rst-class:: classref-method
  440. |void| **agent_set_map**\ (\ agent\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_map>`
  441. Puts the agent in the map.
  442. .. rst-class:: classref-item-separator
  443. ----
  444. .. _class_NavigationServer2D_method_agent_set_max_neighbors:
  445. .. rst-class:: classref-method
  446. |void| **agent_set_max_neighbors**\ (\ agent\: :ref:`RID<class_RID>`, count\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_max_neighbors>`
  447. Sets the maximum number of other agents the agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe.
  448. .. rst-class:: classref-item-separator
  449. ----
  450. .. _class_NavigationServer2D_method_agent_set_max_speed:
  451. .. rst-class:: classref-method
  452. |void| **agent_set_max_speed**\ (\ agent\: :ref:`RID<class_RID>`, max_speed\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_max_speed>`
  453. Sets the maximum speed of the agent. Must be positive.
  454. .. rst-class:: classref-item-separator
  455. ----
  456. .. _class_NavigationServer2D_method_agent_set_neighbor_distance:
  457. .. rst-class:: classref-method
  458. |void| **agent_set_neighbor_distance**\ (\ agent\: :ref:`RID<class_RID>`, distance\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_neighbor_distance>`
  459. Sets the maximum distance to other agents this agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe.
  460. .. rst-class:: classref-item-separator
  461. ----
  462. .. _class_NavigationServer2D_method_agent_set_paused:
  463. .. rst-class:: classref-method
  464. |void| **agent_set_paused**\ (\ agent\: :ref:`RID<class_RID>`, paused\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_paused>`
  465. If ``paused`` is true the specified ``agent`` will not be processed, e.g. calculate avoidance velocities or receive avoidance callbacks.
  466. .. rst-class:: classref-item-separator
  467. ----
  468. .. _class_NavigationServer2D_method_agent_set_position:
  469. .. rst-class:: classref-method
  470. |void| **agent_set_position**\ (\ agent\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_position>`
  471. Sets the position of the agent in world space.
  472. .. rst-class:: classref-item-separator
  473. ----
  474. .. _class_NavigationServer2D_method_agent_set_radius:
  475. .. rst-class:: classref-method
  476. |void| **agent_set_radius**\ (\ agent\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_radius>`
  477. Sets the radius of the agent.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _class_NavigationServer2D_method_agent_set_time_horizon_agents:
  481. .. rst-class:: classref-method
  482. |void| **agent_set_time_horizon_agents**\ (\ agent\: :ref:`RID<class_RID>`, time_horizon\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_time_horizon_agents>`
  483. The minimal amount of time for which the agent's velocities that are computed by the simulation are safe with respect to other agents. The larger this number, the sooner this agent will respond to the presence of other agents, but the less freedom this agent has in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive.
  484. .. rst-class:: classref-item-separator
  485. ----
  486. .. _class_NavigationServer2D_method_agent_set_time_horizon_obstacles:
  487. .. rst-class:: classref-method
  488. |void| **agent_set_time_horizon_obstacles**\ (\ agent\: :ref:`RID<class_RID>`, time_horizon\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_time_horizon_obstacles>`
  489. The minimal amount of time for which the agent's velocities that are computed by the simulation are safe with respect to static avoidance obstacles. The larger this number, the sooner this agent will respond to the presence of static avoidance obstacles, but the less freedom this agent has in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive.
  490. .. rst-class:: classref-item-separator
  491. ----
  492. .. _class_NavigationServer2D_method_agent_set_velocity:
  493. .. rst-class:: classref-method
  494. |void| **agent_set_velocity**\ (\ agent\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_velocity>`
  495. Sets ``velocity`` as the new wanted velocity for the specified ``agent``. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agent's and obstacles. When an agent is teleported to a new position far away use :ref:`agent_set_velocity_forced<class_NavigationServer2D_method_agent_set_velocity_forced>` instead to reset the internal velocity state.
  496. .. rst-class:: classref-item-separator
  497. ----
  498. .. _class_NavigationServer2D_method_agent_set_velocity_forced:
  499. .. rst-class:: classref-method
  500. |void| **agent_set_velocity_forced**\ (\ agent\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_velocity_forced>`
  501. Replaces the internal velocity in the collision avoidance simulation with ``velocity`` for the specified ``agent``. When an agent is teleported to a new position far away this function should be used in the same frame. If called frequently this function can get agents stuck.
  502. .. rst-class:: classref-item-separator
  503. ----
  504. .. _class_NavigationServer2D_method_bake_from_source_geometry_data:
  505. .. rst-class:: classref-method
  506. |void| **bake_from_source_geometry_data**\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData2D<class_NavigationMeshSourceGeometryData2D>`, callback\: :ref:`Callable<class_Callable>` = Callable()\ ) :ref:`🔗<class_NavigationServer2D_method_bake_from_source_geometry_data>`
  507. Bakes the provided ``navigation_polygon`` with the data from the provided ``source_geometry_data``. After the process is finished the optional ``callback`` will be called.
  508. .. rst-class:: classref-item-separator
  509. ----
  510. .. _class_NavigationServer2D_method_bake_from_source_geometry_data_async:
  511. .. rst-class:: classref-method
  512. |void| **bake_from_source_geometry_data_async**\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData2D<class_NavigationMeshSourceGeometryData2D>`, callback\: :ref:`Callable<class_Callable>` = Callable()\ ) :ref:`🔗<class_NavigationServer2D_method_bake_from_source_geometry_data_async>`
  513. Bakes the provided ``navigation_polygon`` with the data from the provided ``source_geometry_data`` as an async task running on a background thread. After the process is finished the optional ``callback`` will be called.
  514. .. rst-class:: classref-item-separator
  515. ----
  516. .. _class_NavigationServer2D_method_free_rid:
  517. .. rst-class:: classref-method
  518. |void| **free_rid**\ (\ rid\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_free_rid>`
  519. Destroys the given RID.
  520. .. rst-class:: classref-item-separator
  521. ----
  522. .. _class_NavigationServer2D_method_get_debug_enabled:
  523. .. rst-class:: classref-method
  524. :ref:`bool<class_bool>` **get_debug_enabled**\ (\ ) |const| :ref:`🔗<class_NavigationServer2D_method_get_debug_enabled>`
  525. Returns ``true`` when the NavigationServer has debug enabled.
  526. .. rst-class:: classref-item-separator
  527. ----
  528. .. _class_NavigationServer2D_method_get_maps:
  529. .. rst-class:: classref-method
  530. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **get_maps**\ (\ ) |const| :ref:`🔗<class_NavigationServer2D_method_get_maps>`
  531. Returns all created navigation map :ref:`RID<class_RID>`\ s on the NavigationServer. This returns both 2D and 3D created navigation maps as there is technically no distinction between them.
  532. .. rst-class:: classref-item-separator
  533. ----
  534. .. _class_NavigationServer2D_method_is_baking_navigation_polygon:
  535. .. rst-class:: classref-method
  536. :ref:`bool<class_bool>` **is_baking_navigation_polygon**\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_is_baking_navigation_polygon>`
  537. Returns ``true`` when the provided navigation polygon is being baked on a background thread.
  538. .. rst-class:: classref-item-separator
  539. ----
  540. .. _class_NavigationServer2D_method_link_create:
  541. .. rst-class:: classref-method
  542. :ref:`RID<class_RID>` **link_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_link_create>`
  543. Create a new link between two positions on a map.
  544. .. rst-class:: classref-item-separator
  545. ----
  546. .. _class_NavigationServer2D_method_link_get_enabled:
  547. .. rst-class:: classref-method
  548. :ref:`bool<class_bool>` **link_get_enabled**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_enabled>`
  549. Returns ``true`` if the specified ``link`` is enabled.
  550. .. rst-class:: classref-item-separator
  551. ----
  552. .. _class_NavigationServer2D_method_link_get_end_position:
  553. .. rst-class:: classref-method
  554. :ref:`Vector2<class_Vector2>` **link_get_end_position**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_end_position>`
  555. Returns the ending position of this ``link``.
  556. .. rst-class:: classref-item-separator
  557. ----
  558. .. _class_NavigationServer2D_method_link_get_enter_cost:
  559. .. rst-class:: classref-method
  560. :ref:`float<class_float>` **link_get_enter_cost**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_enter_cost>`
  561. Returns the enter cost of this ``link``.
  562. .. rst-class:: classref-item-separator
  563. ----
  564. .. _class_NavigationServer2D_method_link_get_map:
  565. .. rst-class:: classref-method
  566. :ref:`RID<class_RID>` **link_get_map**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_map>`
  567. Returns the navigation map :ref:`RID<class_RID>` the requested ``link`` is currently assigned to.
  568. .. rst-class:: classref-item-separator
  569. ----
  570. .. _class_NavigationServer2D_method_link_get_navigation_layers:
  571. .. rst-class:: classref-method
  572. :ref:`int<class_int>` **link_get_navigation_layers**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_navigation_layers>`
  573. Returns the navigation layers for this ``link``.
  574. .. rst-class:: classref-item-separator
  575. ----
  576. .. _class_NavigationServer2D_method_link_get_owner_id:
  577. .. rst-class:: classref-method
  578. :ref:`int<class_int>` **link_get_owner_id**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_owner_id>`
  579. Returns the ``ObjectID`` of the object which manages this link.
  580. .. rst-class:: classref-item-separator
  581. ----
  582. .. _class_NavigationServer2D_method_link_get_start_position:
  583. .. rst-class:: classref-method
  584. :ref:`Vector2<class_Vector2>` **link_get_start_position**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_start_position>`
  585. Returns the starting position of this ``link``.
  586. .. rst-class:: classref-item-separator
  587. ----
  588. .. _class_NavigationServer2D_method_link_get_travel_cost:
  589. .. rst-class:: classref-method
  590. :ref:`float<class_float>` **link_get_travel_cost**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_travel_cost>`
  591. Returns the travel cost of this ``link``.
  592. .. rst-class:: classref-item-separator
  593. ----
  594. .. _class_NavigationServer2D_method_link_is_bidirectional:
  595. .. rst-class:: classref-method
  596. :ref:`bool<class_bool>` **link_is_bidirectional**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_is_bidirectional>`
  597. Returns whether this ``link`` can be travelled in both directions.
  598. .. rst-class:: classref-item-separator
  599. ----
  600. .. _class_NavigationServer2D_method_link_set_bidirectional:
  601. .. rst-class:: classref-method
  602. |void| **link_set_bidirectional**\ (\ link\: :ref:`RID<class_RID>`, bidirectional\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_bidirectional>`
  603. Sets whether this ``link`` can be travelled in both directions.
  604. .. rst-class:: classref-item-separator
  605. ----
  606. .. _class_NavigationServer2D_method_link_set_enabled:
  607. .. rst-class:: classref-method
  608. |void| **link_set_enabled**\ (\ link\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_enabled>`
  609. If ``enabled`` is ``true``, the specified ``link`` will contribute to its current navigation map.
  610. .. rst-class:: classref-item-separator
  611. ----
  612. .. _class_NavigationServer2D_method_link_set_end_position:
  613. .. rst-class:: classref-method
  614. |void| **link_set_end_position**\ (\ link\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_end_position>`
  615. Sets the exit position for the ``link``.
  616. .. rst-class:: classref-item-separator
  617. ----
  618. .. _class_NavigationServer2D_method_link_set_enter_cost:
  619. .. rst-class:: classref-method
  620. |void| **link_set_enter_cost**\ (\ link\: :ref:`RID<class_RID>`, enter_cost\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_enter_cost>`
  621. Sets the ``enter_cost`` for this ``link``.
  622. .. rst-class:: classref-item-separator
  623. ----
  624. .. _class_NavigationServer2D_method_link_set_map:
  625. .. rst-class:: classref-method
  626. |void| **link_set_map**\ (\ link\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_map>`
  627. Sets the navigation map :ref:`RID<class_RID>` for the link.
  628. .. rst-class:: classref-item-separator
  629. ----
  630. .. _class_NavigationServer2D_method_link_set_navigation_layers:
  631. .. rst-class:: classref-method
  632. |void| **link_set_navigation_layers**\ (\ link\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_navigation_layers>`
  633. Set the links's navigation layers. This allows selecting links from a path request (when using :ref:`map_get_path<class_NavigationServer2D_method_map_get_path>`).
  634. .. rst-class:: classref-item-separator
  635. ----
  636. .. _class_NavigationServer2D_method_link_set_owner_id:
  637. .. rst-class:: classref-method
  638. |void| **link_set_owner_id**\ (\ link\: :ref:`RID<class_RID>`, owner_id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_owner_id>`
  639. Set the ``ObjectID`` of the object which manages this link.
  640. .. rst-class:: classref-item-separator
  641. ----
  642. .. _class_NavigationServer2D_method_link_set_start_position:
  643. .. rst-class:: classref-method
  644. |void| **link_set_start_position**\ (\ link\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_start_position>`
  645. Sets the entry position for this ``link``.
  646. .. rst-class:: classref-item-separator
  647. ----
  648. .. _class_NavigationServer2D_method_link_set_travel_cost:
  649. .. rst-class:: classref-method
  650. |void| **link_set_travel_cost**\ (\ link\: :ref:`RID<class_RID>`, travel_cost\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_travel_cost>`
  651. Sets the ``travel_cost`` for this ``link``.
  652. .. rst-class:: classref-item-separator
  653. ----
  654. .. _class_NavigationServer2D_method_map_create:
  655. .. rst-class:: classref-method
  656. :ref:`RID<class_RID>` **map_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_map_create>`
  657. Create a new map.
  658. .. rst-class:: classref-item-separator
  659. ----
  660. .. _class_NavigationServer2D_method_map_force_update:
  661. .. rst-class:: classref-method
  662. |void| **map_force_update**\ (\ map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_force_update>`
  663. This function immediately forces synchronization of the specified navigation ``map`` :ref:`RID<class_RID>`. By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed).
  664. Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update.
  665. Avoidance processing and dispatch of the ``safe_velocity`` signals is unaffected by this function and continues to happen for all maps and agents at the end of the physics frame.
  666. \ **Note:** With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight.
  667. .. rst-class:: classref-item-separator
  668. ----
  669. .. _class_NavigationServer2D_method_map_get_agents:
  670. .. rst-class:: classref-method
  671. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **map_get_agents**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_agents>`
  672. Returns all navigation agents :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  673. .. rst-class:: classref-item-separator
  674. ----
  675. .. _class_NavigationServer2D_method_map_get_cell_size:
  676. .. rst-class:: classref-method
  677. :ref:`float<class_float>` **map_get_cell_size**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_cell_size>`
  678. Returns the map cell size used to rasterize the navigation mesh vertices.
  679. .. rst-class:: classref-item-separator
  680. ----
  681. .. _class_NavigationServer2D_method_map_get_closest_point:
  682. .. rst-class:: classref-method
  683. :ref:`Vector2<class_Vector2>` **map_get_closest_point**\ (\ map\: :ref:`RID<class_RID>`, to_point\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_closest_point>`
  684. Returns the point closest to the provided ``to_point`` on the navigation mesh surface.
  685. .. rst-class:: classref-item-separator
  686. ----
  687. .. _class_NavigationServer2D_method_map_get_closest_point_owner:
  688. .. rst-class:: classref-method
  689. :ref:`RID<class_RID>` **map_get_closest_point_owner**\ (\ map\: :ref:`RID<class_RID>`, to_point\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_closest_point_owner>`
  690. Returns the owner region RID for the point returned by :ref:`map_get_closest_point<class_NavigationServer2D_method_map_get_closest_point>`.
  691. .. rst-class:: classref-item-separator
  692. ----
  693. .. _class_NavigationServer2D_method_map_get_edge_connection_margin:
  694. .. rst-class:: classref-method
  695. :ref:`float<class_float>` **map_get_edge_connection_margin**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_edge_connection_margin>`
  696. Returns the edge connection margin of the map. The edge connection margin is a distance used to connect two regions.
  697. .. rst-class:: classref-item-separator
  698. ----
  699. .. _class_NavigationServer2D_method_map_get_iteration_id:
  700. .. rst-class:: classref-method
  701. :ref:`int<class_int>` **map_get_iteration_id**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_iteration_id>`
  702. Returns the current iteration id of the navigation map. Every time the navigation map changes and synchronizes the iteration id increases. An iteration id of 0 means the navigation map has never synchronized.
  703. \ **Note:** The iteration id will wrap back to 1 after reaching its range limit.
  704. .. rst-class:: classref-item-separator
  705. ----
  706. .. _class_NavigationServer2D_method_map_get_link_connection_radius:
  707. .. rst-class:: classref-method
  708. :ref:`float<class_float>` **map_get_link_connection_radius**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_link_connection_radius>`
  709. Returns the link connection radius of the map. This distance is the maximum range any link will search for navigation mesh polygons to connect to.
  710. .. rst-class:: classref-item-separator
  711. ----
  712. .. _class_NavigationServer2D_method_map_get_links:
  713. .. rst-class:: classref-method
  714. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **map_get_links**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_links>`
  715. Returns all navigation link :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  716. .. rst-class:: classref-item-separator
  717. ----
  718. .. _class_NavigationServer2D_method_map_get_obstacles:
  719. .. rst-class:: classref-method
  720. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **map_get_obstacles**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_obstacles>`
  721. Returns all navigation obstacle :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  722. .. rst-class:: classref-item-separator
  723. ----
  724. .. _class_NavigationServer2D_method_map_get_path:
  725. .. rst-class:: classref-method
  726. :ref:`PackedVector2Array<class_PackedVector2Array>` **map_get_path**\ (\ map\: :ref:`RID<class_RID>`, origin\: :ref:`Vector2<class_Vector2>`, destination\: :ref:`Vector2<class_Vector2>`, optimize\: :ref:`bool<class_bool>`, navigation_layers\: :ref:`int<class_int>` = 1\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_path>`
  727. Returns the navigation path to reach the destination from the origin. ``navigation_layers`` is a bitmask of all region navigation layers that are allowed to be in the path.
  728. .. rst-class:: classref-item-separator
  729. ----
  730. .. _class_NavigationServer2D_method_map_get_random_point:
  731. .. rst-class:: classref-method
  732. :ref:`Vector2<class_Vector2>` **map_get_random_point**\ (\ map\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`, uniformly\: :ref:`bool<class_bool>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_random_point>`
  733. Returns a random position picked from all map region polygons with matching ``navigation_layers``.
  734. If ``uniformly`` is ``true``, all map regions, polygons, and faces are weighted by their surface area (slower).
  735. If ``uniformly`` is ``false``, just a random region and a random polygon are picked (faster).
  736. .. rst-class:: classref-item-separator
  737. ----
  738. .. _class_NavigationServer2D_method_map_get_regions:
  739. .. rst-class:: classref-method
  740. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **map_get_regions**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_regions>`
  741. Returns all navigation regions :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  742. .. rst-class:: classref-item-separator
  743. ----
  744. .. _class_NavigationServer2D_method_map_get_use_edge_connections:
  745. .. rst-class:: classref-method
  746. :ref:`bool<class_bool>` **map_get_use_edge_connections**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_use_edge_connections>`
  747. Returns whether the navigation ``map`` allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
  748. .. rst-class:: classref-item-separator
  749. ----
  750. .. _class_NavigationServer2D_method_map_is_active:
  751. .. rst-class:: classref-method
  752. :ref:`bool<class_bool>` **map_is_active**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_is_active>`
  753. Returns true if the map is active.
  754. .. rst-class:: classref-item-separator
  755. ----
  756. .. _class_NavigationServer2D_method_map_set_active:
  757. .. rst-class:: classref-method
  758. |void| **map_set_active**\ (\ map\: :ref:`RID<class_RID>`, active\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_set_active>`
  759. Sets the map active.
  760. .. rst-class:: classref-item-separator
  761. ----
  762. .. _class_NavigationServer2D_method_map_set_cell_size:
  763. .. rst-class:: classref-method
  764. |void| **map_set_cell_size**\ (\ map\: :ref:`RID<class_RID>`, cell_size\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_set_cell_size>`
  765. Sets the map cell size used to rasterize the navigation mesh vertices. Must match with the cell size of the used navigation meshes.
  766. .. rst-class:: classref-item-separator
  767. ----
  768. .. _class_NavigationServer2D_method_map_set_edge_connection_margin:
  769. .. rst-class:: classref-method
  770. |void| **map_set_edge_connection_margin**\ (\ map\: :ref:`RID<class_RID>`, margin\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_set_edge_connection_margin>`
  771. Set the map edge connection margin used to weld the compatible region edges.
  772. .. rst-class:: classref-item-separator
  773. ----
  774. .. _class_NavigationServer2D_method_map_set_link_connection_radius:
  775. .. rst-class:: classref-method
  776. |void| **map_set_link_connection_radius**\ (\ map\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_set_link_connection_radius>`
  777. Set the map's link connection radius used to connect links to navigation polygons.
  778. .. rst-class:: classref-item-separator
  779. ----
  780. .. _class_NavigationServer2D_method_map_set_use_edge_connections:
  781. .. rst-class:: classref-method
  782. |void| **map_set_use_edge_connections**\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_set_use_edge_connections>`
  783. Set the navigation ``map`` edge connection use. If ``enabled`` is ``true``, the navigation map allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
  784. .. rst-class:: classref-item-separator
  785. ----
  786. .. _class_NavigationServer2D_method_obstacle_create:
  787. .. rst-class:: classref-method
  788. :ref:`RID<class_RID>` **obstacle_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_create>`
  789. Creates a new navigation obstacle.
  790. .. rst-class:: classref-item-separator
  791. ----
  792. .. _class_NavigationServer2D_method_obstacle_get_avoidance_enabled:
  793. .. rst-class:: classref-method
  794. :ref:`bool<class_bool>` **obstacle_get_avoidance_enabled**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_avoidance_enabled>`
  795. Returns ``true`` if the provided ``obstacle`` has avoidance enabled.
  796. .. rst-class:: classref-item-separator
  797. ----
  798. .. _class_NavigationServer2D_method_obstacle_get_avoidance_layers:
  799. .. rst-class:: classref-method
  800. :ref:`int<class_int>` **obstacle_get_avoidance_layers**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_avoidance_layers>`
  801. Returns the ``avoidance_layers`` bitmask of the specified ``obstacle``.
  802. .. rst-class:: classref-item-separator
  803. ----
  804. .. _class_NavigationServer2D_method_obstacle_get_map:
  805. .. rst-class:: classref-method
  806. :ref:`RID<class_RID>` **obstacle_get_map**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_map>`
  807. Returns the navigation map :ref:`RID<class_RID>` the requested ``obstacle`` is currently assigned to.
  808. .. rst-class:: classref-item-separator
  809. ----
  810. .. _class_NavigationServer2D_method_obstacle_get_paused:
  811. .. rst-class:: classref-method
  812. :ref:`bool<class_bool>` **obstacle_get_paused**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_paused>`
  813. Returns ``true`` if the specified ``obstacle`` is paused.
  814. .. rst-class:: classref-item-separator
  815. ----
  816. .. _class_NavigationServer2D_method_obstacle_get_position:
  817. .. rst-class:: classref-method
  818. :ref:`Vector2<class_Vector2>` **obstacle_get_position**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_position>`
  819. Returns the position of the specified ``obstacle`` in world space.
  820. .. rst-class:: classref-item-separator
  821. ----
  822. .. _class_NavigationServer2D_method_obstacle_get_radius:
  823. .. rst-class:: classref-method
  824. :ref:`float<class_float>` **obstacle_get_radius**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_radius>`
  825. Returns the radius of the specified dynamic ``obstacle``.
  826. .. rst-class:: classref-item-separator
  827. ----
  828. .. _class_NavigationServer2D_method_obstacle_get_velocity:
  829. .. rst-class:: classref-method
  830. :ref:`Vector2<class_Vector2>` **obstacle_get_velocity**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_velocity>`
  831. Returns the velocity of the specified dynamic ``obstacle``.
  832. .. rst-class:: classref-item-separator
  833. ----
  834. .. _class_NavigationServer2D_method_obstacle_get_vertices:
  835. .. rst-class:: classref-method
  836. :ref:`PackedVector2Array<class_PackedVector2Array>` **obstacle_get_vertices**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_vertices>`
  837. Returns the outline vertices for the specified ``obstacle``.
  838. .. rst-class:: classref-item-separator
  839. ----
  840. .. _class_NavigationServer2D_method_obstacle_set_avoidance_enabled:
  841. .. rst-class:: classref-method
  842. |void| **obstacle_set_avoidance_enabled**\ (\ obstacle\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_avoidance_enabled>`
  843. If ``enabled`` is ``true``, the provided ``obstacle`` affects avoidance using agents.
  844. .. rst-class:: classref-item-separator
  845. ----
  846. .. _class_NavigationServer2D_method_obstacle_set_avoidance_layers:
  847. .. rst-class:: classref-method
  848. |void| **obstacle_set_avoidance_layers**\ (\ obstacle\: :ref:`RID<class_RID>`, layers\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_avoidance_layers>`
  849. Set the obstacles's ``avoidance_layers`` bitmask.
  850. .. rst-class:: classref-item-separator
  851. ----
  852. .. _class_NavigationServer2D_method_obstacle_set_map:
  853. .. rst-class:: classref-method
  854. |void| **obstacle_set_map**\ (\ obstacle\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_map>`
  855. Sets the navigation map :ref:`RID<class_RID>` for the obstacle.
  856. .. rst-class:: classref-item-separator
  857. ----
  858. .. _class_NavigationServer2D_method_obstacle_set_paused:
  859. .. rst-class:: classref-method
  860. |void| **obstacle_set_paused**\ (\ obstacle\: :ref:`RID<class_RID>`, paused\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_paused>`
  861. If ``paused`` is true the specified ``obstacle`` will not be processed, e.g. affect avoidance velocities.
  862. .. rst-class:: classref-item-separator
  863. ----
  864. .. _class_NavigationServer2D_method_obstacle_set_position:
  865. .. rst-class:: classref-method
  866. |void| **obstacle_set_position**\ (\ obstacle\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_position>`
  867. Sets the position of the obstacle in world space.
  868. .. rst-class:: classref-item-separator
  869. ----
  870. .. _class_NavigationServer2D_method_obstacle_set_radius:
  871. .. rst-class:: classref-method
  872. |void| **obstacle_set_radius**\ (\ obstacle\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_radius>`
  873. Sets the radius of the dynamic obstacle.
  874. .. rst-class:: classref-item-separator
  875. ----
  876. .. _class_NavigationServer2D_method_obstacle_set_velocity:
  877. .. rst-class:: classref-method
  878. |void| **obstacle_set_velocity**\ (\ obstacle\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_velocity>`
  879. Sets ``velocity`` of the dynamic ``obstacle``. Allows other agents to better predict the movement of the dynamic obstacle. Only works in combination with the radius of the obstacle.
  880. .. rst-class:: classref-item-separator
  881. ----
  882. .. _class_NavigationServer2D_method_obstacle_set_vertices:
  883. .. rst-class:: classref-method
  884. |void| **obstacle_set_vertices**\ (\ obstacle\: :ref:`RID<class_RID>`, vertices\: :ref:`PackedVector2Array<class_PackedVector2Array>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_vertices>`
  885. Sets the outline vertices for the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out.
  886. .. rst-class:: classref-item-separator
  887. ----
  888. .. _class_NavigationServer2D_method_parse_source_geometry_data:
  889. .. rst-class:: classref-method
  890. |void| **parse_source_geometry_data**\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`, source_geometry_data\: :ref:`NavigationMeshSourceGeometryData2D<class_NavigationMeshSourceGeometryData2D>`, root_node\: :ref:`Node<class_Node>`, callback\: :ref:`Callable<class_Callable>` = Callable()\ ) :ref:`🔗<class_NavigationServer2D_method_parse_source_geometry_data>`
  891. Parses the :ref:`SceneTree<class_SceneTree>` for source geometry according to the properties of ``navigation_polygon``. Updates the provided ``source_geometry_data`` resource with the resulting data. The resource can then be used to bake a navigation mesh with :ref:`bake_from_source_geometry_data<class_NavigationServer2D_method_bake_from_source_geometry_data>`. After the process is finished the optional ``callback`` will be called.
  892. \ **Note:** This function needs to run on the main thread or with a deferred call as the SceneTree is not thread-safe.
  893. \ **Performance:** While convenient, reading data arrays from :ref:`Mesh<class_Mesh>` resources can affect the frame rate negatively. The data needs to be received from the GPU, stalling the :ref:`RenderingServer<class_RenderingServer>` in the process. For performance prefer the use of e.g. collision shapes or creating the data arrays entirely in code.
  894. .. rst-class:: classref-item-separator
  895. ----
  896. .. _class_NavigationServer2D_method_query_path:
  897. .. rst-class:: classref-method
  898. |void| **query_path**\ (\ parameters\: :ref:`NavigationPathQueryParameters2D<class_NavigationPathQueryParameters2D>`, result\: :ref:`NavigationPathQueryResult2D<class_NavigationPathQueryResult2D>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_query_path>`
  899. Queries a path in a given navigation map. Start and target position and other parameters are defined through :ref:`NavigationPathQueryParameters2D<class_NavigationPathQueryParameters2D>`. Updates the provided :ref:`NavigationPathQueryResult2D<class_NavigationPathQueryResult2D>` result object with the path among other results requested by the query.
  900. .. rst-class:: classref-item-separator
  901. ----
  902. .. _class_NavigationServer2D_method_region_create:
  903. .. rst-class:: classref-method
  904. :ref:`RID<class_RID>` **region_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_region_create>`
  905. Creates a new region.
  906. .. rst-class:: classref-item-separator
  907. ----
  908. .. _class_NavigationServer2D_method_region_get_connection_pathway_end:
  909. .. rst-class:: classref-method
  910. :ref:`Vector2<class_Vector2>` **region_get_connection_pathway_end**\ (\ region\: :ref:`RID<class_RID>`, connection\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_connection_pathway_end>`
  911. Returns the ending point of a connection door. ``connection`` is an index between 0 and the return value of :ref:`region_get_connections_count<class_NavigationServer2D_method_region_get_connections_count>`.
  912. .. rst-class:: classref-item-separator
  913. ----
  914. .. _class_NavigationServer2D_method_region_get_connection_pathway_start:
  915. .. rst-class:: classref-method
  916. :ref:`Vector2<class_Vector2>` **region_get_connection_pathway_start**\ (\ region\: :ref:`RID<class_RID>`, connection\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_connection_pathway_start>`
  917. Returns the starting point of a connection door. ``connection`` is an index between 0 and the return value of :ref:`region_get_connections_count<class_NavigationServer2D_method_region_get_connections_count>`.
  918. .. rst-class:: classref-item-separator
  919. ----
  920. .. _class_NavigationServer2D_method_region_get_connections_count:
  921. .. rst-class:: classref-method
  922. :ref:`int<class_int>` **region_get_connections_count**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_connections_count>`
  923. Returns how many connections this ``region`` has with other regions in the map.
  924. .. rst-class:: classref-item-separator
  925. ----
  926. .. _class_NavigationServer2D_method_region_get_enabled:
  927. .. rst-class:: classref-method
  928. :ref:`bool<class_bool>` **region_get_enabled**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_enabled>`
  929. Returns ``true`` if the specified ``region`` is enabled.
  930. .. rst-class:: classref-item-separator
  931. ----
  932. .. _class_NavigationServer2D_method_region_get_enter_cost:
  933. .. rst-class:: classref-method
  934. :ref:`float<class_float>` **region_get_enter_cost**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_enter_cost>`
  935. Returns the enter cost of this ``region``.
  936. .. rst-class:: classref-item-separator
  937. ----
  938. .. _class_NavigationServer2D_method_region_get_map:
  939. .. rst-class:: classref-method
  940. :ref:`RID<class_RID>` **region_get_map**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_map>`
  941. Returns the navigation map :ref:`RID<class_RID>` the requested ``region`` is currently assigned to.
  942. .. rst-class:: classref-item-separator
  943. ----
  944. .. _class_NavigationServer2D_method_region_get_navigation_layers:
  945. .. rst-class:: classref-method
  946. :ref:`int<class_int>` **region_get_navigation_layers**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_navigation_layers>`
  947. Returns the region's navigation layers.
  948. .. rst-class:: classref-item-separator
  949. ----
  950. .. _class_NavigationServer2D_method_region_get_owner_id:
  951. .. rst-class:: classref-method
  952. :ref:`int<class_int>` **region_get_owner_id**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_owner_id>`
  953. Returns the ``ObjectID`` of the object which manages this region.
  954. .. rst-class:: classref-item-separator
  955. ----
  956. .. _class_NavigationServer2D_method_region_get_random_point:
  957. .. rst-class:: classref-method
  958. :ref:`Vector2<class_Vector2>` **region_get_random_point**\ (\ region\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`, uniformly\: :ref:`bool<class_bool>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_random_point>`
  959. Returns a random position picked from all region polygons with matching ``navigation_layers``.
  960. If ``uniformly`` is ``true``, all region polygons and faces are weighted by their surface area (slower).
  961. If ``uniformly`` is ``false``, just a random polygon and face is picked (faster).
  962. .. rst-class:: classref-item-separator
  963. ----
  964. .. _class_NavigationServer2D_method_region_get_transform:
  965. .. rst-class:: classref-method
  966. :ref:`Transform2D<class_Transform2D>` **region_get_transform**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_transform>`
  967. Returns the global transformation of this ``region``.
  968. .. rst-class:: classref-item-separator
  969. ----
  970. .. _class_NavigationServer2D_method_region_get_travel_cost:
  971. .. rst-class:: classref-method
  972. :ref:`float<class_float>` **region_get_travel_cost**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_travel_cost>`
  973. Returns the travel cost of this ``region``.
  974. .. rst-class:: classref-item-separator
  975. ----
  976. .. _class_NavigationServer2D_method_region_get_use_edge_connections:
  977. .. rst-class:: classref-method
  978. :ref:`bool<class_bool>` **region_get_use_edge_connections**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_use_edge_connections>`
  979. Returns whether the navigation ``region`` is set to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
  980. .. rst-class:: classref-item-separator
  981. ----
  982. .. _class_NavigationServer2D_method_region_owns_point:
  983. .. rst-class:: classref-method
  984. :ref:`bool<class_bool>` **region_owns_point**\ (\ region\: :ref:`RID<class_RID>`, point\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_owns_point>`
  985. Returns ``true`` if the provided ``point`` in world space is currently owned by the provided navigation ``region``. Owned in this context means that one of the region's navigation mesh polygon faces has a possible position at the closest distance to this point compared to all other navigation meshes from other navigation regions that are also registered on the navigation map of the provided region.
  986. If multiple navigation meshes have positions at equal distance the navigation region whose polygons are processed first wins the ownership. Polygons are processed in the same order that navigation regions were registered on the NavigationServer.
  987. \ **Note:** If navigation meshes from different navigation regions overlap (which should be avoided in general) the result might not be what is expected.
  988. .. rst-class:: classref-item-separator
  989. ----
  990. .. _class_NavigationServer2D_method_region_set_enabled:
  991. .. rst-class:: classref-method
  992. |void| **region_set_enabled**\ (\ region\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_enabled>`
  993. If ``enabled`` is ``true`` the specified ``region`` will contribute to its current navigation map.
  994. .. rst-class:: classref-item-separator
  995. ----
  996. .. _class_NavigationServer2D_method_region_set_enter_cost:
  997. .. rst-class:: classref-method
  998. |void| **region_set_enter_cost**\ (\ region\: :ref:`RID<class_RID>`, enter_cost\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_enter_cost>`
  999. Sets the ``enter_cost`` for this ``region``.
  1000. .. rst-class:: classref-item-separator
  1001. ----
  1002. .. _class_NavigationServer2D_method_region_set_map:
  1003. .. rst-class:: classref-method
  1004. |void| **region_set_map**\ (\ region\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_map>`
  1005. Sets the map for the region.
  1006. .. rst-class:: classref-item-separator
  1007. ----
  1008. .. _class_NavigationServer2D_method_region_set_navigation_layers:
  1009. .. rst-class:: classref-method
  1010. |void| **region_set_navigation_layers**\ (\ region\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_navigation_layers>`
  1011. Set the region's navigation layers. This allows selecting regions from a path request (when using :ref:`map_get_path<class_NavigationServer2D_method_map_get_path>`).
  1012. .. rst-class:: classref-item-separator
  1013. ----
  1014. .. _class_NavigationServer2D_method_region_set_navigation_polygon:
  1015. .. rst-class:: classref-method
  1016. |void| **region_set_navigation_polygon**\ (\ region\: :ref:`RID<class_RID>`, navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_navigation_polygon>`
  1017. Sets the ``navigation_polygon`` for the region.
  1018. .. rst-class:: classref-item-separator
  1019. ----
  1020. .. _class_NavigationServer2D_method_region_set_owner_id:
  1021. .. rst-class:: classref-method
  1022. |void| **region_set_owner_id**\ (\ region\: :ref:`RID<class_RID>`, owner_id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_owner_id>`
  1023. Set the ``ObjectID`` of the object which manages this region.
  1024. .. rst-class:: classref-item-separator
  1025. ----
  1026. .. _class_NavigationServer2D_method_region_set_transform:
  1027. .. rst-class:: classref-method
  1028. |void| **region_set_transform**\ (\ region\: :ref:`RID<class_RID>`, transform\: :ref:`Transform2D<class_Transform2D>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_transform>`
  1029. Sets the global transformation for the region.
  1030. .. rst-class:: classref-item-separator
  1031. ----
  1032. .. _class_NavigationServer2D_method_region_set_travel_cost:
  1033. .. rst-class:: classref-method
  1034. |void| **region_set_travel_cost**\ (\ region\: :ref:`RID<class_RID>`, travel_cost\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_travel_cost>`
  1035. Sets the ``travel_cost`` for this ``region``.
  1036. .. rst-class:: classref-item-separator
  1037. ----
  1038. .. _class_NavigationServer2D_method_region_set_use_edge_connections:
  1039. .. rst-class:: classref-method
  1040. |void| **region_set_use_edge_connections**\ (\ region\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_use_edge_connections>`
  1041. If ``enabled`` is ``true``, the navigation ``region`` will use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
  1042. .. rst-class:: classref-item-separator
  1043. ----
  1044. .. _class_NavigationServer2D_method_set_debug_enabled:
  1045. .. rst-class:: classref-method
  1046. |void| **set_debug_enabled**\ (\ enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_set_debug_enabled>`
  1047. If ``true`` enables debug mode on the NavigationServer.
  1048. .. rst-class:: classref-item-separator
  1049. ----
  1050. .. _class_NavigationServer2D_method_simplify_path:
  1051. .. rst-class:: classref-method
  1052. :ref:`PackedVector2Array<class_PackedVector2Array>` **simplify_path**\ (\ path\: :ref:`PackedVector2Array<class_PackedVector2Array>`, epsilon\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_simplify_path>`
  1053. Returns a simplified version of ``path`` with less critical path points removed. The simplification amount is in worlds units and controlled by ``epsilon``. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation.
  1054. Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields".
  1055. .. rst-class:: classref-item-separator
  1056. ----
  1057. .. _class_NavigationServer2D_method_source_geometry_parser_create:
  1058. .. rst-class:: classref-method
  1059. :ref:`RID<class_RID>` **source_geometry_parser_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_source_geometry_parser_create>`
  1060. Creates a new source geometry parser. If a :ref:`Callable<class_Callable>` is set for the parser with :ref:`source_geometry_parser_set_callback<class_NavigationServer2D_method_source_geometry_parser_set_callback>` the callback will be called for every single node that gets parsed whenever :ref:`parse_source_geometry_data<class_NavigationServer2D_method_parse_source_geometry_data>` is used.
  1061. .. rst-class:: classref-item-separator
  1062. ----
  1063. .. _class_NavigationServer2D_method_source_geometry_parser_set_callback:
  1064. .. rst-class:: classref-method
  1065. |void| **source_geometry_parser_set_callback**\ (\ parser\: :ref:`RID<class_RID>`, callback\: :ref:`Callable<class_Callable>`\ ) :ref:`🔗<class_NavigationServer2D_method_source_geometry_parser_set_callback>`
  1066. Sets the ``callback`` :ref:`Callable<class_Callable>` for the specific source geometry ``parser``. The :ref:`Callable<class_Callable>` will receive a call with the following parameters:
  1067. - ``navigation_mesh`` - The :ref:`NavigationPolygon<class_NavigationPolygon>` reference used to define the parse settings. Do NOT edit or add directly to the navigation mesh.
  1068. - ``source_geometry_data`` - The :ref:`NavigationMeshSourceGeometryData2D<class_NavigationMeshSourceGeometryData2D>` reference. Add custom source geometry for navigation mesh baking to this object.
  1069. - ``node`` - The :ref:`Node<class_Node>` that is parsed.
  1070. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1071. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1072. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1073. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1074. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1075. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1076. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  1077. .. |void| replace:: :abbr:`void (No return value.)`