class_navigationserver2d.rst 184 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/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:`int<class_int>` | :ref:`get_process_info<class_NavigationServer2D_method_get_process_info>`\ (\ process_info\: :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>`\ ) |const| |
  111. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`bool<class_bool>` | :ref:`is_baking_navigation_polygon<class_NavigationServer2D_method_is_baking_navigation_polygon>`\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) |const| |
  113. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`RID<class_RID>` | :ref:`link_create<class_NavigationServer2D_method_link_create>`\ (\ ) |
  115. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`bool<class_bool>` | :ref:`link_get_enabled<class_NavigationServer2D_method_link_get_enabled>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  117. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`Vector2<class_Vector2>` | :ref:`link_get_end_position<class_NavigationServer2D_method_link_get_end_position>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  119. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`float<class_float>` | :ref:`link_get_enter_cost<class_NavigationServer2D_method_link_get_enter_cost>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  121. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`int<class_int>` | :ref:`link_get_iteration_id<class_NavigationServer2D_method_link_get_iteration_id>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  123. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`RID<class_RID>` | :ref:`link_get_map<class_NavigationServer2D_method_link_get_map>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  125. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`int<class_int>` | :ref:`link_get_navigation_layers<class_NavigationServer2D_method_link_get_navigation_layers>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  127. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`int<class_int>` | :ref:`link_get_owner_id<class_NavigationServer2D_method_link_get_owner_id>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  129. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`Vector2<class_Vector2>` | :ref:`link_get_start_position<class_NavigationServer2D_method_link_get_start_position>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  131. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`float<class_float>` | :ref:`link_get_travel_cost<class_NavigationServer2D_method_link_get_travel_cost>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  133. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`bool<class_bool>` | :ref:`link_is_bidirectional<class_NavigationServer2D_method_link_is_bidirectional>`\ (\ link\: :ref:`RID<class_RID>`\ ) |const| |
  135. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | |void| | :ref:`link_set_bidirectional<class_NavigationServer2D_method_link_set_bidirectional>`\ (\ link\: :ref:`RID<class_RID>`, bidirectional\: :ref:`bool<class_bool>`\ ) |
  137. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | |void| | :ref:`link_set_enabled<class_NavigationServer2D_method_link_set_enabled>`\ (\ link\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  139. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | |void| | :ref:`link_set_end_position<class_NavigationServer2D_method_link_set_end_position>`\ (\ link\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
  141. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | |void| | :ref:`link_set_enter_cost<class_NavigationServer2D_method_link_set_enter_cost>`\ (\ link\: :ref:`RID<class_RID>`, enter_cost\: :ref:`float<class_float>`\ ) |
  143. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | |void| | :ref:`link_set_map<class_NavigationServer2D_method_link_set_map>`\ (\ link\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) |
  145. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | |void| | :ref:`link_set_navigation_layers<class_NavigationServer2D_method_link_set_navigation_layers>`\ (\ link\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`\ ) |
  147. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | |void| | :ref:`link_set_owner_id<class_NavigationServer2D_method_link_set_owner_id>`\ (\ link\: :ref:`RID<class_RID>`, owner_id\: :ref:`int<class_int>`\ ) |
  149. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | |void| | :ref:`link_set_start_position<class_NavigationServer2D_method_link_set_start_position>`\ (\ link\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
  151. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | |void| | :ref:`link_set_travel_cost<class_NavigationServer2D_method_link_set_travel_cost>`\ (\ link\: :ref:`RID<class_RID>`, travel_cost\: :ref:`float<class_float>`\ ) |
  153. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`RID<class_RID>` | :ref:`map_create<class_NavigationServer2D_method_map_create>`\ (\ ) |
  155. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | |void| | :ref:`map_force_update<class_NavigationServer2D_method_map_force_update>`\ (\ map\: :ref:`RID<class_RID>`\ ) |
  157. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`map_get_agents<class_NavigationServer2D_method_map_get_agents>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  159. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`float<class_float>` | :ref:`map_get_cell_size<class_NavigationServer2D_method_map_get_cell_size>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  161. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :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| |
  163. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :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| |
  165. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`float<class_float>` | :ref:`map_get_edge_connection_margin<class_NavigationServer2D_method_map_get_edge_connection_margin>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  167. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`int<class_int>` | :ref:`map_get_iteration_id<class_NavigationServer2D_method_map_get_iteration_id>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  169. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :ref:`float<class_float>` | :ref:`map_get_link_connection_radius<class_NavigationServer2D_method_map_get_link_connection_radius>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  171. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`map_get_links<class_NavigationServer2D_method_map_get_links>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  173. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`map_get_obstacles<class_NavigationServer2D_method_map_get_obstacles>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  175. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :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\ ) |
  177. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :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| |
  179. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`map_get_regions<class_NavigationServer2D_method_map_get_regions>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  181. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`bool<class_bool>` | :ref:`map_get_use_async_iterations<class_NavigationServer2D_method_map_get_use_async_iterations>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  183. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | :ref:`bool<class_bool>` | :ref:`map_get_use_edge_connections<class_NavigationServer2D_method_map_get_use_edge_connections>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  185. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | :ref:`bool<class_bool>` | :ref:`map_is_active<class_NavigationServer2D_method_map_is_active>`\ (\ map\: :ref:`RID<class_RID>`\ ) |const| |
  187. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | |void| | :ref:`map_set_active<class_NavigationServer2D_method_map_set_active>`\ (\ map\: :ref:`RID<class_RID>`, active\: :ref:`bool<class_bool>`\ ) |
  189. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | |void| | :ref:`map_set_cell_size<class_NavigationServer2D_method_map_set_cell_size>`\ (\ map\: :ref:`RID<class_RID>`, cell_size\: :ref:`float<class_float>`\ ) |
  191. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | |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>`\ ) |
  193. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | |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>`\ ) |
  195. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | |void| | :ref:`map_set_use_async_iterations<class_NavigationServer2D_method_map_set_use_async_iterations>`\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  197. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | |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>`\ ) |
  199. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`RID<class_RID>` | :ref:`obstacle_create<class_NavigationServer2D_method_obstacle_create>`\ (\ ) |
  201. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`bool<class_bool>` | :ref:`obstacle_get_avoidance_enabled<class_NavigationServer2D_method_obstacle_get_avoidance_enabled>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  203. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`int<class_int>` | :ref:`obstacle_get_avoidance_layers<class_NavigationServer2D_method_obstacle_get_avoidance_layers>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  205. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | :ref:`RID<class_RID>` | :ref:`obstacle_get_map<class_NavigationServer2D_method_obstacle_get_map>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  207. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`bool<class_bool>` | :ref:`obstacle_get_paused<class_NavigationServer2D_method_obstacle_get_paused>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  209. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | :ref:`Vector2<class_Vector2>` | :ref:`obstacle_get_position<class_NavigationServer2D_method_obstacle_get_position>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  211. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | :ref:`float<class_float>` | :ref:`obstacle_get_radius<class_NavigationServer2D_method_obstacle_get_radius>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  213. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | :ref:`Vector2<class_Vector2>` | :ref:`obstacle_get_velocity<class_NavigationServer2D_method_obstacle_get_velocity>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  215. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`obstacle_get_vertices<class_NavigationServer2D_method_obstacle_get_vertices>`\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| |
  217. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | |void| | :ref:`obstacle_set_avoidance_enabled<class_NavigationServer2D_method_obstacle_set_avoidance_enabled>`\ (\ obstacle\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  219. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | |void| | :ref:`obstacle_set_avoidance_layers<class_NavigationServer2D_method_obstacle_set_avoidance_layers>`\ (\ obstacle\: :ref:`RID<class_RID>`, layers\: :ref:`int<class_int>`\ ) |
  221. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | |void| | :ref:`obstacle_set_map<class_NavigationServer2D_method_obstacle_set_map>`\ (\ obstacle\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) |
  223. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | |void| | :ref:`obstacle_set_paused<class_NavigationServer2D_method_obstacle_set_paused>`\ (\ obstacle\: :ref:`RID<class_RID>`, paused\: :ref:`bool<class_bool>`\ ) |
  225. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | |void| | :ref:`obstacle_set_position<class_NavigationServer2D_method_obstacle_set_position>`\ (\ obstacle\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
  227. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | |void| | :ref:`obstacle_set_radius<class_NavigationServer2D_method_obstacle_set_radius>`\ (\ obstacle\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) |
  229. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | |void| | :ref:`obstacle_set_velocity<class_NavigationServer2D_method_obstacle_set_velocity>`\ (\ obstacle\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) |
  231. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | |void| | :ref:`obstacle_set_vertices<class_NavigationServer2D_method_obstacle_set_vertices>`\ (\ obstacle\: :ref:`RID<class_RID>`, vertices\: :ref:`PackedVector2Array<class_PackedVector2Array>`\ ) |
  233. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | |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()\ ) |
  235. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | |void| | :ref:`query_path<class_NavigationServer2D_method_query_path>`\ (\ parameters\: :ref:`NavigationPathQueryParameters2D<class_NavigationPathQueryParameters2D>`, result\: :ref:`NavigationPathQueryResult2D<class_NavigationPathQueryResult2D>`, callback\: :ref:`Callable<class_Callable>` = Callable()\ ) |
  237. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | :ref:`RID<class_RID>` | :ref:`region_create<class_NavigationServer2D_method_region_create>`\ (\ ) |
  239. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | :ref:`Rect2<class_Rect2>` | :ref:`region_get_bounds<class_NavigationServer2D_method_region_get_bounds>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  241. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | :ref:`Vector2<class_Vector2>` | :ref:`region_get_closest_point<class_NavigationServer2D_method_region_get_closest_point>`\ (\ region\: :ref:`RID<class_RID>`, to_point\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  243. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | :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| |
  245. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | :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| |
  247. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | :ref:`int<class_int>` | :ref:`region_get_connections_count<class_NavigationServer2D_method_region_get_connections_count>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  249. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | :ref:`bool<class_bool>` | :ref:`region_get_enabled<class_NavigationServer2D_method_region_get_enabled>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  251. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | :ref:`float<class_float>` | :ref:`region_get_enter_cost<class_NavigationServer2D_method_region_get_enter_cost>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  253. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | :ref:`int<class_int>` | :ref:`region_get_iteration_id<class_NavigationServer2D_method_region_get_iteration_id>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  255. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | :ref:`RID<class_RID>` | :ref:`region_get_map<class_NavigationServer2D_method_region_get_map>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  257. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | :ref:`int<class_int>` | :ref:`region_get_navigation_layers<class_NavigationServer2D_method_region_get_navigation_layers>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  259. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | :ref:`int<class_int>` | :ref:`region_get_owner_id<class_NavigationServer2D_method_region_get_owner_id>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  261. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | :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| |
  263. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`Transform2D<class_Transform2D>` | :ref:`region_get_transform<class_NavigationServer2D_method_region_get_transform>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  265. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | :ref:`float<class_float>` | :ref:`region_get_travel_cost<class_NavigationServer2D_method_region_get_travel_cost>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  267. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | :ref:`bool<class_bool>` | :ref:`region_get_use_async_iterations<class_NavigationServer2D_method_region_get_use_async_iterations>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  269. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | :ref:`bool<class_bool>` | :ref:`region_get_use_edge_connections<class_NavigationServer2D_method_region_get_use_edge_connections>`\ (\ region\: :ref:`RID<class_RID>`\ ) |const| |
  271. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :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| |
  273. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | |void| | :ref:`region_set_enabled<class_NavigationServer2D_method_region_set_enabled>`\ (\ region\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  275. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | |void| | :ref:`region_set_enter_cost<class_NavigationServer2D_method_region_set_enter_cost>`\ (\ region\: :ref:`RID<class_RID>`, enter_cost\: :ref:`float<class_float>`\ ) |
  277. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | |void| | :ref:`region_set_map<class_NavigationServer2D_method_region_set_map>`\ (\ region\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) |
  279. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | |void| | :ref:`region_set_navigation_layers<class_NavigationServer2D_method_region_set_navigation_layers>`\ (\ region\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`\ ) |
  281. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | |void| | :ref:`region_set_navigation_polygon<class_NavigationServer2D_method_region_set_navigation_polygon>`\ (\ region\: :ref:`RID<class_RID>`, navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) |
  283. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | |void| | :ref:`region_set_owner_id<class_NavigationServer2D_method_region_set_owner_id>`\ (\ region\: :ref:`RID<class_RID>`, owner_id\: :ref:`int<class_int>`\ ) |
  285. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | |void| | :ref:`region_set_transform<class_NavigationServer2D_method_region_set_transform>`\ (\ region\: :ref:`RID<class_RID>`, transform\: :ref:`Transform2D<class_Transform2D>`\ ) |
  287. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | |void| | :ref:`region_set_travel_cost<class_NavigationServer2D_method_region_set_travel_cost>`\ (\ region\: :ref:`RID<class_RID>`, travel_cost\: :ref:`float<class_float>`\ ) |
  289. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | |void| | :ref:`region_set_use_async_iterations<class_NavigationServer2D_method_region_set_use_async_iterations>`\ (\ region\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) |
  291. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | |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>`\ ) |
  293. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | |void| | :ref:`set_active<class_NavigationServer2D_method_set_active>`\ (\ active\: :ref:`bool<class_bool>`\ ) |
  295. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | |void| | :ref:`set_debug_enabled<class_NavigationServer2D_method_set_debug_enabled>`\ (\ enabled\: :ref:`bool<class_bool>`\ ) |
  297. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`simplify_path<class_NavigationServer2D_method_simplify_path>`\ (\ path\: :ref:`PackedVector2Array<class_PackedVector2Array>`, epsilon\: :ref:`float<class_float>`\ ) |
  299. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | :ref:`RID<class_RID>` | :ref:`source_geometry_parser_create<class_NavigationServer2D_method_source_geometry_parser_create>`\ (\ ) |
  301. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | |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>`\ ) |
  303. +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. .. rst-class:: classref-section-separator
  305. ----
  306. .. rst-class:: classref-descriptions-group
  307. Signals
  308. -------
  309. .. _class_NavigationServer2D_signal_avoidance_debug_changed:
  310. .. rst-class:: classref-signal
  311. **avoidance_debug_changed**\ (\ ) :ref:`🔗<class_NavigationServer2D_signal_avoidance_debug_changed>`
  312. Emitted when avoidance debug settings are changed. Only available in debug builds.
  313. .. rst-class:: classref-item-separator
  314. ----
  315. .. _class_NavigationServer2D_signal_map_changed:
  316. .. rst-class:: classref-signal
  317. **map_changed**\ (\ map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_signal_map_changed>`
  318. Emitted when a navigation map is updated, when a region moves or is modified.
  319. .. rst-class:: classref-item-separator
  320. ----
  321. .. _class_NavigationServer2D_signal_navigation_debug_changed:
  322. .. rst-class:: classref-signal
  323. **navigation_debug_changed**\ (\ ) :ref:`🔗<class_NavigationServer2D_signal_navigation_debug_changed>`
  324. Emitted when navigation debug settings are changed. Only available in debug builds.
  325. .. rst-class:: classref-section-separator
  326. ----
  327. .. rst-class:: classref-descriptions-group
  328. Enumerations
  329. ------------
  330. .. _enum_NavigationServer2D_ProcessInfo:
  331. .. rst-class:: classref-enumeration
  332. enum **ProcessInfo**: :ref:`🔗<enum_NavigationServer2D_ProcessInfo>`
  333. .. _class_NavigationServer2D_constant_INFO_ACTIVE_MAPS:
  334. .. rst-class:: classref-enumeration-constant
  335. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_ACTIVE_MAPS** = ``0``
  336. Constant to get the number of active navigation maps.
  337. .. _class_NavigationServer2D_constant_INFO_REGION_COUNT:
  338. .. rst-class:: classref-enumeration-constant
  339. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_REGION_COUNT** = ``1``
  340. Constant to get the number of active navigation regions.
  341. .. _class_NavigationServer2D_constant_INFO_AGENT_COUNT:
  342. .. rst-class:: classref-enumeration-constant
  343. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_AGENT_COUNT** = ``2``
  344. Constant to get the number of active navigation agents processing avoidance.
  345. .. _class_NavigationServer2D_constant_INFO_LINK_COUNT:
  346. .. rst-class:: classref-enumeration-constant
  347. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_LINK_COUNT** = ``3``
  348. Constant to get the number of active navigation links.
  349. .. _class_NavigationServer2D_constant_INFO_POLYGON_COUNT:
  350. .. rst-class:: classref-enumeration-constant
  351. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_POLYGON_COUNT** = ``4``
  352. Constant to get the number of navigation mesh polygons.
  353. .. _class_NavigationServer2D_constant_INFO_EDGE_COUNT:
  354. .. rst-class:: classref-enumeration-constant
  355. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_EDGE_COUNT** = ``5``
  356. Constant to get the number of navigation mesh polygon edges.
  357. .. _class_NavigationServer2D_constant_INFO_EDGE_MERGE_COUNT:
  358. .. rst-class:: classref-enumeration-constant
  359. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_EDGE_MERGE_COUNT** = ``6``
  360. Constant to get the number of navigation mesh polygon edges that were merged due to edge key overlap.
  361. .. _class_NavigationServer2D_constant_INFO_EDGE_CONNECTION_COUNT:
  362. .. rst-class:: classref-enumeration-constant
  363. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_EDGE_CONNECTION_COUNT** = ``7``
  364. Constant to get the number of navigation mesh polygon edges that are considered connected by edge proximity.
  365. .. _class_NavigationServer2D_constant_INFO_EDGE_FREE_COUNT:
  366. .. rst-class:: classref-enumeration-constant
  367. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_EDGE_FREE_COUNT** = ``8``
  368. Constant to get the number of navigation mesh polygon edges that could not be merged but may be still connected by edge proximity or with links.
  369. .. _class_NavigationServer2D_constant_INFO_OBSTACLE_COUNT:
  370. .. rst-class:: classref-enumeration-constant
  371. :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>` **INFO_OBSTACLE_COUNT** = ``9``
  372. Constant to get the number of active navigation obstacles.
  373. .. rst-class:: classref-section-separator
  374. ----
  375. .. rst-class:: classref-descriptions-group
  376. Method Descriptions
  377. -------------------
  378. .. _class_NavigationServer2D_method_agent_create:
  379. .. rst-class:: classref-method
  380. :ref:`RID<class_RID>` **agent_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_agent_create>`
  381. Creates the agent.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_NavigationServer2D_method_agent_get_avoidance_enabled:
  385. .. rst-class:: classref-method
  386. :ref:`bool<class_bool>` **agent_get_avoidance_enabled**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_avoidance_enabled>`
  387. Return ``true`` if the specified ``agent`` uses avoidance.
  388. .. rst-class:: classref-item-separator
  389. ----
  390. .. _class_NavigationServer2D_method_agent_get_avoidance_layers:
  391. .. rst-class:: classref-method
  392. :ref:`int<class_int>` **agent_get_avoidance_layers**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_avoidance_layers>`
  393. Returns the ``avoidance_layers`` bitmask of the specified ``agent``.
  394. .. rst-class:: classref-item-separator
  395. ----
  396. .. _class_NavigationServer2D_method_agent_get_avoidance_mask:
  397. .. rst-class:: classref-method
  398. :ref:`int<class_int>` **agent_get_avoidance_mask**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_avoidance_mask>`
  399. Returns the ``avoidance_mask`` bitmask of the specified ``agent``.
  400. .. rst-class:: classref-item-separator
  401. ----
  402. .. _class_NavigationServer2D_method_agent_get_avoidance_priority:
  403. .. rst-class:: classref-method
  404. :ref:`float<class_float>` **agent_get_avoidance_priority**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_avoidance_priority>`
  405. Returns the ``avoidance_priority`` of the specified ``agent``.
  406. .. rst-class:: classref-item-separator
  407. ----
  408. .. _class_NavigationServer2D_method_agent_get_map:
  409. .. rst-class:: classref-method
  410. :ref:`RID<class_RID>` **agent_get_map**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_map>`
  411. Returns the navigation map :ref:`RID<class_RID>` the requested ``agent`` is currently assigned to.
  412. .. rst-class:: classref-item-separator
  413. ----
  414. .. _class_NavigationServer2D_method_agent_get_max_neighbors:
  415. .. rst-class:: classref-method
  416. :ref:`int<class_int>` **agent_get_max_neighbors**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_max_neighbors>`
  417. Returns the maximum number of other agents the specified ``agent`` takes into account in the navigation.
  418. .. rst-class:: classref-item-separator
  419. ----
  420. .. _class_NavigationServer2D_method_agent_get_max_speed:
  421. .. rst-class:: classref-method
  422. :ref:`float<class_float>` **agent_get_max_speed**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_max_speed>`
  423. Returns the maximum speed of the specified ``agent``.
  424. .. rst-class:: classref-item-separator
  425. ----
  426. .. _class_NavigationServer2D_method_agent_get_neighbor_distance:
  427. .. rst-class:: classref-method
  428. :ref:`float<class_float>` **agent_get_neighbor_distance**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_neighbor_distance>`
  429. Returns the maximum distance to other agents the specified ``agent`` takes into account in the navigation.
  430. .. rst-class:: classref-item-separator
  431. ----
  432. .. _class_NavigationServer2D_method_agent_get_paused:
  433. .. rst-class:: classref-method
  434. :ref:`bool<class_bool>` **agent_get_paused**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_paused>`
  435. Returns ``true`` if the specified ``agent`` is paused.
  436. .. rst-class:: classref-item-separator
  437. ----
  438. .. _class_NavigationServer2D_method_agent_get_position:
  439. .. rst-class:: classref-method
  440. :ref:`Vector2<class_Vector2>` **agent_get_position**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_position>`
  441. Returns the position of the specified ``agent`` in world space.
  442. .. rst-class:: classref-item-separator
  443. ----
  444. .. _class_NavigationServer2D_method_agent_get_radius:
  445. .. rst-class:: classref-method
  446. :ref:`float<class_float>` **agent_get_radius**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_radius>`
  447. Returns the radius of the specified ``agent``.
  448. .. rst-class:: classref-item-separator
  449. ----
  450. .. _class_NavigationServer2D_method_agent_get_time_horizon_agents:
  451. .. rst-class:: classref-method
  452. :ref:`float<class_float>` **agent_get_time_horizon_agents**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_time_horizon_agents>`
  453. 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.
  454. .. rst-class:: classref-item-separator
  455. ----
  456. .. _class_NavigationServer2D_method_agent_get_time_horizon_obstacles:
  457. .. rst-class:: classref-method
  458. :ref:`float<class_float>` **agent_get_time_horizon_obstacles**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_time_horizon_obstacles>`
  459. 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.
  460. .. rst-class:: classref-item-separator
  461. ----
  462. .. _class_NavigationServer2D_method_agent_get_velocity:
  463. .. rst-class:: classref-method
  464. :ref:`Vector2<class_Vector2>` **agent_get_velocity**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_get_velocity>`
  465. Returns the velocity of the specified ``agent``.
  466. .. rst-class:: classref-item-separator
  467. ----
  468. .. _class_NavigationServer2D_method_agent_has_avoidance_callback:
  469. .. rst-class:: classref-method
  470. :ref:`bool<class_bool>` **agent_has_avoidance_callback**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_has_avoidance_callback>`
  471. Return ``true`` if the specified ``agent`` has an avoidance callback.
  472. .. rst-class:: classref-item-separator
  473. ----
  474. .. _class_NavigationServer2D_method_agent_is_map_changed:
  475. .. rst-class:: classref-method
  476. :ref:`bool<class_bool>` **agent_is_map_changed**\ (\ agent\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_agent_is_map_changed>`
  477. Returns ``true`` if the map got changed the previous frame.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _class_NavigationServer2D_method_agent_set_avoidance_callback:
  481. .. rst-class:: classref-method
  482. |void| **agent_set_avoidance_callback**\ (\ agent\: :ref:`RID<class_RID>`, callback\: :ref:`Callable<class_Callable>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_callback>`
  483. 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.
  484. \ **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>`.
  485. .. rst-class:: classref-item-separator
  486. ----
  487. .. _class_NavigationServer2D_method_agent_set_avoidance_enabled:
  488. .. rst-class:: classref-method
  489. |void| **agent_set_avoidance_enabled**\ (\ agent\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_enabled>`
  490. If ``enabled`` is ``true``, the specified ``agent`` uses avoidance.
  491. .. rst-class:: classref-item-separator
  492. ----
  493. .. _class_NavigationServer2D_method_agent_set_avoidance_layers:
  494. .. rst-class:: classref-method
  495. |void| **agent_set_avoidance_layers**\ (\ agent\: :ref:`RID<class_RID>`, layers\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_layers>`
  496. Set the agent's ``avoidance_layers`` bitmask.
  497. .. rst-class:: classref-item-separator
  498. ----
  499. .. _class_NavigationServer2D_method_agent_set_avoidance_mask:
  500. .. rst-class:: classref-method
  501. |void| **agent_set_avoidance_mask**\ (\ agent\: :ref:`RID<class_RID>`, mask\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_mask>`
  502. Set the agent's ``avoidance_mask`` bitmask.
  503. .. rst-class:: classref-item-separator
  504. ----
  505. .. _class_NavigationServer2D_method_agent_set_avoidance_priority:
  506. .. rst-class:: classref-method
  507. |void| **agent_set_avoidance_priority**\ (\ agent\: :ref:`RID<class_RID>`, priority\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_avoidance_priority>`
  508. Set the agent's ``avoidance_priority`` with a ``priority`` between 0.0 (lowest priority) to 1.0 (highest priority).
  509. 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.
  510. .. rst-class:: classref-item-separator
  511. ----
  512. .. _class_NavigationServer2D_method_agent_set_map:
  513. .. rst-class:: classref-method
  514. |void| **agent_set_map**\ (\ agent\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_map>`
  515. Puts the agent in the map.
  516. .. rst-class:: classref-item-separator
  517. ----
  518. .. _class_NavigationServer2D_method_agent_set_max_neighbors:
  519. .. rst-class:: classref-method
  520. |void| **agent_set_max_neighbors**\ (\ agent\: :ref:`RID<class_RID>`, count\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_max_neighbors>`
  521. 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.
  522. .. rst-class:: classref-item-separator
  523. ----
  524. .. _class_NavigationServer2D_method_agent_set_max_speed:
  525. .. rst-class:: classref-method
  526. |void| **agent_set_max_speed**\ (\ agent\: :ref:`RID<class_RID>`, max_speed\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_max_speed>`
  527. Sets the maximum speed of the agent. Must be positive.
  528. .. rst-class:: classref-item-separator
  529. ----
  530. .. _class_NavigationServer2D_method_agent_set_neighbor_distance:
  531. .. rst-class:: classref-method
  532. |void| **agent_set_neighbor_distance**\ (\ agent\: :ref:`RID<class_RID>`, distance\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_neighbor_distance>`
  533. 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.
  534. .. rst-class:: classref-item-separator
  535. ----
  536. .. _class_NavigationServer2D_method_agent_set_paused:
  537. .. rst-class:: classref-method
  538. |void| **agent_set_paused**\ (\ agent\: :ref:`RID<class_RID>`, paused\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_paused>`
  539. If ``paused`` is ``true`` the specified ``agent`` will not be processed. For example, it will not calculate avoidance velocities or receive avoidance callbacks.
  540. .. rst-class:: classref-item-separator
  541. ----
  542. .. _class_NavigationServer2D_method_agent_set_position:
  543. .. rst-class:: classref-method
  544. |void| **agent_set_position**\ (\ agent\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_position>`
  545. Sets the position of the agent in world space.
  546. .. rst-class:: classref-item-separator
  547. ----
  548. .. _class_NavigationServer2D_method_agent_set_radius:
  549. .. rst-class:: classref-method
  550. |void| **agent_set_radius**\ (\ agent\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_radius>`
  551. Sets the radius of the agent.
  552. .. rst-class:: classref-item-separator
  553. ----
  554. .. _class_NavigationServer2D_method_agent_set_time_horizon_agents:
  555. .. rst-class:: classref-method
  556. |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>`
  557. 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.
  558. .. rst-class:: classref-item-separator
  559. ----
  560. .. _class_NavigationServer2D_method_agent_set_time_horizon_obstacles:
  561. .. rst-class:: classref-method
  562. |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>`
  563. 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.
  564. .. rst-class:: classref-item-separator
  565. ----
  566. .. _class_NavigationServer2D_method_agent_set_velocity:
  567. .. rst-class:: classref-method
  568. |void| **agent_set_velocity**\ (\ agent\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_velocity>`
  569. 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.
  570. .. rst-class:: classref-item-separator
  571. ----
  572. .. _class_NavigationServer2D_method_agent_set_velocity_forced:
  573. .. rst-class:: classref-method
  574. |void| **agent_set_velocity_forced**\ (\ agent\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_agent_set_velocity_forced>`
  575. 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.
  576. .. rst-class:: classref-item-separator
  577. ----
  578. .. _class_NavigationServer2D_method_bake_from_source_geometry_data:
  579. .. rst-class:: classref-method
  580. |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>`
  581. 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.
  582. .. rst-class:: classref-item-separator
  583. ----
  584. .. _class_NavigationServer2D_method_bake_from_source_geometry_data_async:
  585. .. rst-class:: classref-method
  586. |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>`
  587. 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.
  588. .. rst-class:: classref-item-separator
  589. ----
  590. .. _class_NavigationServer2D_method_free_rid:
  591. .. rst-class:: classref-method
  592. |void| **free_rid**\ (\ rid\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_free_rid>`
  593. Destroys the given RID.
  594. .. rst-class:: classref-item-separator
  595. ----
  596. .. _class_NavigationServer2D_method_get_debug_enabled:
  597. .. rst-class:: classref-method
  598. :ref:`bool<class_bool>` **get_debug_enabled**\ (\ ) |const| :ref:`🔗<class_NavigationServer2D_method_get_debug_enabled>`
  599. Returns ``true`` when the NavigationServer has debug enabled.
  600. .. rst-class:: classref-item-separator
  601. ----
  602. .. _class_NavigationServer2D_method_get_maps:
  603. .. rst-class:: classref-method
  604. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **get_maps**\ (\ ) |const| :ref:`🔗<class_NavigationServer2D_method_get_maps>`
  605. 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.
  606. .. rst-class:: classref-item-separator
  607. ----
  608. .. _class_NavigationServer2D_method_get_process_info:
  609. .. rst-class:: classref-method
  610. :ref:`int<class_int>` **get_process_info**\ (\ process_info\: :ref:`ProcessInfo<enum_NavigationServer2D_ProcessInfo>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_get_process_info>`
  611. Returns information about the current state of the NavigationServer.
  612. .. rst-class:: classref-item-separator
  613. ----
  614. .. _class_NavigationServer2D_method_is_baking_navigation_polygon:
  615. .. rst-class:: classref-method
  616. :ref:`bool<class_bool>` **is_baking_navigation_polygon**\ (\ navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_is_baking_navigation_polygon>`
  617. Returns ``true`` when the provided navigation polygon is being baked on a background thread.
  618. .. rst-class:: classref-item-separator
  619. ----
  620. .. _class_NavigationServer2D_method_link_create:
  621. .. rst-class:: classref-method
  622. :ref:`RID<class_RID>` **link_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_link_create>`
  623. Create a new link between two positions on a map.
  624. .. rst-class:: classref-item-separator
  625. ----
  626. .. _class_NavigationServer2D_method_link_get_enabled:
  627. .. rst-class:: classref-method
  628. :ref:`bool<class_bool>` **link_get_enabled**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_enabled>`
  629. Returns ``true`` if the specified ``link`` is enabled.
  630. .. rst-class:: classref-item-separator
  631. ----
  632. .. _class_NavigationServer2D_method_link_get_end_position:
  633. .. rst-class:: classref-method
  634. :ref:`Vector2<class_Vector2>` **link_get_end_position**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_end_position>`
  635. Returns the ending position of this ``link``.
  636. .. rst-class:: classref-item-separator
  637. ----
  638. .. _class_NavigationServer2D_method_link_get_enter_cost:
  639. .. rst-class:: classref-method
  640. :ref:`float<class_float>` **link_get_enter_cost**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_enter_cost>`
  641. Returns the enter cost of this ``link``.
  642. .. rst-class:: classref-item-separator
  643. ----
  644. .. _class_NavigationServer2D_method_link_get_iteration_id:
  645. .. rst-class:: classref-method
  646. :ref:`int<class_int>` **link_get_iteration_id**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_iteration_id>`
  647. Returns the current iteration ID of the navigation link. Every time the navigation link changes and synchronizes, the iteration ID increases. An iteration ID of ``0`` means the navigation link has never synchronized.
  648. \ **Note:** The iteration ID will wrap around to ``1`` after reaching its range limit.
  649. .. rst-class:: classref-item-separator
  650. ----
  651. .. _class_NavigationServer2D_method_link_get_map:
  652. .. rst-class:: classref-method
  653. :ref:`RID<class_RID>` **link_get_map**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_map>`
  654. Returns the navigation map :ref:`RID<class_RID>` the requested ``link`` is currently assigned to.
  655. .. rst-class:: classref-item-separator
  656. ----
  657. .. _class_NavigationServer2D_method_link_get_navigation_layers:
  658. .. rst-class:: classref-method
  659. :ref:`int<class_int>` **link_get_navigation_layers**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_navigation_layers>`
  660. Returns the navigation layers for this ``link``.
  661. .. rst-class:: classref-item-separator
  662. ----
  663. .. _class_NavigationServer2D_method_link_get_owner_id:
  664. .. rst-class:: classref-method
  665. :ref:`int<class_int>` **link_get_owner_id**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_owner_id>`
  666. Returns the ``ObjectID`` of the object which manages this link.
  667. .. rst-class:: classref-item-separator
  668. ----
  669. .. _class_NavigationServer2D_method_link_get_start_position:
  670. .. rst-class:: classref-method
  671. :ref:`Vector2<class_Vector2>` **link_get_start_position**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_start_position>`
  672. Returns the starting position of this ``link``.
  673. .. rst-class:: classref-item-separator
  674. ----
  675. .. _class_NavigationServer2D_method_link_get_travel_cost:
  676. .. rst-class:: classref-method
  677. :ref:`float<class_float>` **link_get_travel_cost**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_get_travel_cost>`
  678. Returns the travel cost of this ``link``.
  679. .. rst-class:: classref-item-separator
  680. ----
  681. .. _class_NavigationServer2D_method_link_is_bidirectional:
  682. .. rst-class:: classref-method
  683. :ref:`bool<class_bool>` **link_is_bidirectional**\ (\ link\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_link_is_bidirectional>`
  684. Returns whether this ``link`` can be travelled in both directions.
  685. .. rst-class:: classref-item-separator
  686. ----
  687. .. _class_NavigationServer2D_method_link_set_bidirectional:
  688. .. rst-class:: classref-method
  689. |void| **link_set_bidirectional**\ (\ link\: :ref:`RID<class_RID>`, bidirectional\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_bidirectional>`
  690. Sets whether this ``link`` can be travelled in both directions.
  691. .. rst-class:: classref-item-separator
  692. ----
  693. .. _class_NavigationServer2D_method_link_set_enabled:
  694. .. rst-class:: classref-method
  695. |void| **link_set_enabled**\ (\ link\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_enabled>`
  696. If ``enabled`` is ``true``, the specified ``link`` will contribute to its current navigation map.
  697. .. rst-class:: classref-item-separator
  698. ----
  699. .. _class_NavigationServer2D_method_link_set_end_position:
  700. .. rst-class:: classref-method
  701. |void| **link_set_end_position**\ (\ link\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_end_position>`
  702. Sets the exit position for the ``link``.
  703. .. rst-class:: classref-item-separator
  704. ----
  705. .. _class_NavigationServer2D_method_link_set_enter_cost:
  706. .. rst-class:: classref-method
  707. |void| **link_set_enter_cost**\ (\ link\: :ref:`RID<class_RID>`, enter_cost\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_enter_cost>`
  708. Sets the ``enter_cost`` for this ``link``.
  709. .. rst-class:: classref-item-separator
  710. ----
  711. .. _class_NavigationServer2D_method_link_set_map:
  712. .. rst-class:: classref-method
  713. |void| **link_set_map**\ (\ link\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_map>`
  714. Sets the navigation map :ref:`RID<class_RID>` for the link.
  715. .. rst-class:: classref-item-separator
  716. ----
  717. .. _class_NavigationServer2D_method_link_set_navigation_layers:
  718. .. rst-class:: classref-method
  719. |void| **link_set_navigation_layers**\ (\ link\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_navigation_layers>`
  720. 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>`).
  721. .. rst-class:: classref-item-separator
  722. ----
  723. .. _class_NavigationServer2D_method_link_set_owner_id:
  724. .. rst-class:: classref-method
  725. |void| **link_set_owner_id**\ (\ link\: :ref:`RID<class_RID>`, owner_id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_owner_id>`
  726. Set the ``ObjectID`` of the object which manages this link.
  727. .. rst-class:: classref-item-separator
  728. ----
  729. .. _class_NavigationServer2D_method_link_set_start_position:
  730. .. rst-class:: classref-method
  731. |void| **link_set_start_position**\ (\ link\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_start_position>`
  732. Sets the entry position for this ``link``.
  733. .. rst-class:: classref-item-separator
  734. ----
  735. .. _class_NavigationServer2D_method_link_set_travel_cost:
  736. .. rst-class:: classref-method
  737. |void| **link_set_travel_cost**\ (\ link\: :ref:`RID<class_RID>`, travel_cost\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_link_set_travel_cost>`
  738. Sets the ``travel_cost`` for this ``link``.
  739. .. rst-class:: classref-item-separator
  740. ----
  741. .. _class_NavigationServer2D_method_map_create:
  742. .. rst-class:: classref-method
  743. :ref:`RID<class_RID>` **map_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_map_create>`
  744. Create a new map.
  745. .. rst-class:: classref-item-separator
  746. ----
  747. .. _class_NavigationServer2D_method_map_force_update:
  748. .. rst-class:: classref-method
  749. |void| **map_force_update**\ (\ map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_force_update>`
  750. **Deprecated:** This method is no longer supported, as it is incompatible with asynchronous updates. It can only be used in a single-threaded context, at your own risk.
  751. 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).
  752. 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.
  753. 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.
  754. \ **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.
  755. .. rst-class:: classref-item-separator
  756. ----
  757. .. _class_NavigationServer2D_method_map_get_agents:
  758. .. rst-class:: classref-method
  759. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **map_get_agents**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_agents>`
  760. Returns all navigation agents :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  761. .. rst-class:: classref-item-separator
  762. ----
  763. .. _class_NavigationServer2D_method_map_get_cell_size:
  764. .. rst-class:: classref-method
  765. :ref:`float<class_float>` **map_get_cell_size**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_cell_size>`
  766. Returns the map cell size used to rasterize the navigation mesh vertices.
  767. .. rst-class:: classref-item-separator
  768. ----
  769. .. _class_NavigationServer2D_method_map_get_closest_point:
  770. .. rst-class:: classref-method
  771. :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>`
  772. Returns the navigation mesh surface point closest to the provided ``to_point`` on the navigation ``map``.
  773. .. rst-class:: classref-item-separator
  774. ----
  775. .. _class_NavigationServer2D_method_map_get_closest_point_owner:
  776. .. rst-class:: classref-method
  777. :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>`
  778. Returns the owner region RID for the navigation mesh surface point closest to the provided ``to_point`` on the navigation ``map``.
  779. .. rst-class:: classref-item-separator
  780. ----
  781. .. _class_NavigationServer2D_method_map_get_edge_connection_margin:
  782. .. rst-class:: classref-method
  783. :ref:`float<class_float>` **map_get_edge_connection_margin**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_edge_connection_margin>`
  784. Returns the edge connection margin of the map. The edge connection margin is a distance used to connect two regions.
  785. .. rst-class:: classref-item-separator
  786. ----
  787. .. _class_NavigationServer2D_method_map_get_iteration_id:
  788. .. rst-class:: classref-method
  789. :ref:`int<class_int>` **map_get_iteration_id**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_iteration_id>`
  790. 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.
  791. \ **Note:** The iteration id will wrap back to 1 after reaching its range limit.
  792. .. rst-class:: classref-item-separator
  793. ----
  794. .. _class_NavigationServer2D_method_map_get_link_connection_radius:
  795. .. rst-class:: classref-method
  796. :ref:`float<class_float>` **map_get_link_connection_radius**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_link_connection_radius>`
  797. 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.
  798. .. rst-class:: classref-item-separator
  799. ----
  800. .. _class_NavigationServer2D_method_map_get_links:
  801. .. rst-class:: classref-method
  802. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **map_get_links**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_links>`
  803. Returns all navigation link :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  804. .. rst-class:: classref-item-separator
  805. ----
  806. .. _class_NavigationServer2D_method_map_get_obstacles:
  807. .. rst-class:: classref-method
  808. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **map_get_obstacles**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_obstacles>`
  809. Returns all navigation obstacle :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  810. .. rst-class:: classref-item-separator
  811. ----
  812. .. _class_NavigationServer2D_method_map_get_path:
  813. .. rst-class:: classref-method
  814. :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\ ) :ref:`🔗<class_NavigationServer2D_method_map_get_path>`
  815. 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.
  816. .. rst-class:: classref-item-separator
  817. ----
  818. .. _class_NavigationServer2D_method_map_get_random_point:
  819. .. rst-class:: classref-method
  820. :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>`
  821. Returns a random position picked from all map region polygons with matching ``navigation_layers``.
  822. If ``uniformly`` is ``true``, all map regions, polygons, and faces are weighted by their surface area (slower).
  823. If ``uniformly`` is ``false``, just a random region and a random polygon are picked (faster).
  824. .. rst-class:: classref-item-separator
  825. ----
  826. .. _class_NavigationServer2D_method_map_get_regions:
  827. .. rst-class:: classref-method
  828. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **map_get_regions**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_regions>`
  829. Returns all navigation regions :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  830. .. rst-class:: classref-item-separator
  831. ----
  832. .. _class_NavigationServer2D_method_map_get_use_async_iterations:
  833. .. rst-class:: classref-method
  834. :ref:`bool<class_bool>` **map_get_use_async_iterations**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_use_async_iterations>`
  835. Returns ``true`` if the ``map`` synchronization uses an async process that runs on a background thread.
  836. .. rst-class:: classref-item-separator
  837. ----
  838. .. _class_NavigationServer2D_method_map_get_use_edge_connections:
  839. .. rst-class:: classref-method
  840. :ref:`bool<class_bool>` **map_get_use_edge_connections**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_get_use_edge_connections>`
  841. 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.
  842. .. rst-class:: classref-item-separator
  843. ----
  844. .. _class_NavigationServer2D_method_map_is_active:
  845. .. rst-class:: classref-method
  846. :ref:`bool<class_bool>` **map_is_active**\ (\ map\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_map_is_active>`
  847. Returns ``true`` if the map is active.
  848. .. rst-class:: classref-item-separator
  849. ----
  850. .. _class_NavigationServer2D_method_map_set_active:
  851. .. rst-class:: classref-method
  852. |void| **map_set_active**\ (\ map\: :ref:`RID<class_RID>`, active\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_set_active>`
  853. Sets the map active.
  854. .. rst-class:: classref-item-separator
  855. ----
  856. .. _class_NavigationServer2D_method_map_set_cell_size:
  857. .. rst-class:: classref-method
  858. |void| **map_set_cell_size**\ (\ map\: :ref:`RID<class_RID>`, cell_size\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_set_cell_size>`
  859. Sets the map cell size used to rasterize the navigation mesh vertices. Must match with the cell size of the used navigation meshes.
  860. .. rst-class:: classref-item-separator
  861. ----
  862. .. _class_NavigationServer2D_method_map_set_edge_connection_margin:
  863. .. rst-class:: classref-method
  864. |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>`
  865. Set the map edge connection margin used to weld the compatible region edges.
  866. .. rst-class:: classref-item-separator
  867. ----
  868. .. _class_NavigationServer2D_method_map_set_link_connection_radius:
  869. .. rst-class:: classref-method
  870. |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>`
  871. Set the map's link connection radius used to connect links to navigation polygons.
  872. .. rst-class:: classref-item-separator
  873. ----
  874. .. _class_NavigationServer2D_method_map_set_use_async_iterations:
  875. .. rst-class:: classref-method
  876. |void| **map_set_use_async_iterations**\ (\ map\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_map_set_use_async_iterations>`
  877. If ``enabled`` is ``true`` the ``map`` synchronization uses an async process that runs on a background thread.
  878. .. rst-class:: classref-item-separator
  879. ----
  880. .. _class_NavigationServer2D_method_map_set_use_edge_connections:
  881. .. rst-class:: classref-method
  882. |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>`
  883. 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.
  884. .. rst-class:: classref-item-separator
  885. ----
  886. .. _class_NavigationServer2D_method_obstacle_create:
  887. .. rst-class:: classref-method
  888. :ref:`RID<class_RID>` **obstacle_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_create>`
  889. Creates a new navigation obstacle.
  890. .. rst-class:: classref-item-separator
  891. ----
  892. .. _class_NavigationServer2D_method_obstacle_get_avoidance_enabled:
  893. .. rst-class:: classref-method
  894. :ref:`bool<class_bool>` **obstacle_get_avoidance_enabled**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_avoidance_enabled>`
  895. Returns ``true`` if the provided ``obstacle`` has avoidance enabled.
  896. .. rst-class:: classref-item-separator
  897. ----
  898. .. _class_NavigationServer2D_method_obstacle_get_avoidance_layers:
  899. .. rst-class:: classref-method
  900. :ref:`int<class_int>` **obstacle_get_avoidance_layers**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_avoidance_layers>`
  901. Returns the ``avoidance_layers`` bitmask of the specified ``obstacle``.
  902. .. rst-class:: classref-item-separator
  903. ----
  904. .. _class_NavigationServer2D_method_obstacle_get_map:
  905. .. rst-class:: classref-method
  906. :ref:`RID<class_RID>` **obstacle_get_map**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_map>`
  907. Returns the navigation map :ref:`RID<class_RID>` the requested ``obstacle`` is currently assigned to.
  908. .. rst-class:: classref-item-separator
  909. ----
  910. .. _class_NavigationServer2D_method_obstacle_get_paused:
  911. .. rst-class:: classref-method
  912. :ref:`bool<class_bool>` **obstacle_get_paused**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_paused>`
  913. Returns ``true`` if the specified ``obstacle`` is paused.
  914. .. rst-class:: classref-item-separator
  915. ----
  916. .. _class_NavigationServer2D_method_obstacle_get_position:
  917. .. rst-class:: classref-method
  918. :ref:`Vector2<class_Vector2>` **obstacle_get_position**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_position>`
  919. Returns the position of the specified ``obstacle`` in world space.
  920. .. rst-class:: classref-item-separator
  921. ----
  922. .. _class_NavigationServer2D_method_obstacle_get_radius:
  923. .. rst-class:: classref-method
  924. :ref:`float<class_float>` **obstacle_get_radius**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_radius>`
  925. Returns the radius of the specified dynamic ``obstacle``.
  926. .. rst-class:: classref-item-separator
  927. ----
  928. .. _class_NavigationServer2D_method_obstacle_get_velocity:
  929. .. rst-class:: classref-method
  930. :ref:`Vector2<class_Vector2>` **obstacle_get_velocity**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_velocity>`
  931. Returns the velocity of the specified dynamic ``obstacle``.
  932. .. rst-class:: classref-item-separator
  933. ----
  934. .. _class_NavigationServer2D_method_obstacle_get_vertices:
  935. .. rst-class:: classref-method
  936. :ref:`PackedVector2Array<class_PackedVector2Array>` **obstacle_get_vertices**\ (\ obstacle\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_obstacle_get_vertices>`
  937. Returns the outline vertices for the specified ``obstacle``.
  938. .. rst-class:: classref-item-separator
  939. ----
  940. .. _class_NavigationServer2D_method_obstacle_set_avoidance_enabled:
  941. .. rst-class:: classref-method
  942. |void| **obstacle_set_avoidance_enabled**\ (\ obstacle\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_avoidance_enabled>`
  943. If ``enabled`` is ``true``, the provided ``obstacle`` affects avoidance using agents.
  944. .. rst-class:: classref-item-separator
  945. ----
  946. .. _class_NavigationServer2D_method_obstacle_set_avoidance_layers:
  947. .. rst-class:: classref-method
  948. |void| **obstacle_set_avoidance_layers**\ (\ obstacle\: :ref:`RID<class_RID>`, layers\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_avoidance_layers>`
  949. Set the obstacles's ``avoidance_layers`` bitmask.
  950. .. rst-class:: classref-item-separator
  951. ----
  952. .. _class_NavigationServer2D_method_obstacle_set_map:
  953. .. rst-class:: classref-method
  954. |void| **obstacle_set_map**\ (\ obstacle\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_map>`
  955. Sets the navigation map :ref:`RID<class_RID>` for the obstacle.
  956. .. rst-class:: classref-item-separator
  957. ----
  958. .. _class_NavigationServer2D_method_obstacle_set_paused:
  959. .. rst-class:: classref-method
  960. |void| **obstacle_set_paused**\ (\ obstacle\: :ref:`RID<class_RID>`, paused\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_paused>`
  961. If ``paused`` is ``true`` the specified ``obstacle`` will not be processed. For example, it will no longer affect avoidance velocities.
  962. .. rst-class:: classref-item-separator
  963. ----
  964. .. _class_NavigationServer2D_method_obstacle_set_position:
  965. .. rst-class:: classref-method
  966. |void| **obstacle_set_position**\ (\ obstacle\: :ref:`RID<class_RID>`, position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_position>`
  967. Sets the position of the obstacle in world space.
  968. .. rst-class:: classref-item-separator
  969. ----
  970. .. _class_NavigationServer2D_method_obstacle_set_radius:
  971. .. rst-class:: classref-method
  972. |void| **obstacle_set_radius**\ (\ obstacle\: :ref:`RID<class_RID>`, radius\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_radius>`
  973. Sets the radius of the dynamic obstacle.
  974. .. rst-class:: classref-item-separator
  975. ----
  976. .. _class_NavigationServer2D_method_obstacle_set_velocity:
  977. .. rst-class:: classref-method
  978. |void| **obstacle_set_velocity**\ (\ obstacle\: :ref:`RID<class_RID>`, velocity\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_velocity>`
  979. 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.
  980. .. rst-class:: classref-item-separator
  981. ----
  982. .. _class_NavigationServer2D_method_obstacle_set_vertices:
  983. .. rst-class:: classref-method
  984. |void| **obstacle_set_vertices**\ (\ obstacle\: :ref:`RID<class_RID>`, vertices\: :ref:`PackedVector2Array<class_PackedVector2Array>`\ ) :ref:`🔗<class_NavigationServer2D_method_obstacle_set_vertices>`
  985. 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.
  986. .. rst-class:: classref-item-separator
  987. ----
  988. .. _class_NavigationServer2D_method_parse_source_geometry_data:
  989. .. rst-class:: classref-method
  990. |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>`
  991. 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.
  992. \ **Note:** This function needs to run on the main thread or with a deferred call as the SceneTree is not thread-safe.
  993. \ **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.
  994. .. rst-class:: classref-item-separator
  995. ----
  996. .. _class_NavigationServer2D_method_query_path:
  997. .. rst-class:: classref-method
  998. |void| **query_path**\ (\ parameters\: :ref:`NavigationPathQueryParameters2D<class_NavigationPathQueryParameters2D>`, result\: :ref:`NavigationPathQueryResult2D<class_NavigationPathQueryResult2D>`, callback\: :ref:`Callable<class_Callable>` = Callable()\ ) :ref:`🔗<class_NavigationServer2D_method_query_path>`
  999. 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. After the process is finished the optional ``callback`` will be called.
  1000. .. rst-class:: classref-item-separator
  1001. ----
  1002. .. _class_NavigationServer2D_method_region_create:
  1003. .. rst-class:: classref-method
  1004. :ref:`RID<class_RID>` **region_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_region_create>`
  1005. Creates a new region.
  1006. .. rst-class:: classref-item-separator
  1007. ----
  1008. .. _class_NavigationServer2D_method_region_get_bounds:
  1009. .. rst-class:: classref-method
  1010. :ref:`Rect2<class_Rect2>` **region_get_bounds**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_bounds>`
  1011. Returns the axis-aligned rectangle for the ``region``'s transformed navigation mesh.
  1012. .. rst-class:: classref-item-separator
  1013. ----
  1014. .. _class_NavigationServer2D_method_region_get_closest_point:
  1015. .. rst-class:: classref-method
  1016. :ref:`Vector2<class_Vector2>` **region_get_closest_point**\ (\ region\: :ref:`RID<class_RID>`, to_point\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_closest_point>`
  1017. Returns the navigation mesh surface point closest to the provided ``to_point`` on the navigation ``region``.
  1018. .. rst-class:: classref-item-separator
  1019. ----
  1020. .. _class_NavigationServer2D_method_region_get_connection_pathway_end:
  1021. .. rst-class:: classref-method
  1022. :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>`
  1023. 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>`.
  1024. .. rst-class:: classref-item-separator
  1025. ----
  1026. .. _class_NavigationServer2D_method_region_get_connection_pathway_start:
  1027. .. rst-class:: classref-method
  1028. :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>`
  1029. 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>`.
  1030. .. rst-class:: classref-item-separator
  1031. ----
  1032. .. _class_NavigationServer2D_method_region_get_connections_count:
  1033. .. rst-class:: classref-method
  1034. :ref:`int<class_int>` **region_get_connections_count**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_connections_count>`
  1035. Returns how many connections this ``region`` has with other regions in the map.
  1036. .. rst-class:: classref-item-separator
  1037. ----
  1038. .. _class_NavigationServer2D_method_region_get_enabled:
  1039. .. rst-class:: classref-method
  1040. :ref:`bool<class_bool>` **region_get_enabled**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_enabled>`
  1041. Returns ``true`` if the specified ``region`` is enabled.
  1042. .. rst-class:: classref-item-separator
  1043. ----
  1044. .. _class_NavigationServer2D_method_region_get_enter_cost:
  1045. .. rst-class:: classref-method
  1046. :ref:`float<class_float>` **region_get_enter_cost**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_enter_cost>`
  1047. Returns the enter cost of this ``region``.
  1048. .. rst-class:: classref-item-separator
  1049. ----
  1050. .. _class_NavigationServer2D_method_region_get_iteration_id:
  1051. .. rst-class:: classref-method
  1052. :ref:`int<class_int>` **region_get_iteration_id**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_iteration_id>`
  1053. Returns the current iteration ID of the navigation region. Every time the navigation region changes and synchronizes, the iteration ID increases. An iteration ID of ``0`` means the navigation region has never synchronized.
  1054. \ **Note:** The iteration ID will wrap around to ``1`` after reaching its range limit.
  1055. .. rst-class:: classref-item-separator
  1056. ----
  1057. .. _class_NavigationServer2D_method_region_get_map:
  1058. .. rst-class:: classref-method
  1059. :ref:`RID<class_RID>` **region_get_map**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_map>`
  1060. Returns the navigation map :ref:`RID<class_RID>` the requested ``region`` is currently assigned to.
  1061. .. rst-class:: classref-item-separator
  1062. ----
  1063. .. _class_NavigationServer2D_method_region_get_navigation_layers:
  1064. .. rst-class:: classref-method
  1065. :ref:`int<class_int>` **region_get_navigation_layers**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_navigation_layers>`
  1066. Returns the region's navigation layers.
  1067. .. rst-class:: classref-item-separator
  1068. ----
  1069. .. _class_NavigationServer2D_method_region_get_owner_id:
  1070. .. rst-class:: classref-method
  1071. :ref:`int<class_int>` **region_get_owner_id**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_owner_id>`
  1072. Returns the ``ObjectID`` of the object which manages this region.
  1073. .. rst-class:: classref-item-separator
  1074. ----
  1075. .. _class_NavigationServer2D_method_region_get_random_point:
  1076. .. rst-class:: classref-method
  1077. :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>`
  1078. Returns a random position picked from all region polygons with matching ``navigation_layers``.
  1079. If ``uniformly`` is ``true``, all region polygons and faces are weighted by their surface area (slower).
  1080. If ``uniformly`` is ``false``, just a random polygon and face is picked (faster).
  1081. .. rst-class:: classref-item-separator
  1082. ----
  1083. .. _class_NavigationServer2D_method_region_get_transform:
  1084. .. rst-class:: classref-method
  1085. :ref:`Transform2D<class_Transform2D>` **region_get_transform**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_transform>`
  1086. Returns the global transformation of this ``region``.
  1087. .. rst-class:: classref-item-separator
  1088. ----
  1089. .. _class_NavigationServer2D_method_region_get_travel_cost:
  1090. .. rst-class:: classref-method
  1091. :ref:`float<class_float>` **region_get_travel_cost**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_travel_cost>`
  1092. Returns the travel cost of this ``region``.
  1093. .. rst-class:: classref-item-separator
  1094. ----
  1095. .. _class_NavigationServer2D_method_region_get_use_async_iterations:
  1096. .. rst-class:: classref-method
  1097. :ref:`bool<class_bool>` **region_get_use_async_iterations**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_use_async_iterations>`
  1098. Returns ``true`` if the ``region`` uses an async synchronization process that runs on a background thread.
  1099. .. rst-class:: classref-item-separator
  1100. ----
  1101. .. _class_NavigationServer2D_method_region_get_use_edge_connections:
  1102. .. rst-class:: classref-method
  1103. :ref:`bool<class_bool>` **region_get_use_edge_connections**\ (\ region\: :ref:`RID<class_RID>`\ ) |const| :ref:`🔗<class_NavigationServer2D_method_region_get_use_edge_connections>`
  1104. 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.
  1105. .. rst-class:: classref-item-separator
  1106. ----
  1107. .. _class_NavigationServer2D_method_region_owns_point:
  1108. .. rst-class:: classref-method
  1109. :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>`
  1110. 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.
  1111. 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.
  1112. \ **Note:** If navigation meshes from different navigation regions overlap (which should be avoided in general) the result might not be what is expected.
  1113. .. rst-class:: classref-item-separator
  1114. ----
  1115. .. _class_NavigationServer2D_method_region_set_enabled:
  1116. .. rst-class:: classref-method
  1117. |void| **region_set_enabled**\ (\ region\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_enabled>`
  1118. If ``enabled`` is ``true`` the specified ``region`` will contribute to its current navigation map.
  1119. .. rst-class:: classref-item-separator
  1120. ----
  1121. .. _class_NavigationServer2D_method_region_set_enter_cost:
  1122. .. rst-class:: classref-method
  1123. |void| **region_set_enter_cost**\ (\ region\: :ref:`RID<class_RID>`, enter_cost\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_enter_cost>`
  1124. Sets the ``enter_cost`` for this ``region``.
  1125. .. rst-class:: classref-item-separator
  1126. ----
  1127. .. _class_NavigationServer2D_method_region_set_map:
  1128. .. rst-class:: classref-method
  1129. |void| **region_set_map**\ (\ region\: :ref:`RID<class_RID>`, map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_map>`
  1130. Sets the map for the region.
  1131. .. rst-class:: classref-item-separator
  1132. ----
  1133. .. _class_NavigationServer2D_method_region_set_navigation_layers:
  1134. .. rst-class:: classref-method
  1135. |void| **region_set_navigation_layers**\ (\ region\: :ref:`RID<class_RID>`, navigation_layers\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_navigation_layers>`
  1136. 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>`).
  1137. .. rst-class:: classref-item-separator
  1138. ----
  1139. .. _class_NavigationServer2D_method_region_set_navigation_polygon:
  1140. .. rst-class:: classref-method
  1141. |void| **region_set_navigation_polygon**\ (\ region\: :ref:`RID<class_RID>`, navigation_polygon\: :ref:`NavigationPolygon<class_NavigationPolygon>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_navigation_polygon>`
  1142. Sets the ``navigation_polygon`` for the region.
  1143. .. rst-class:: classref-item-separator
  1144. ----
  1145. .. _class_NavigationServer2D_method_region_set_owner_id:
  1146. .. rst-class:: classref-method
  1147. |void| **region_set_owner_id**\ (\ region\: :ref:`RID<class_RID>`, owner_id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_owner_id>`
  1148. Set the ``ObjectID`` of the object which manages this region.
  1149. .. rst-class:: classref-item-separator
  1150. ----
  1151. .. _class_NavigationServer2D_method_region_set_transform:
  1152. .. rst-class:: classref-method
  1153. |void| **region_set_transform**\ (\ region\: :ref:`RID<class_RID>`, transform\: :ref:`Transform2D<class_Transform2D>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_transform>`
  1154. Sets the global transformation for the region.
  1155. .. rst-class:: classref-item-separator
  1156. ----
  1157. .. _class_NavigationServer2D_method_region_set_travel_cost:
  1158. .. rst-class:: classref-method
  1159. |void| **region_set_travel_cost**\ (\ region\: :ref:`RID<class_RID>`, travel_cost\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_travel_cost>`
  1160. Sets the ``travel_cost`` for this ``region``.
  1161. .. rst-class:: classref-item-separator
  1162. ----
  1163. .. _class_NavigationServer2D_method_region_set_use_async_iterations:
  1164. .. rst-class:: classref-method
  1165. |void| **region_set_use_async_iterations**\ (\ region\: :ref:`RID<class_RID>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_region_set_use_async_iterations>`
  1166. If ``enabled`` is ``true`` the ``region`` uses an async synchronization process that runs on a background thread.
  1167. .. rst-class:: classref-item-separator
  1168. ----
  1169. .. _class_NavigationServer2D_method_region_set_use_edge_connections:
  1170. .. rst-class:: classref-method
  1171. |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>`
  1172. 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.
  1173. .. rst-class:: classref-item-separator
  1174. ----
  1175. .. _class_NavigationServer2D_method_set_active:
  1176. .. rst-class:: classref-method
  1177. |void| **set_active**\ (\ active\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_set_active>`
  1178. Control activation of this server.
  1179. .. rst-class:: classref-item-separator
  1180. ----
  1181. .. _class_NavigationServer2D_method_set_debug_enabled:
  1182. .. rst-class:: classref-method
  1183. |void| **set_debug_enabled**\ (\ enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationServer2D_method_set_debug_enabled>`
  1184. If ``true`` enables debug mode on the NavigationServer.
  1185. .. rst-class:: classref-item-separator
  1186. ----
  1187. .. _class_NavigationServer2D_method_simplify_path:
  1188. .. rst-class:: classref-method
  1189. :ref:`PackedVector2Array<class_PackedVector2Array>` **simplify_path**\ (\ path\: :ref:`PackedVector2Array<class_PackedVector2Array>`, epsilon\: :ref:`float<class_float>`\ ) :ref:`🔗<class_NavigationServer2D_method_simplify_path>`
  1190. 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.
  1191. 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".
  1192. .. rst-class:: classref-item-separator
  1193. ----
  1194. .. _class_NavigationServer2D_method_source_geometry_parser_create:
  1195. .. rst-class:: classref-method
  1196. :ref:`RID<class_RID>` **source_geometry_parser_create**\ (\ ) :ref:`🔗<class_NavigationServer2D_method_source_geometry_parser_create>`
  1197. 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.
  1198. .. rst-class:: classref-item-separator
  1199. ----
  1200. .. _class_NavigationServer2D_method_source_geometry_parser_set_callback:
  1201. .. rst-class:: classref-method
  1202. |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>`
  1203. 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:
  1204. - ``navigation_mesh`` - The :ref:`NavigationPolygon<class_NavigationPolygon>` reference used to define the parse settings. Do NOT edit or add directly to the navigation mesh.
  1205. - ``source_geometry_data`` - The :ref:`NavigationMeshSourceGeometryData2D<class_NavigationMeshSourceGeometryData2D>` reference. Add custom source geometry for navigation mesh baking to this object.
  1206. - ``node`` - The :ref:`Node<class_Node>` that is parsed.
  1207. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1208. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  1209. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1210. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1211. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1212. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1213. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1214. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  1215. .. |void| replace:: :abbr:`void (No return value.)`