class_navigationserver2d.rst 186 KB

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