class_navigationserver3d.rst 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/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:`Callable<class_Callable>` callback **)** |
  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:`bool<class_bool>` | :ref:`get_debug_enabled<class_NavigationServer3D_method_get_debug_enabled>` **(** **)** |const| |
  62. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`RID[]<class_RID>` | :ref:`get_maps<class_NavigationServer3D_method_get_maps>` **(** **)** |const| |
  64. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`int<class_int>` | :ref:`get_process_info<class_NavigationServer3D_method_get_process_info>` **(** :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` process_info **)** |const| |
  66. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`RID<class_RID>` | :ref:`link_create<class_NavigationServer3D_method_link_create>` **(** **)** |
  68. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`Vector3<class_Vector3>` | :ref:`link_get_end_position<class_NavigationServer3D_method_link_get_end_position>` **(** :ref:`RID<class_RID>` link **)** |const| |
  70. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`float<class_float>` | :ref:`link_get_enter_cost<class_NavigationServer3D_method_link_get_enter_cost>` **(** :ref:`RID<class_RID>` link **)** |const| |
  72. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`RID<class_RID>` | :ref:`link_get_map<class_NavigationServer3D_method_link_get_map>` **(** :ref:`RID<class_RID>` link **)** |const| |
  74. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`int<class_int>` | :ref:`link_get_navigation_layers<class_NavigationServer3D_method_link_get_navigation_layers>` **(** :ref:`RID<class_RID>` link **)** |const| |
  76. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`int<class_int>` | :ref:`link_get_owner_id<class_NavigationServer3D_method_link_get_owner_id>` **(** :ref:`RID<class_RID>` link **)** |const| |
  78. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Vector3<class_Vector3>` | :ref:`link_get_start_position<class_NavigationServer3D_method_link_get_start_position>` **(** :ref:`RID<class_RID>` link **)** |const| |
  80. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`float<class_float>` | :ref:`link_get_travel_cost<class_NavigationServer3D_method_link_get_travel_cost>` **(** :ref:`RID<class_RID>` link **)** |const| |
  82. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`bool<class_bool>` | :ref:`link_is_bidirectional<class_NavigationServer3D_method_link_is_bidirectional>` **(** :ref:`RID<class_RID>` link **)** |const| |
  84. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`link_set_bidirectional<class_NavigationServer3D_method_link_set_bidirectional>` **(** :ref:`RID<class_RID>` link, :ref:`bool<class_bool>` bidirectional **)** |
  86. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`link_set_end_position<class_NavigationServer3D_method_link_set_end_position>` **(** :ref:`RID<class_RID>` link, :ref:`Vector3<class_Vector3>` position **)** |
  88. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`link_set_enter_cost<class_NavigationServer3D_method_link_set_enter_cost>` **(** :ref:`RID<class_RID>` link, :ref:`float<class_float>` enter_cost **)** |
  90. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`link_set_map<class_NavigationServer3D_method_link_set_map>` **(** :ref:`RID<class_RID>` link, :ref:`RID<class_RID>` map **)** |
  92. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`link_set_navigation_layers<class_NavigationServer3D_method_link_set_navigation_layers>` **(** :ref:`RID<class_RID>` link, :ref:`int<class_int>` navigation_layers **)** |
  94. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`link_set_owner_id<class_NavigationServer3D_method_link_set_owner_id>` **(** :ref:`RID<class_RID>` link, :ref:`int<class_int>` owner_id **)** |
  96. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`link_set_start_position<class_NavigationServer3D_method_link_set_start_position>` **(** :ref:`RID<class_RID>` link, :ref:`Vector3<class_Vector3>` position **)** |
  98. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`link_set_travel_cost<class_NavigationServer3D_method_link_set_travel_cost>` **(** :ref:`RID<class_RID>` link, :ref:`float<class_float>` travel_cost **)** |
  100. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`RID<class_RID>` | :ref:`map_create<class_NavigationServer3D_method_map_create>` **(** **)** |
  102. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`map_force_update<class_NavigationServer3D_method_map_force_update>` **(** :ref:`RID<class_RID>` map **)** |
  104. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`RID[]<class_RID>` | :ref:`map_get_agents<class_NavigationServer3D_method_map_get_agents>` **(** :ref:`RID<class_RID>` map **)** |const| |
  106. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`float<class_float>` | :ref:`map_get_cell_size<class_NavigationServer3D_method_map_get_cell_size>` **(** :ref:`RID<class_RID>` map **)** |const| |
  108. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :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| |
  110. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :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| |
  112. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :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| |
  114. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :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| |
  116. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`float<class_float>` | :ref:`map_get_edge_connection_margin<class_NavigationServer3D_method_map_get_edge_connection_margin>` **(** :ref:`RID<class_RID>` map **)** |const| |
  118. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`float<class_float>` | :ref:`map_get_link_connection_radius<class_NavigationServer3D_method_map_get_link_connection_radius>` **(** :ref:`RID<class_RID>` map **)** |const| |
  120. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`RID[]<class_RID>` | :ref:`map_get_links<class_NavigationServer3D_method_map_get_links>` **(** :ref:`RID<class_RID>` map **)** |const| |
  122. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :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| |
  124. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`RID[]<class_RID>` | :ref:`map_get_regions<class_NavigationServer3D_method_map_get_regions>` **(** :ref:`RID<class_RID>` map **)** |const| |
  126. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`Vector3<class_Vector3>` | :ref:`map_get_up<class_NavigationServer3D_method_map_get_up>` **(** :ref:`RID<class_RID>` map **)** |const| |
  128. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`bool<class_bool>` | :ref:`map_is_active<class_NavigationServer3D_method_map_is_active>` **(** :ref:`RID<class_RID>` map **)** |const| |
  130. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`map_set_active<class_NavigationServer3D_method_map_set_active>` **(** :ref:`RID<class_RID>` map, :ref:`bool<class_bool>` active **)** |
  132. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`map_set_cell_size<class_NavigationServer3D_method_map_set_cell_size>` **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` cell_size **)** |
  134. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | 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 **)** |
  136. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | 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 **)** |
  138. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`map_set_up<class_NavigationServer3D_method_map_set_up>` **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` up **)** |
  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. | void | :ref:`set_debug_enabled<class_NavigationServer3D_method_set_debug_enabled>` **(** :ref:`bool<class_bool>` enabled **)** |
  182. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. .. rst-class:: classref-section-separator
  184. ----
  185. .. rst-class:: classref-descriptions-group
  186. Signals
  187. -------
  188. .. _class_NavigationServer3D_signal_map_changed:
  189. .. rst-class:: classref-signal
  190. **map_changed** **(** :ref:`RID<class_RID>` map **)**
  191. Emitted when a navigation map is updated, when a region moves or is modified.
  192. .. rst-class:: classref-item-separator
  193. ----
  194. .. _class_NavigationServer3D_signal_navigation_debug_changed:
  195. .. rst-class:: classref-signal
  196. **navigation_debug_changed** **(** **)**
  197. Emitted when navigation debug settings are changed. Only available in debug builds.
  198. .. rst-class:: classref-section-separator
  199. ----
  200. .. rst-class:: classref-descriptions-group
  201. Enumerations
  202. ------------
  203. .. _enum_NavigationServer3D_ProcessInfo:
  204. .. rst-class:: classref-enumeration
  205. enum **ProcessInfo**:
  206. .. _class_NavigationServer3D_constant_INFO_ACTIVE_MAPS:
  207. .. rst-class:: classref-enumeration-constant
  208. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_ACTIVE_MAPS** = ``0``
  209. Constant to get the number of active navigation maps.
  210. .. _class_NavigationServer3D_constant_INFO_REGION_COUNT:
  211. .. rst-class:: classref-enumeration-constant
  212. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_REGION_COUNT** = ``1``
  213. Constant to get the number of active navigation regions.
  214. .. _class_NavigationServer3D_constant_INFO_AGENT_COUNT:
  215. .. rst-class:: classref-enumeration-constant
  216. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_AGENT_COUNT** = ``2``
  217. Constant to get the number of active navigation agents processing avoidance.
  218. .. _class_NavigationServer3D_constant_INFO_LINK_COUNT:
  219. .. rst-class:: classref-enumeration-constant
  220. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_LINK_COUNT** = ``3``
  221. Constant to get the number of active navigation links.
  222. .. _class_NavigationServer3D_constant_INFO_POLYGON_COUNT:
  223. .. rst-class:: classref-enumeration-constant
  224. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_POLYGON_COUNT** = ``4``
  225. Constant to get the number of navigation mesh polygons.
  226. .. _class_NavigationServer3D_constant_INFO_EDGE_COUNT:
  227. .. rst-class:: classref-enumeration-constant
  228. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_EDGE_COUNT** = ``5``
  229. Constant to get the number of navigation mesh polygon edges.
  230. .. _class_NavigationServer3D_constant_INFO_EDGE_MERGE_COUNT:
  231. .. rst-class:: classref-enumeration-constant
  232. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_EDGE_MERGE_COUNT** = ``6``
  233. Constant to get the number of navigation mesh polygon edges that were merged due to edge key overlap.
  234. .. _class_NavigationServer3D_constant_INFO_EDGE_CONNECTION_COUNT:
  235. .. rst-class:: classref-enumeration-constant
  236. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_EDGE_CONNECTION_COUNT** = ``7``
  237. Constant to get the number of navigation mesh polygon edges that are considered connected by edge proximity.
  238. .. _class_NavigationServer3D_constant_INFO_EDGE_FREE_COUNT:
  239. .. rst-class:: classref-enumeration-constant
  240. :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` **INFO_EDGE_FREE_COUNT** = ``8``
  241. 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.
  242. .. rst-class:: classref-section-separator
  243. ----
  244. .. rst-class:: classref-descriptions-group
  245. Method Descriptions
  246. -------------------
  247. .. _class_NavigationServer3D_method_agent_create:
  248. .. rst-class:: classref-method
  249. :ref:`RID<class_RID>` **agent_create** **(** **)**
  250. Creates the agent.
  251. .. rst-class:: classref-item-separator
  252. ----
  253. .. _class_NavigationServer3D_method_agent_get_map:
  254. .. rst-class:: classref-method
  255. :ref:`RID<class_RID>` **agent_get_map** **(** :ref:`RID<class_RID>` agent **)** |const|
  256. Returns the navigation map :ref:`RID<class_RID>` the requested ``agent`` is currently assigned to.
  257. .. rst-class:: classref-item-separator
  258. ----
  259. .. _class_NavigationServer3D_method_agent_is_map_changed:
  260. .. rst-class:: classref-method
  261. :ref:`bool<class_bool>` **agent_is_map_changed** **(** :ref:`RID<class_RID>` agent **)** |const|
  262. Returns true if the map got changed the previous frame.
  263. .. rst-class:: classref-item-separator
  264. ----
  265. .. _class_NavigationServer3D_method_agent_set_callback:
  266. .. rst-class:: classref-method
  267. void **agent_set_callback** **(** :ref:`RID<class_RID>` agent, :ref:`Callable<class_Callable>` callback **)**
  268. Sets the callback that gets called after each avoidance processing step for the ``agent``. The calculated ``safe_velocity`` will be passed as the first parameter just before the physics calculations.
  269. \ **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 an empty :ref:`Callable<class_Callable>`.
  270. .. rst-class:: classref-item-separator
  271. ----
  272. .. _class_NavigationServer3D_method_agent_set_map:
  273. .. rst-class:: classref-method
  274. void **agent_set_map** **(** :ref:`RID<class_RID>` agent, :ref:`RID<class_RID>` map **)**
  275. Puts the agent in the map.
  276. .. rst-class:: classref-item-separator
  277. ----
  278. .. _class_NavigationServer3D_method_agent_set_max_neighbors:
  279. .. rst-class:: classref-method
  280. void **agent_set_max_neighbors** **(** :ref:`RID<class_RID>` agent, :ref:`int<class_int>` count **)**
  281. 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.
  282. .. rst-class:: classref-item-separator
  283. ----
  284. .. _class_NavigationServer3D_method_agent_set_max_speed:
  285. .. rst-class:: classref-method
  286. void **agent_set_max_speed** **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` max_speed **)**
  287. Sets the maximum speed of the agent. Must be positive.
  288. .. rst-class:: classref-item-separator
  289. ----
  290. .. _class_NavigationServer3D_method_agent_set_neighbor_distance:
  291. .. rst-class:: classref-method
  292. void **agent_set_neighbor_distance** **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` distance **)**
  293. 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.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_NavigationServer3D_method_agent_set_position:
  297. .. rst-class:: classref-method
  298. void **agent_set_position** **(** :ref:`RID<class_RID>` agent, :ref:`Vector3<class_Vector3>` position **)**
  299. Sets the position of the agent in world space.
  300. .. rst-class:: classref-item-separator
  301. ----
  302. .. _class_NavigationServer3D_method_agent_set_radius:
  303. .. rst-class:: classref-method
  304. void **agent_set_radius** **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` radius **)**
  305. Sets the radius of the agent.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_NavigationServer3D_method_agent_set_target_velocity:
  309. .. rst-class:: classref-method
  310. void **agent_set_target_velocity** **(** :ref:`RID<class_RID>` agent, :ref:`Vector3<class_Vector3>` target_velocity **)**
  311. Sets the new target velocity.
  312. .. rst-class:: classref-item-separator
  313. ----
  314. .. _class_NavigationServer3D_method_agent_set_time_horizon:
  315. .. rst-class:: classref-method
  316. void **agent_set_time_horizon** **(** :ref:`RID<class_RID>` agent, :ref:`float<class_float>` time **)**
  317. 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.
  318. .. rst-class:: classref-item-separator
  319. ----
  320. .. _class_NavigationServer3D_method_agent_set_velocity:
  321. .. rst-class:: classref-method
  322. void **agent_set_velocity** **(** :ref:`RID<class_RID>` agent, :ref:`Vector3<class_Vector3>` velocity **)**
  323. Sets the current velocity of the agent.
  324. .. rst-class:: classref-item-separator
  325. ----
  326. .. _class_NavigationServer3D_method_free_rid:
  327. .. rst-class:: classref-method
  328. void **free_rid** **(** :ref:`RID<class_RID>` rid **)**
  329. Destroys the given RID.
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_NavigationServer3D_method_get_debug_enabled:
  333. .. rst-class:: classref-method
  334. :ref:`bool<class_bool>` **get_debug_enabled** **(** **)** |const|
  335. Returns ``true`` when the NavigationServer has debug enabled.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_NavigationServer3D_method_get_maps:
  339. .. rst-class:: classref-method
  340. :ref:`RID[]<class_RID>` **get_maps** **(** **)** |const|
  341. 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.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_NavigationServer3D_method_get_process_info:
  345. .. rst-class:: classref-method
  346. :ref:`int<class_int>` **get_process_info** **(** :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` process_info **)** |const|
  347. Returns information about the current state of the NavigationServer. See :ref:`ProcessInfo<enum_NavigationServer3D_ProcessInfo>` for a list of available states.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_NavigationServer3D_method_link_create:
  351. .. rst-class:: classref-method
  352. :ref:`RID<class_RID>` **link_create** **(** **)**
  353. Create a new link between two positions on a map.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_NavigationServer3D_method_link_get_end_position:
  357. .. rst-class:: classref-method
  358. :ref:`Vector3<class_Vector3>` **link_get_end_position** **(** :ref:`RID<class_RID>` link **)** |const|
  359. Returns the ending position of this ``link``.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_NavigationServer3D_method_link_get_enter_cost:
  363. .. rst-class:: classref-method
  364. :ref:`float<class_float>` **link_get_enter_cost** **(** :ref:`RID<class_RID>` link **)** |const|
  365. Returns the enter cost of this ``link``.
  366. .. rst-class:: classref-item-separator
  367. ----
  368. .. _class_NavigationServer3D_method_link_get_map:
  369. .. rst-class:: classref-method
  370. :ref:`RID<class_RID>` **link_get_map** **(** :ref:`RID<class_RID>` link **)** |const|
  371. Returns the navigation map :ref:`RID<class_RID>` the requested ``link`` is currently assigned to.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _class_NavigationServer3D_method_link_get_navigation_layers:
  375. .. rst-class:: classref-method
  376. :ref:`int<class_int>` **link_get_navigation_layers** **(** :ref:`RID<class_RID>` link **)** |const|
  377. Returns the navigation layers for this ``link``.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _class_NavigationServer3D_method_link_get_owner_id:
  381. .. rst-class:: classref-method
  382. :ref:`int<class_int>` **link_get_owner_id** **(** :ref:`RID<class_RID>` link **)** |const|
  383. Returns the ``ObjectID`` of the object which manages this link.
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _class_NavigationServer3D_method_link_get_start_position:
  387. .. rst-class:: classref-method
  388. :ref:`Vector3<class_Vector3>` **link_get_start_position** **(** :ref:`RID<class_RID>` link **)** |const|
  389. Returns the starting position of this ``link``.
  390. .. rst-class:: classref-item-separator
  391. ----
  392. .. _class_NavigationServer3D_method_link_get_travel_cost:
  393. .. rst-class:: classref-method
  394. :ref:`float<class_float>` **link_get_travel_cost** **(** :ref:`RID<class_RID>` link **)** |const|
  395. Returns the travel cost of this ``link``.
  396. .. rst-class:: classref-item-separator
  397. ----
  398. .. _class_NavigationServer3D_method_link_is_bidirectional:
  399. .. rst-class:: classref-method
  400. :ref:`bool<class_bool>` **link_is_bidirectional** **(** :ref:`RID<class_RID>` link **)** |const|
  401. Returns whether this ``link`` can be travelled in both directions.
  402. .. rst-class:: classref-item-separator
  403. ----
  404. .. _class_NavigationServer3D_method_link_set_bidirectional:
  405. .. rst-class:: classref-method
  406. void **link_set_bidirectional** **(** :ref:`RID<class_RID>` link, :ref:`bool<class_bool>` bidirectional **)**
  407. Sets whether this ``link`` can be travelled in both directions.
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_NavigationServer3D_method_link_set_end_position:
  411. .. rst-class:: classref-method
  412. void **link_set_end_position** **(** :ref:`RID<class_RID>` link, :ref:`Vector3<class_Vector3>` position **)**
  413. Sets the exit position for the ``link``.
  414. .. rst-class:: classref-item-separator
  415. ----
  416. .. _class_NavigationServer3D_method_link_set_enter_cost:
  417. .. rst-class:: classref-method
  418. void **link_set_enter_cost** **(** :ref:`RID<class_RID>` link, :ref:`float<class_float>` enter_cost **)**
  419. Sets the ``enter_cost`` for this ``link``.
  420. .. rst-class:: classref-item-separator
  421. ----
  422. .. _class_NavigationServer3D_method_link_set_map:
  423. .. rst-class:: classref-method
  424. void **link_set_map** **(** :ref:`RID<class_RID>` link, :ref:`RID<class_RID>` map **)**
  425. Sets the navigation map :ref:`RID<class_RID>` for the link.
  426. .. rst-class:: classref-item-separator
  427. ----
  428. .. _class_NavigationServer3D_method_link_set_navigation_layers:
  429. .. rst-class:: classref-method
  430. void **link_set_navigation_layers** **(** :ref:`RID<class_RID>` link, :ref:`int<class_int>` navigation_layers **)**
  431. 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>`).
  432. .. rst-class:: classref-item-separator
  433. ----
  434. .. _class_NavigationServer3D_method_link_set_owner_id:
  435. .. rst-class:: classref-method
  436. void **link_set_owner_id** **(** :ref:`RID<class_RID>` link, :ref:`int<class_int>` owner_id **)**
  437. Set the ``ObjectID`` of the object which manages this link.
  438. .. rst-class:: classref-item-separator
  439. ----
  440. .. _class_NavigationServer3D_method_link_set_start_position:
  441. .. rst-class:: classref-method
  442. void **link_set_start_position** **(** :ref:`RID<class_RID>` link, :ref:`Vector3<class_Vector3>` position **)**
  443. Sets the entry position for this ``link``.
  444. .. rst-class:: classref-item-separator
  445. ----
  446. .. _class_NavigationServer3D_method_link_set_travel_cost:
  447. .. rst-class:: classref-method
  448. void **link_set_travel_cost** **(** :ref:`RID<class_RID>` link, :ref:`float<class_float>` travel_cost **)**
  449. Sets the ``travel_cost`` for this ``link``.
  450. .. rst-class:: classref-item-separator
  451. ----
  452. .. _class_NavigationServer3D_method_map_create:
  453. .. rst-class:: classref-method
  454. :ref:`RID<class_RID>` **map_create** **(** **)**
  455. Create a new map.
  456. .. rst-class:: classref-item-separator
  457. ----
  458. .. _class_NavigationServer3D_method_map_force_update:
  459. .. rst-class:: classref-method
  460. void **map_force_update** **(** :ref:`RID<class_RID>` map **)**
  461. 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).
  462. 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.
  463. 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.
  464. \ **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.
  465. .. rst-class:: classref-item-separator
  466. ----
  467. .. _class_NavigationServer3D_method_map_get_agents:
  468. .. rst-class:: classref-method
  469. :ref:`RID[]<class_RID>` **map_get_agents** **(** :ref:`RID<class_RID>` map **)** |const|
  470. Returns all navigation agents :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  471. .. rst-class:: classref-item-separator
  472. ----
  473. .. _class_NavigationServer3D_method_map_get_cell_size:
  474. .. rst-class:: classref-method
  475. :ref:`float<class_float>` **map_get_cell_size** **(** :ref:`RID<class_RID>` map **)** |const|
  476. Returns the map cell size.
  477. .. rst-class:: classref-item-separator
  478. ----
  479. .. _class_NavigationServer3D_method_map_get_closest_point:
  480. .. rst-class:: classref-method
  481. :ref:`Vector3<class_Vector3>` **map_get_closest_point** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` to_point **)** |const|
  482. Returns the point closest to the provided ``to_point`` on the navigation mesh surface.
  483. .. rst-class:: classref-item-separator
  484. ----
  485. .. _class_NavigationServer3D_method_map_get_closest_point_normal:
  486. .. rst-class:: classref-method
  487. :ref:`Vector3<class_Vector3>` **map_get_closest_point_normal** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` to_point **)** |const|
  488. Returns the normal for the point returned by :ref:`map_get_closest_point<class_NavigationServer3D_method_map_get_closest_point>`.
  489. .. rst-class:: classref-item-separator
  490. ----
  491. .. _class_NavigationServer3D_method_map_get_closest_point_owner:
  492. .. rst-class:: classref-method
  493. :ref:`RID<class_RID>` **map_get_closest_point_owner** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` to_point **)** |const|
  494. Returns the owner region RID for the point returned by :ref:`map_get_closest_point<class_NavigationServer3D_method_map_get_closest_point>`.
  495. .. rst-class:: classref-item-separator
  496. ----
  497. .. _class_NavigationServer3D_method_map_get_closest_point_to_segment:
  498. .. rst-class:: classref-method
  499. :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|
  500. Returns the closest point between the navigation surface and the segment.
  501. .. rst-class:: classref-item-separator
  502. ----
  503. .. _class_NavigationServer3D_method_map_get_edge_connection_margin:
  504. .. rst-class:: classref-method
  505. :ref:`float<class_float>` **map_get_edge_connection_margin** **(** :ref:`RID<class_RID>` map **)** |const|
  506. Returns the edge connection margin of the map. This distance is the minimum vertex distance needed to connect two edges from different regions.
  507. .. rst-class:: classref-item-separator
  508. ----
  509. .. _class_NavigationServer3D_method_map_get_link_connection_radius:
  510. .. rst-class:: classref-method
  511. :ref:`float<class_float>` **map_get_link_connection_radius** **(** :ref:`RID<class_RID>` map **)** |const|
  512. 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.
  513. .. rst-class:: classref-item-separator
  514. ----
  515. .. _class_NavigationServer3D_method_map_get_links:
  516. .. rst-class:: classref-method
  517. :ref:`RID[]<class_RID>` **map_get_links** **(** :ref:`RID<class_RID>` map **)** |const|
  518. Returns all navigation link :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  519. .. rst-class:: classref-item-separator
  520. ----
  521. .. _class_NavigationServer3D_method_map_get_path:
  522. .. rst-class:: classref-method
  523. :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|
  524. 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.
  525. .. rst-class:: classref-item-separator
  526. ----
  527. .. _class_NavigationServer3D_method_map_get_regions:
  528. .. rst-class:: classref-method
  529. :ref:`RID[]<class_RID>` **map_get_regions** **(** :ref:`RID<class_RID>` map **)** |const|
  530. Returns all navigation regions :ref:`RID<class_RID>`\ s that are currently assigned to the requested navigation ``map``.
  531. .. rst-class:: classref-item-separator
  532. ----
  533. .. _class_NavigationServer3D_method_map_get_up:
  534. .. rst-class:: classref-method
  535. :ref:`Vector3<class_Vector3>` **map_get_up** **(** :ref:`RID<class_RID>` map **)** |const|
  536. Returns the map's up direction.
  537. .. rst-class:: classref-item-separator
  538. ----
  539. .. _class_NavigationServer3D_method_map_is_active:
  540. .. rst-class:: classref-method
  541. :ref:`bool<class_bool>` **map_is_active** **(** :ref:`RID<class_RID>` map **)** |const|
  542. Returns true if the map is active.
  543. .. rst-class:: classref-item-separator
  544. ----
  545. .. _class_NavigationServer3D_method_map_set_active:
  546. .. rst-class:: classref-method
  547. void **map_set_active** **(** :ref:`RID<class_RID>` map, :ref:`bool<class_bool>` active **)**
  548. Sets the map active.
  549. .. rst-class:: classref-item-separator
  550. ----
  551. .. _class_NavigationServer3D_method_map_set_cell_size:
  552. .. rst-class:: classref-method
  553. void **map_set_cell_size** **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` cell_size **)**
  554. Set the map cell size used to weld the navigation mesh polygons.
  555. .. rst-class:: classref-item-separator
  556. ----
  557. .. _class_NavigationServer3D_method_map_set_edge_connection_margin:
  558. .. rst-class:: classref-method
  559. void **map_set_edge_connection_margin** **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` margin **)**
  560. Set the map edge connection margin used to weld the compatible region edges.
  561. .. rst-class:: classref-item-separator
  562. ----
  563. .. _class_NavigationServer3D_method_map_set_link_connection_radius:
  564. .. rst-class:: classref-method
  565. void **map_set_link_connection_radius** **(** :ref:`RID<class_RID>` map, :ref:`float<class_float>` radius **)**
  566. Set the map's link connection radius used to connect links to navigation polygons.
  567. .. rst-class:: classref-item-separator
  568. ----
  569. .. _class_NavigationServer3D_method_map_set_up:
  570. .. rst-class:: classref-method
  571. void **map_set_up** **(** :ref:`RID<class_RID>` map, :ref:`Vector3<class_Vector3>` up **)**
  572. Sets the map up direction.
  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. .. rst-class:: classref-item-separator
  696. ----
  697. .. _class_NavigationServer3D_method_set_debug_enabled:
  698. .. rst-class:: classref-method
  699. void **set_debug_enabled** **(** :ref:`bool<class_bool>` enabled **)**
  700. If ``true`` enables debug mode on the NavigationServer.
  701. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  702. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  703. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  704. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  705. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  706. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`