class_navigationserver3d.rst 81 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235
  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/NavigationServer3D.xml.
  6. .. _class_NavigationServer3D:
  7. NavigationServer3D
  8. ==================
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Server interface for low-level 3D navigation access
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. NavigationServer3D is the server responsible for all 3D navigation. It handles several objects, namely maps, regions and agents.
  15. Maps are made up of regions, which are made of navigation meshes. Together, they define the navigable areas in the 3D world.
  16. \ **Note:** Most NavigationServer 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 SceneTree or made through scripts.
  17. 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.
  18. You may assign navigation layers to regions with :ref:`region_set_navigation_layers<class_NavigationServer3D_method_region_set_navigation_layers>`, which then can be checked upon when requesting a path with :ref:`map_get_path<class_NavigationServer3D_method_map_get_path>`. This allows allowing or forbidding some areas to 3D objects.
  19. 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.
  20. \ **Note:** The collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine.
  21. 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.
  22. .. rst-class:: classref-introduction-group
  23. Tutorials
  24. ---------
  25. - `3D Navmesh Demo <https://godotengine.org/asset-library/asset/124>`__
  26. - :doc:`Using NavigationServer <../tutorials/navigation/navigation_using_navigationservers>`
  27. .. rst-class:: classref-reftable-group
  28. Methods
  29. -------
  30. .. table::
  31. :widths: auto
  32. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`RID<class_RID>` | :ref:`agent_create<class_NavigationServer3D_method_agent_create>` **(** **)** |
  34. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`RID<class_RID>` | :ref:`agent_get_map<class_NavigationServer3D_method_agent_get_map>` **(** :ref:`RID<class_RID>` agent **)** |const| |
  36. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`agent_is_map_changed<class_NavigationServer3D_method_agent_is_map_changed>` **(** :ref:`RID<class_RID>` agent **)** |const| |
  38. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`agent_set_callback<class_NavigationServer3D_method_agent_set_callback>` **(** :ref:`RID<class_RID>` agent, :ref:`int<class_int>` object_id, :ref:`StringName<class_StringName>` method, :ref:`Variant<class_Variant>` userdata=null **)** |
  40. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`agent_set_map<class_NavigationServer3D_method_agent_set_map>` **(** :ref:`RID<class_RID>` agent, :ref:`RID<class_RID>` map **)** |
  42. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`agent_set_max_neighbors<class_NavigationServer3D_method_agent_set_max_neighbors>` **(** :ref:`RID<class_RID>` agent, :ref:`int<class_int>` count **)** |
  44. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`agent_set_max_speed<class_NavigationServer3D_method_agent_set_max_speed>` **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` max_speed **)** |
  46. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`agent_set_neighbor_distance<class_NavigationServer3D_method_agent_set_neighbor_distance>` **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` distance **)** |
  48. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`agent_set_position<class_NavigationServer3D_method_agent_set_position>` **(** :ref:`RID<class_RID>` agent, :ref:`Vector3<class_Vector3>` position **)** |
  50. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`agent_set_radius<class_NavigationServer3D_method_agent_set_radius>` **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` radius **)** |
  52. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`agent_set_target_velocity<class_NavigationServer3D_method_agent_set_target_velocity>` **(** :ref:`RID<class_RID>` agent, :ref:`Vector3<class_Vector3>` target_velocity **)** |
  54. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`agent_set_time_horizon<class_NavigationServer3D_method_agent_set_time_horizon>` **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` time **)** |
  56. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`agent_set_velocity<class_NavigationServer3D_method_agent_set_velocity>` **(** :ref:`RID<class_RID>` agent, :ref:`Vector3<class_Vector3>` velocity **)** |
  58. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`free_rid<class_NavigationServer3D_method_free_rid>` **(** :ref:`RID<class_RID>` rid **)** |
  60. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`RID[]<class_RID>` | :ref:`get_maps<class_NavigationServer3D_method_get_maps>` **(** **)** |const| |
  62. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`int<class_int>` | :ref:`get_process_info<class_NavigationServer3D_method_get_process_info>` **(** :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` process_info **)** |const| |
  64. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`RID<class_RID>` | :ref:`link_create<class_NavigationServer3D_method_link_create>` **(** **)** |
  66. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Vector3<class_Vector3>` | :ref:`link_get_end_position<class_NavigationServer3D_method_link_get_end_position>` **(** :ref:`RID<class_RID>` link **)** |const| |
  68. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`float<class_float>` | :ref:`link_get_enter_cost<class_NavigationServer3D_method_link_get_enter_cost>` **(** :ref:`RID<class_RID>` link **)** |const| |
  70. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`RID<class_RID>` | :ref:`link_get_map<class_NavigationServer3D_method_link_get_map>` **(** :ref:`RID<class_RID>` link **)** |const| |
  72. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`int<class_int>` | :ref:`link_get_navigation_layers<class_NavigationServer3D_method_link_get_navigation_layers>` **(** :ref:`RID<class_RID>` link **)** |const| |
  74. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`int<class_int>` | :ref:`link_get_owner_id<class_NavigationServer3D_method_link_get_owner_id>` **(** :ref:`RID<class_RID>` link **)** |const| |
  76. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`Vector3<class_Vector3>` | :ref:`link_get_start_position<class_NavigationServer3D_method_link_get_start_position>` **(** :ref:`RID<class_RID>` link **)** |const| |
  78. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`float<class_float>` | :ref:`link_get_travel_cost<class_NavigationServer3D_method_link_get_travel_cost>` **(** :ref:`RID<class_RID>` link **)** |const| |
  80. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`bool<class_bool>` | :ref:`link_is_bidirectional<class_NavigationServer3D_method_link_is_bidirectional>` **(** :ref:`RID<class_RID>` link **)** |const| |
  82. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`link_set_bidirectional<class_NavigationServer3D_method_link_set_bidirectional>` **(** :ref:`RID<class_RID>` link, :ref:`bool<class_bool>` bidirectional **)** |
  84. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`link_set_end_position<class_NavigationServer3D_method_link_set_end_position>` **(** :ref:`RID<class_RID>` link, :ref:`Vector3<class_Vector3>` position **)** |
  86. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`link_set_enter_cost<class_NavigationServer3D_method_link_set_enter_cost>` **(** :ref:`RID<class_RID>` link, :ref:`float<class_float>` enter_cost **)** |
  88. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`link_set_map<class_NavigationServer3D_method_link_set_map>` **(** :ref:`RID<class_RID>` link, :ref:`RID<class_RID>` map **)** |
  90. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`link_set_navigation_layers<class_NavigationServer3D_method_link_set_navigation_layers>` **(** :ref:`RID<class_RID>` link, :ref:`int<class_int>` navigation_layers **)** |
  92. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`link_set_owner_id<class_NavigationServer3D_method_link_set_owner_id>` **(** :ref:`RID<class_RID>` link, :ref:`int<class_int>` owner_id **)** |
  94. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`link_set_start_position<class_NavigationServer3D_method_link_set_start_position>` **(** :ref:`RID<class_RID>` link, :ref:`Vector3<class_Vector3>` position **)** |
  96. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`link_set_travel_cost<class_NavigationServer3D_method_link_set_travel_cost>` **(** :ref:`RID<class_RID>` link, :ref:`float<class_float>` travel_cost **)** |
  98. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`RID<class_RID>` | :ref:`map_create<class_NavigationServer3D_method_map_create>` **(** **)** |
  100. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`map_force_update<class_NavigationServer3D_method_map_force_update>` **(** :ref:`RID<class_RID>` map **)** |
  102. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`RID[]<class_RID>` | :ref:`map_get_agents<class_NavigationServer3D_method_map_get_agents>` **(** :ref:`RID<class_RID>` map **)** |const| |
  104. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`float<class_float>` | :ref:`map_get_cell_size<class_NavigationServer3D_method_map_get_cell_size>` **(** :ref:`RID<class_RID>` map **)** |const| |
  106. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`Vector3<class_Vector3>` | :ref:`map_get_closest_point<class_NavigationServer3D_method_map_get_closest_point>` **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` to_point **)** |const| |
  108. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`Vector3<class_Vector3>` | :ref:`map_get_closest_point_normal<class_NavigationServer3D_method_map_get_closest_point_normal>` **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` to_point **)** |const| |
  110. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`RID<class_RID>` | :ref:`map_get_closest_point_owner<class_NavigationServer3D_method_map_get_closest_point_owner>` **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` to_point **)** |const| |
  112. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`Vector3<class_Vector3>` | :ref:`map_get_closest_point_to_segment<class_NavigationServer3D_method_map_get_closest_point_to_segment>` **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` start, :ref:`Vector3<class_Vector3>` end, :ref:`bool<class_bool>` use_collision=false **)** |const| |
  114. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`float<class_float>` | :ref:`map_get_edge_connection_margin<class_NavigationServer3D_method_map_get_edge_connection_margin>` **(** :ref:`RID<class_RID>` map **)** |const| |
  116. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`float<class_float>` | :ref:`map_get_link_connection_radius<class_NavigationServer3D_method_map_get_link_connection_radius>` **(** :ref:`RID<class_RID>` map **)** |const| |
  118. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`RID[]<class_RID>` | :ref:`map_get_links<class_NavigationServer3D_method_map_get_links>` **(** :ref:`RID<class_RID>` map **)** |const| |
  120. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`PackedVector3Array<class_PackedVector3Array>` | :ref:`map_get_path<class_NavigationServer3D_method_map_get_path>` **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` origin, :ref:`Vector3<class_Vector3>` destination, :ref:`bool<class_bool>` optimize, :ref:`int<class_int>` navigation_layers=1 **)** |const| |
  122. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`RID[]<class_RID>` | :ref:`map_get_regions<class_NavigationServer3D_method_map_get_regions>` **(** :ref:`RID<class_RID>` map **)** |const| |
  124. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`Vector3<class_Vector3>` | :ref:`map_get_up<class_NavigationServer3D_method_map_get_up>` **(** :ref:`RID<class_RID>` map **)** |const| |
  126. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`bool<class_bool>` | :ref:`map_is_active<class_NavigationServer3D_method_map_is_active>` **(** :ref:`RID<class_RID>` map **)** |const| |
  128. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`map_set_active<class_NavigationServer3D_method_map_set_active>` **(** :ref:`RID<class_RID>` map, :ref:`bool<class_bool>` active **)** |
  130. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`map_set_cell_size<class_NavigationServer3D_method_map_set_cell_size>` **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` cell_size **)** |
  132. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`map_set_edge_connection_margin<class_NavigationServer3D_method_map_set_edge_connection_margin>` **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` margin **)** |
  134. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`map_set_link_connection_radius<class_NavigationServer3D_method_map_set_link_connection_radius>` **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` radius **)** |
  136. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`map_set_up<class_NavigationServer3D_method_map_set_up>` **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` up **)** |
  138. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`process<class_NavigationServer3D_method_process>` **(** :ref:`float<class_float>` delta_time **)** |
  140. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`query_path<class_NavigationServer3D_method_query_path>` **(** :ref:`NavigationPathQueryParameters3D<class_NavigationPathQueryParameters3D>` parameters, :ref:`NavigationPathQueryResult3D<class_NavigationPathQueryResult3D>` result **)** |const| |
  142. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`region_bake_navigation_mesh<class_NavigationServer3D_method_region_bake_navigation_mesh>` **(** :ref:`NavigationMesh<class_NavigationMesh>` navigation_mesh, :ref:`Node<class_Node>` root_node **)** |
  144. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`RID<class_RID>` | :ref:`region_create<class_NavigationServer3D_method_region_create>` **(** **)** |
  146. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`Vector3<class_Vector3>` | :ref:`region_get_connection_pathway_end<class_NavigationServer3D_method_region_get_connection_pathway_end>` **(** :ref:`RID<class_RID>` region, :ref:`int<class_int>` connection **)** |const| |
  148. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`Vector3<class_Vector3>` | :ref:`region_get_connection_pathway_start<class_NavigationServer3D_method_region_get_connection_pathway_start>` **(** :ref:`RID<class_RID>` region, :ref:`int<class_int>` connection **)** |const| |
  150. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`int<class_int>` | :ref:`region_get_connections_count<class_NavigationServer3D_method_region_get_connections_count>` **(** :ref:`RID<class_RID>` region **)** |const| |
  152. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`float<class_float>` | :ref:`region_get_enter_cost<class_NavigationServer3D_method_region_get_enter_cost>` **(** :ref:`RID<class_RID>` region **)** |const| |
  154. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`RID<class_RID>` | :ref:`region_get_map<class_NavigationServer3D_method_region_get_map>` **(** :ref:`RID<class_RID>` region **)** |const| |
  156. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`int<class_int>` | :ref:`region_get_navigation_layers<class_NavigationServer3D_method_region_get_navigation_layers>` **(** :ref:`RID<class_RID>` region **)** |const| |
  158. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :ref:`int<class_int>` | :ref:`region_get_owner_id<class_NavigationServer3D_method_region_get_owner_id>` **(** :ref:`RID<class_RID>` region **)** |const| |
  160. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :ref:`float<class_float>` | :ref:`region_get_travel_cost<class_NavigationServer3D_method_region_get_travel_cost>` **(** :ref:`RID<class_RID>` region **)** |const| |
  162. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`bool<class_bool>` | :ref:`region_owns_point<class_NavigationServer3D_method_region_owns_point>` **(** :ref:`RID<class_RID>` region, :ref:`Vector3<class_Vector3>` point **)** |const| |
  164. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | void | :ref:`region_set_enter_cost<class_NavigationServer3D_method_region_set_enter_cost>` **(** :ref:`RID<class_RID>` region, :ref:`float<class_float>` enter_cost **)** |
  166. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | void | :ref:`region_set_map<class_NavigationServer3D_method_region_set_map>` **(** :ref:`RID<class_RID>` region, :ref:`RID<class_RID>` map **)** |
  168. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | void | :ref:`region_set_navigation_layers<class_NavigationServer3D_method_region_set_navigation_layers>` **(** :ref:`RID<class_RID>` region, :ref:`int<class_int>` navigation_layers **)** |
  170. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | void | :ref:`region_set_navigation_mesh<class_NavigationServer3D_method_region_set_navigation_mesh>` **(** :ref:`RID<class_RID>` region, :ref:`NavigationMesh<class_NavigationMesh>` navigation_mesh **)** |
  172. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | void | :ref:`region_set_owner_id<class_NavigationServer3D_method_region_set_owner_id>` **(** :ref:`RID<class_RID>` region, :ref:`int<class_int>` owner_id **)** |
  174. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | void | :ref:`region_set_transform<class_NavigationServer3D_method_region_set_transform>` **(** :ref:`RID<class_RID>` region, :ref:`Transform3D<class_Transform3D>` transform **)** |
  176. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | void | :ref:`region_set_travel_cost<class_NavigationServer3D_method_region_set_travel_cost>` **(** :ref:`RID<class_RID>` region, :ref:`float<class_float>` travel_cost **)** |
  178. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | void | :ref:`set_active<class_NavigationServer3D_method_set_active>` **(** :ref:`bool<class_bool>` active **)** |
  180. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. .. rst-class:: classref-section-separator
  182. ----
  183. .. rst-class:: classref-descriptions-group
  184. Signals
  185. -------
  186. .. _class_NavigationServer3D_signal_map_changed:
  187. .. rst-class:: classref-signal
  188. **map_changed** **(** :ref:`RID<class_RID>` map **)**
  189. Emitted when a navigation map is updated, when a region moves or is modified.
  190. .. rst-class:: classref-item-separator
  191. ----
  192. .. _class_NavigationServer3D_signal_navigation_debug_changed:
  193. .. rst-class:: classref-signal
  194. **navigation_debug_changed** **(** **)**
  195. Emitted when navigation debug settings are changed. Only available in debug builds.
  196. .. rst-class:: classref-section-separator
  197. ----
  198. .. rst-class:: classref-descriptions-group
  199. Enumerations
  200. ------------
  201. .. _enum_NavigationServer3D_ProcessInfo:
  202. .. rst-class:: classref-enumeration
  203. enum **ProcessInfo**:
  204. .. _class_NavigationServer3D_constant_INFO_ACTIVE_MAPS:
  205. .. rst-class:: classref-enumeration-constant
  206. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_ACTIVE_MAPS** = ``0``
  207. Constant to get the number of active navigation maps.
  208. .. _class_NavigationServer3D_constant_INFO_REGION_COUNT:
  209. .. rst-class:: classref-enumeration-constant
  210. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_REGION_COUNT** = ``1``
  211. Constant to get the number of active navigation regions.
  212. .. _class_NavigationServer3D_constant_INFO_AGENT_COUNT:
  213. .. rst-class:: classref-enumeration-constant
  214. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_AGENT_COUNT** = ``2``
  215. Constant to get the number of active navigation agents processing avoidance.
  216. .. _class_NavigationServer3D_constant_INFO_LINK_COUNT:
  217. .. rst-class:: classref-enumeration-constant
  218. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_LINK_COUNT** = ``3``
  219. Constant to get the number of active navigation links.
  220. .. _class_NavigationServer3D_constant_INFO_POLYGON_COUNT:
  221. .. rst-class:: classref-enumeration-constant
  222. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_POLYGON_COUNT** = ``4``
  223. Constant to get the number of navigation mesh polygons.
  224. .. _class_NavigationServer3D_constant_INFO_EDGE_COUNT:
  225. .. rst-class:: classref-enumeration-constant
  226. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_EDGE_COUNT** = ``5``
  227. Constant to get the number of navigation mesh polygon edges.
  228. .. _class_NavigationServer3D_constant_INFO_EDGE_MERGE_COUNT:
  229. .. rst-class:: classref-enumeration-constant
  230. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_EDGE_MERGE_COUNT** = ``6``
  231. Constant to get the number of navigation mesh polygon edges that were merged due to edge key overlap.
  232. .. _class_NavigationServer3D_constant_INFO_EDGE_CONNECTION_COUNT:
  233. .. rst-class:: classref-enumeration-constant
  234. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_EDGE_CONNECTION_COUNT** = ``7``
  235. Constant to get the number of navigation mesh polygon edges that are considered connected by edge proximity.
  236. .. _class_NavigationServer3D_constant_INFO_EDGE_FREE_COUNT:
  237. .. rst-class:: classref-enumeration-constant
  238. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_EDGE_FREE_COUNT** = ``8``
  239. 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.
  240. .. rst-class:: classref-section-separator
  241. ----
  242. .. rst-class:: classref-descriptions-group
  243. Method Descriptions
  244. -------------------
  245. .. _class_NavigationServer3D_method_agent_create:
  246. .. rst-class:: classref-method
  247. :ref:`RID<class_RID>` **agent_create** **(** **)**
  248. Creates the agent.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_NavigationServer3D_method_agent_get_map:
  252. .. rst-class:: classref-method
  253. :ref:`RID<class_RID>` **agent_get_map** **(** :ref:`RID<class_RID>` agent **)** |const|
  254. Returns the navigation map :ref:`RID<class_RID>` the requested ``agent`` is currently assigned to.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_NavigationServer3D_method_agent_is_map_changed:
  258. .. rst-class:: classref-method
  259. :ref:`bool<class_bool>` **agent_is_map_changed** **(** :ref:`RID<class_RID>` agent **)** |const|
  260. Returns true if the map got changed the previous frame.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_NavigationServer3D_method_agent_set_callback:
  264. .. rst-class:: classref-method
  265. void **agent_set_callback** **(** :ref:`RID<class_RID>` agent, :ref:`int<class_int>` object_id, :ref:`StringName<class_StringName>` method, :ref:`Variant<class_Variant>` userdata=null **)**
  266. Sets the callback ``object_id`` and ``method`` 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.
  267. \ **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_callback<class_NavigationServer3D_method_agent_set_callback>` again with a ``0`` ObjectID as the ``object_id``.
  268. .. rst-class:: classref-item-separator
  269. ----
  270. .. _class_NavigationServer3D_method_agent_set_map:
  271. .. rst-class:: classref-method
  272. void **agent_set_map** **(** :ref:`RID<class_RID>` agent, :ref:`RID<class_RID>` map **)**
  273. Puts the agent in the map.
  274. .. rst-class:: classref-item-separator
  275. ----
  276. .. _class_NavigationServer3D_method_agent_set_max_neighbors:
  277. .. rst-class:: classref-method
  278. void **agent_set_max_neighbors** **(** :ref:`RID<class_RID>` agent, :ref:`int<class_int>` count **)**
  279. 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.
  280. .. rst-class:: classref-item-separator
  281. ----
  282. .. _class_NavigationServer3D_method_agent_set_max_speed:
  283. .. rst-class:: classref-method
  284. void **agent_set_max_speed** **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` max_speed **)**
  285. Sets the maximum speed of the agent. Must be positive.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_NavigationServer3D_method_agent_set_neighbor_distance:
  289. .. rst-class:: classref-method
  290. void **agent_set_neighbor_distance** **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` distance **)**
  291. 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.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_NavigationServer3D_method_agent_set_position:
  295. .. rst-class:: classref-method
  296. void **agent_set_position** **(** :ref:`RID<class_RID>` agent, :ref:`Vector3<class_Vector3>` position **)**
  297. Sets the position of the agent in world space.
  298. .. rst-class:: classref-item-separator
  299. ----
  300. .. _class_NavigationServer3D_method_agent_set_radius:
  301. .. rst-class:: classref-method
  302. void **agent_set_radius** **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` radius **)**
  303. Sets the radius of the agent.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_NavigationServer3D_method_agent_set_target_velocity:
  307. .. rst-class:: classref-method
  308. void **agent_set_target_velocity** **(** :ref:`RID<class_RID>` agent, :ref:`Vector3<class_Vector3>` target_velocity **)**
  309. Sets the new target velocity.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_NavigationServer3D_method_agent_set_time_horizon:
  313. .. rst-class:: classref-method
  314. void **agent_set_time_horizon** **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` time **)**
  315. 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. Must be positive.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_NavigationServer3D_method_agent_set_velocity:
  319. .. rst-class:: classref-method
  320. void **agent_set_velocity** **(** :ref:`RID<class_RID>` agent, :ref:`Vector3<class_Vector3>` velocity **)**
  321. Sets the current velocity of the agent.
  322. .. rst-class:: classref-item-separator
  323. ----
  324. .. _class_NavigationServer3D_method_free_rid:
  325. .. rst-class:: classref-method
  326. void **free_rid** **(** :ref:`RID<class_RID>` rid **)**
  327. Destroys the given RID.
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_NavigationServer3D_method_get_maps:
  331. .. rst-class:: classref-method
  332. :ref:`RID[]<class_RID>` **get_maps** **(** **)** |const|
  333. 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.
  334. .. rst-class:: classref-item-separator
  335. ----
  336. .. _class_NavigationServer3D_method_get_process_info:
  337. .. rst-class:: classref-method
  338. :ref:`int<class_int>` **get_process_info** **(** :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` process_info **)** |const|
  339. Returns information about the current state of the NavigationServer. See :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` for a list of available states.
  340. .. rst-class:: classref-item-separator
  341. ----
  342. .. _class_NavigationServer3D_method_link_create:
  343. .. rst-class:: classref-method
  344. :ref:`RID<class_RID>` **link_create** **(** **)**
  345. Create a new link between two positions on a map.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_NavigationServer3D_method_link_get_end_position:
  349. .. rst-class:: classref-method
  350. :ref:`Vector3<class_Vector3>` **link_get_end_position** **(** :ref:`RID<class_RID>` link **)** |const|
  351. Returns the ending position of this ``link``.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_NavigationServer3D_method_link_get_enter_cost:
  355. .. rst-class:: classref-method
  356. :ref:`float<class_float>` **link_get_enter_cost** **(** :ref:`RID<class_RID>` link **)** |const|
  357. Returns the ``enter_cost`` of this ``link``.
  358. .. rst-class:: classref-item-separator
  359. ----
  360. .. _class_NavigationServer3D_method_link_get_map:
  361. .. rst-class:: classref-method
  362. :ref:`RID<class_RID>` **link_get_map** **(** :ref:`RID<class_RID>` link **)** |const|
  363. Returns the navigation map :ref:`RID<class_RID>` the requested ``link`` is currently assigned to.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_NavigationServer3D_method_link_get_navigation_layers:
  367. .. rst-class:: classref-method
  368. :ref:`int<class_int>` **link_get_navigation_layers** **(** :ref:`RID<class_RID>` link **)** |const|
  369. Returns the navigation layers for this ``link``.
  370. .. rst-class:: classref-item-separator
  371. ----
  372. .. _class_NavigationServer3D_method_link_get_owner_id:
  373. .. rst-class:: classref-method
  374. :ref:`int<class_int>` **link_get_owner_id** **(** :ref:`RID<class_RID>` link **)** |const|
  375. Returns the ``ObjectID`` of the object which manages this link.
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_NavigationServer3D_method_link_get_start_position:
  379. .. rst-class:: classref-method
  380. :ref:`Vector3<class_Vector3>` **link_get_start_position** **(** :ref:`RID<class_RID>` link **)** |const|
  381. Returns the starting position of this ``link``.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_NavigationServer3D_method_link_get_travel_cost:
  385. .. rst-class:: classref-method
  386. :ref:`float<class_float>` **link_get_travel_cost** **(** :ref:`RID<class_RID>` link **)** |const|
  387. Returns the ``travel_cost`` of this ``link``.
  388. .. rst-class:: classref-item-separator
  389. ----
  390. .. _class_NavigationServer3D_method_link_is_bidirectional:
  391. .. rst-class:: classref-method
  392. :ref:`bool<class_bool>` **link_is_bidirectional** **(** :ref:`RID<class_RID>` link **)** |const|
  393. Returns whether this ``link`` can be travelled in both directions.
  394. .. rst-class:: classref-item-separator
  395. ----
  396. .. _class_NavigationServer3D_method_link_set_bidirectional:
  397. .. rst-class:: classref-method
  398. void **link_set_bidirectional** **(** :ref:`RID<class_RID>` link, :ref:`bool<class_bool>` bidirectional **)**
  399. Sets whether this ``link`` can be travelled in both directions.
  400. .. rst-class:: classref-item-separator
  401. ----
  402. .. _class_NavigationServer3D_method_link_set_end_position:
  403. .. rst-class:: classref-method
  404. void **link_set_end_position** **(** :ref:`RID<class_RID>` link, :ref:`Vector3<class_Vector3>` position **)**
  405. Sets the exit position for the ``link``.
  406. .. rst-class:: classref-item-separator
  407. ----
  408. .. _class_NavigationServer3D_method_link_set_enter_cost:
  409. .. rst-class:: classref-method
  410. void **link_set_enter_cost** **(** :ref:`RID<class_RID>` link, :ref:`float<class_float>` enter_cost **)**
  411. Sets the ``enter_cost`` for this ``link``.
  412. .. rst-class:: classref-item-separator
  413. ----
  414. .. _class_NavigationServer3D_method_link_set_map:
  415. .. rst-class:: classref-method
  416. void **link_set_map** **(** :ref:`RID<class_RID>` link, :ref:`RID<class_RID>` map **)**
  417. Sets the navigation map :ref:`RID<class_RID>` for the link.
  418. .. rst-class:: classref-item-separator
  419. ----
  420. .. _class_NavigationServer3D_method_link_set_navigation_layers:
  421. .. rst-class:: classref-method
  422. void **link_set_navigation_layers** **(** :ref:`RID<class_RID>` link, :ref:`int<class_int>` navigation_layers **)**
  423. Set the links's navigation layers. This allows selecting links from a path request (when using :ref:`map_get_path<class_NavigationServer3D_method_map_get_path>`).
  424. .. rst-class:: classref-item-separator
  425. ----
  426. .. _class_NavigationServer3D_method_link_set_owner_id:
  427. .. rst-class:: classref-method
  428. void **link_set_owner_id** **(** :ref:`RID<class_RID>` link, :ref:`int<class_int>` owner_id **)**
  429. Set the ``ObjectID`` of the object which manages this link.
  430. .. rst-class:: classref-item-separator
  431. ----
  432. .. _class_NavigationServer3D_method_link_set_start_position:
  433. .. rst-class:: classref-method
  434. void **link_set_start_position** **(** :ref:`RID<class_RID>` link, :ref:`Vector3<class_Vector3>` position **)**
  435. Sets the entry position for this ``link``.
  436. .. rst-class:: classref-item-separator
  437. ----
  438. .. _class_NavigationServer3D_method_link_set_travel_cost:
  439. .. rst-class:: classref-method
  440. void **link_set_travel_cost** **(** :ref:`RID<class_RID>` link, :ref:`float<class_float>` travel_cost **)**
  441. Sets the ``travel_cost`` for this ``link``.
  442. .. rst-class:: classref-item-separator
  443. ----
  444. .. _class_NavigationServer3D_method_map_create:
  445. .. rst-class:: classref-method
  446. :ref:`RID<class_RID>` **map_create** **(** **)**
  447. Create a new map.
  448. .. rst-class:: classref-item-separator
  449. ----
  450. .. _class_NavigationServer3D_method_map_force_update:
  451. .. rst-class:: classref-method
  452. void **map_force_update** **(** :ref:`RID<class_RID>` map **)**
  453. 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).
  454. 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.
  455. Avoidance processing and dispatch of the ``safe_velocity`` signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame.
  456. \ **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.
  457. .. rst-class:: classref-item-separator
  458. ----
  459. .. _class_NavigationServer3D_method_map_get_agents:
  460. .. rst-class:: classref-method
  461. :ref:`RID[]<class_RID>` **map_get_agents** **(** :ref:`RID<class_RID>` map **)** |const|
  462. Returns all navigation agents :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  463. .. rst-class:: classref-item-separator
  464. ----
  465. .. _class_NavigationServer3D_method_map_get_cell_size:
  466. .. rst-class:: classref-method
  467. :ref:`float<class_float>` **map_get_cell_size** **(** :ref:`RID<class_RID>` map **)** |const|
  468. Returns the map cell size.
  469. .. rst-class:: classref-item-separator
  470. ----
  471. .. _class_NavigationServer3D_method_map_get_closest_point:
  472. .. rst-class:: classref-method
  473. :ref:`Vector3<class_Vector3>` **map_get_closest_point** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` to_point **)** |const|
  474. Returns the point closest to the provided ``to_point`` on the navigation mesh surface.
  475. .. rst-class:: classref-item-separator
  476. ----
  477. .. _class_NavigationServer3D_method_map_get_closest_point_normal:
  478. .. rst-class:: classref-method
  479. :ref:`Vector3<class_Vector3>` **map_get_closest_point_normal** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` to_point **)** |const|
  480. Returns the normal for the point returned by :ref:`map_get_closest_point<class_NavigationServer3D_method_map_get_closest_point>`.
  481. .. rst-class:: classref-item-separator
  482. ----
  483. .. _class_NavigationServer3D_method_map_get_closest_point_owner:
  484. .. rst-class:: classref-method
  485. :ref:`RID<class_RID>` **map_get_closest_point_owner** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` to_point **)** |const|
  486. Returns the owner region RID for the point returned by :ref:`map_get_closest_point<class_NavigationServer3D_method_map_get_closest_point>`.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_NavigationServer3D_method_map_get_closest_point_to_segment:
  490. .. rst-class:: classref-method
  491. :ref:`Vector3<class_Vector3>` **map_get_closest_point_to_segment** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` start, :ref:`Vector3<class_Vector3>` end, :ref:`bool<class_bool>` use_collision=false **)** |const|
  492. Returns the closest point between the navigation surface and the segment.
  493. .. rst-class:: classref-item-separator
  494. ----
  495. .. _class_NavigationServer3D_method_map_get_edge_connection_margin:
  496. .. rst-class:: classref-method
  497. :ref:`float<class_float>` **map_get_edge_connection_margin** **(** :ref:`RID<class_RID>` map **)** |const|
  498. Returns the edge connection margin of the map. This distance is the minimum vertex distance needed to connect two edges from different regions.
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _class_NavigationServer3D_method_map_get_link_connection_radius:
  502. .. rst-class:: classref-method
  503. :ref:`float<class_float>` **map_get_link_connection_radius** **(** :ref:`RID<class_RID>` map **)** |const|
  504. 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.
  505. .. rst-class:: classref-item-separator
  506. ----
  507. .. _class_NavigationServer3D_method_map_get_links:
  508. .. rst-class:: classref-method
  509. :ref:`RID[]<class_RID>` **map_get_links** **(** :ref:`RID<class_RID>` map **)** |const|
  510. Returns all navigation link :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  511. .. rst-class:: classref-item-separator
  512. ----
  513. .. _class_NavigationServer3D_method_map_get_path:
  514. .. rst-class:: classref-method
  515. :ref:`PackedVector3Array<class_PackedVector3Array>` **map_get_path** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` origin, :ref:`Vector3<class_Vector3>` destination, :ref:`bool<class_bool>` optimize, :ref:`int<class_int>` navigation_layers=1 **)** |const|
  516. 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.
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _class_NavigationServer3D_method_map_get_regions:
  520. .. rst-class:: classref-method
  521. :ref:`RID[]<class_RID>` **map_get_regions** **(** :ref:`RID<class_RID>` map **)** |const|
  522. Returns all navigation regions :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  523. .. rst-class:: classref-item-separator
  524. ----
  525. .. _class_NavigationServer3D_method_map_get_up:
  526. .. rst-class:: classref-method
  527. :ref:`Vector3<class_Vector3>` **map_get_up** **(** :ref:`RID<class_RID>` map **)** |const|
  528. Returns the map's up direction.
  529. .. rst-class:: classref-item-separator
  530. ----
  531. .. _class_NavigationServer3D_method_map_is_active:
  532. .. rst-class:: classref-method
  533. :ref:`bool<class_bool>` **map_is_active** **(** :ref:`RID<class_RID>` map **)** |const|
  534. Returns true if the map is active.
  535. .. rst-class:: classref-item-separator
  536. ----
  537. .. _class_NavigationServer3D_method_map_set_active:
  538. .. rst-class:: classref-method
  539. void **map_set_active** **(** :ref:`RID<class_RID>` map, :ref:`bool<class_bool>` active **)**
  540. Sets the map active.
  541. .. rst-class:: classref-item-separator
  542. ----
  543. .. _class_NavigationServer3D_method_map_set_cell_size:
  544. .. rst-class:: classref-method
  545. void **map_set_cell_size** **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` cell_size **)**
  546. Set the map cell size used to weld the navigation mesh polygons.
  547. .. rst-class:: classref-item-separator
  548. ----
  549. .. _class_NavigationServer3D_method_map_set_edge_connection_margin:
  550. .. rst-class:: classref-method
  551. void **map_set_edge_connection_margin** **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` margin **)**
  552. Set the map edge connection margin used to weld the compatible region edges.
  553. .. rst-class:: classref-item-separator
  554. ----
  555. .. _class_NavigationServer3D_method_map_set_link_connection_radius:
  556. .. rst-class:: classref-method
  557. void **map_set_link_connection_radius** **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` radius **)**
  558. Set the map's link connection radius used to connect links to navigation polygons.
  559. .. rst-class:: classref-item-separator
  560. ----
  561. .. _class_NavigationServer3D_method_map_set_up:
  562. .. rst-class:: classref-method
  563. void **map_set_up** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` up **)**
  564. Sets the map up direction.
  565. .. rst-class:: classref-item-separator
  566. ----
  567. .. _class_NavigationServer3D_method_process:
  568. .. rst-class:: classref-method
  569. void **process** **(** :ref:`float<class_float>` delta_time **)**
  570. Process the collision avoidance agents.
  571. The result of this process is needed by the physics server, so this must be called in the main thread.
  572. \ **Note:** This function is not thread safe.
  573. .. rst-class:: classref-item-separator
  574. ----
  575. .. _class_NavigationServer3D_method_query_path:
  576. .. rst-class:: classref-method
  577. void **query_path** **(** :ref:`NavigationPathQueryParameters3D<class_NavigationPathQueryParameters3D>` parameters, :ref:`NavigationPathQueryResult3D<class_NavigationPathQueryResult3D>` result **)** |const|
  578. Queries a path in a given navigation map. Start and target position and other parameters are defined through :ref:`NavigationPathQueryParameters3D<class_NavigationPathQueryParameters3D>`. Updates the provided :ref:`NavigationPathQueryResult3D<class_NavigationPathQueryResult3D>` result object with the path among other results requested by the query.
  579. .. rst-class:: classref-item-separator
  580. ----
  581. .. _class_NavigationServer3D_method_region_bake_navigation_mesh:
  582. .. rst-class:: classref-method
  583. void **region_bake_navigation_mesh** **(** :ref:`NavigationMesh<class_NavigationMesh>` navigation_mesh, :ref:`Node<class_Node>` root_node **)**
  584. Bakes the ``navigation_mesh`` with bake source geometry collected starting from the ``root_node``.
  585. .. rst-class:: classref-item-separator
  586. ----
  587. .. _class_NavigationServer3D_method_region_create:
  588. .. rst-class:: classref-method
  589. :ref:`RID<class_RID>` **region_create** **(** **)**
  590. Creates a new region.
  591. .. rst-class:: classref-item-separator
  592. ----
  593. .. _class_NavigationServer3D_method_region_get_connection_pathway_end:
  594. .. rst-class:: classref-method
  595. :ref:`Vector3<class_Vector3>` **region_get_connection_pathway_end** **(** :ref:`RID<class_RID>` region, :ref:`int<class_int>` connection **)** |const|
  596. 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_NavigationServer3D_method_region_get_connections_count>`.
  597. .. rst-class:: classref-item-separator
  598. ----
  599. .. _class_NavigationServer3D_method_region_get_connection_pathway_start:
  600. .. rst-class:: classref-method
  601. :ref:`Vector3<class_Vector3>` **region_get_connection_pathway_start** **(** :ref:`RID<class_RID>` region, :ref:`int<class_int>` connection **)** |const|
  602. 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_NavigationServer3D_method_region_get_connections_count>`.
  603. .. rst-class:: classref-item-separator
  604. ----
  605. .. _class_NavigationServer3D_method_region_get_connections_count:
  606. .. rst-class:: classref-method
  607. :ref:`int<class_int>` **region_get_connections_count** **(** :ref:`RID<class_RID>` region **)** |const|
  608. Returns how many connections this ``region`` has with other regions in the map.
  609. .. rst-class:: classref-item-separator
  610. ----
  611. .. _class_NavigationServer3D_method_region_get_enter_cost:
  612. .. rst-class:: classref-method
  613. :ref:`float<class_float>` **region_get_enter_cost** **(** :ref:`RID<class_RID>` region **)** |const|
  614. Returns the ``enter_cost`` of this ``region``.
  615. .. rst-class:: classref-item-separator
  616. ----
  617. .. _class_NavigationServer3D_method_region_get_map:
  618. .. rst-class:: classref-method
  619. :ref:`RID<class_RID>` **region_get_map** **(** :ref:`RID<class_RID>` region **)** |const|
  620. Returns the navigation map :ref:`RID<class_RID>` the requested ``region`` is currently assigned to.
  621. .. rst-class:: classref-item-separator
  622. ----
  623. .. _class_NavigationServer3D_method_region_get_navigation_layers:
  624. .. rst-class:: classref-method
  625. :ref:`int<class_int>` **region_get_navigation_layers** **(** :ref:`RID<class_RID>` region **)** |const|
  626. Returns the region's navigation layers.
  627. .. rst-class:: classref-item-separator
  628. ----
  629. .. _class_NavigationServer3D_method_region_get_owner_id:
  630. .. rst-class:: classref-method
  631. :ref:`int<class_int>` **region_get_owner_id** **(** :ref:`RID<class_RID>` region **)** |const|
  632. Returns the ``ObjectID`` of the object which manages this region.
  633. .. rst-class:: classref-item-separator
  634. ----
  635. .. _class_NavigationServer3D_method_region_get_travel_cost:
  636. .. rst-class:: classref-method
  637. :ref:`float<class_float>` **region_get_travel_cost** **(** :ref:`RID<class_RID>` region **)** |const|
  638. Returns the ``travel_cost`` of this ``region``.
  639. .. rst-class:: classref-item-separator
  640. ----
  641. .. _class_NavigationServer3D_method_region_owns_point:
  642. .. rst-class:: classref-method
  643. :ref:`bool<class_bool>` **region_owns_point** **(** :ref:`RID<class_RID>` region, :ref:`Vector3<class_Vector3>` point **)** |const|
  644. 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.
  645. 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.
  646. \ **Note:** If navigation meshes from different navigation regions overlap (which should be avoided in general) the result might not be what is expected.
  647. .. rst-class:: classref-item-separator
  648. ----
  649. .. _class_NavigationServer3D_method_region_set_enter_cost:
  650. .. rst-class:: classref-method
  651. void **region_set_enter_cost** **(** :ref:`RID<class_RID>` region, :ref:`float<class_float>` enter_cost **)**
  652. Sets the ``enter_cost`` for this ``region``.
  653. .. rst-class:: classref-item-separator
  654. ----
  655. .. _class_NavigationServer3D_method_region_set_map:
  656. .. rst-class:: classref-method
  657. void **region_set_map** **(** :ref:`RID<class_RID>` region, :ref:`RID<class_RID>` map **)**
  658. Sets the map for the region.
  659. .. rst-class:: classref-item-separator
  660. ----
  661. .. _class_NavigationServer3D_method_region_set_navigation_layers:
  662. .. rst-class:: classref-method
  663. void **region_set_navigation_layers** **(** :ref:`RID<class_RID>` region, :ref:`int<class_int>` navigation_layers **)**
  664. Set the region's navigation layers. This allows selecting regions from a path request (when using :ref:`map_get_path<class_NavigationServer3D_method_map_get_path>`).
  665. .. rst-class:: classref-item-separator
  666. ----
  667. .. _class_NavigationServer3D_method_region_set_navigation_mesh:
  668. .. rst-class:: classref-method
  669. void **region_set_navigation_mesh** **(** :ref:`RID<class_RID>` region, :ref:`NavigationMesh<class_NavigationMesh>` navigation_mesh **)**
  670. Sets the navigation mesh for the region.
  671. .. rst-class:: classref-item-separator
  672. ----
  673. .. _class_NavigationServer3D_method_region_set_owner_id:
  674. .. rst-class:: classref-method
  675. void **region_set_owner_id** **(** :ref:`RID<class_RID>` region, :ref:`int<class_int>` owner_id **)**
  676. Set the ``ObjectID`` of the object which manages this region.
  677. .. rst-class:: classref-item-separator
  678. ----
  679. .. _class_NavigationServer3D_method_region_set_transform:
  680. .. rst-class:: classref-method
  681. void **region_set_transform** **(** :ref:`RID<class_RID>` region, :ref:`Transform3D<class_Transform3D>` transform **)**
  682. Sets the global transformation for the region.
  683. .. rst-class:: classref-item-separator
  684. ----
  685. .. _class_NavigationServer3D_method_region_set_travel_cost:
  686. .. rst-class:: classref-method
  687. void **region_set_travel_cost** **(** :ref:`RID<class_RID>` region, :ref:`float<class_float>` travel_cost **)**
  688. Sets the ``travel_cost`` for this ``region``.
  689. .. rst-class:: classref-item-separator
  690. ----
  691. .. _class_NavigationServer3D_method_set_active:
  692. .. rst-class:: classref-method
  693. void **set_active** **(** :ref:`bool<class_bool>` active **)**
  694. Control activation of this server.
  695. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  696. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  697. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  698. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  699. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  700. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`