class_navigationlink3d.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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/NavigationLink3D.xml.
  6. .. _class_NavigationLink3D:
  7. NavigationLink3D
  8. ================
  9. **Experimental:** This class may be changed or removed in future versions.
  10. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  11. A link between two positions on :ref:`NavigationRegion3D<class_NavigationRegion3D>`\ s that agents can be routed through.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A link between two positions on :ref:`NavigationRegion3D<class_NavigationRegion3D>`\ s that agents can be routed through. These positions can be on the same :ref:`NavigationRegion3D<class_NavigationRegion3D>` or on two different ones. Links are useful to express navigation methods other than traveling along the surface of the navigation mesh, such as ziplines, teleporters, or gaps that can be jumped across.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Using NavigationLinks <../tutorials/navigation/navigation_using_navigationlinks>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  26. | :ref:`bool<class_bool>` | :ref:`bidirectional<class_NavigationLink3D_property_bidirectional>` | ``true`` |
  27. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  28. | :ref:`bool<class_bool>` | :ref:`enabled<class_NavigationLink3D_property_enabled>` | ``true`` |
  29. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  30. | :ref:`Vector3<class_Vector3>` | :ref:`end_position<class_NavigationLink3D_property_end_position>` | ``Vector3(0, 0, 0)`` |
  31. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  32. | :ref:`float<class_float>` | :ref:`enter_cost<class_NavigationLink3D_property_enter_cost>` | ``0.0`` |
  33. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  34. | :ref:`int<class_int>` | :ref:`navigation_layers<class_NavigationLink3D_property_navigation_layers>` | ``1`` |
  35. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  36. | :ref:`Vector3<class_Vector3>` | :ref:`start_position<class_NavigationLink3D_property_start_position>` | ``Vector3(0, 0, 0)`` |
  37. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  38. | :ref:`float<class_float>` | :ref:`travel_cost<class_NavigationLink3D_property_travel_cost>` | ``1.0`` |
  39. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  40. .. rst-class:: classref-reftable-group
  41. Methods
  42. -------
  43. .. table::
  44. :widths: auto
  45. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Vector3<class_Vector3>` | :ref:`get_global_end_position<class_NavigationLink3D_method_get_global_end_position>`\ (\ ) |const| |
  47. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Vector3<class_Vector3>` | :ref:`get_global_start_position<class_NavigationLink3D_method_get_global_start_position>`\ (\ ) |const| |
  49. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`get_navigation_layer_value<class_NavigationLink3D_method_get_navigation_layer_value>`\ (\ layer_number\: :ref:`int<class_int>`\ ) |const| |
  51. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`RID<class_RID>` | :ref:`get_navigation_map<class_NavigationLink3D_method_get_navigation_map>`\ (\ ) |const| |
  53. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`RID<class_RID>` | :ref:`get_rid<class_NavigationLink3D_method_get_rid>`\ (\ ) |const| |
  55. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | |void| | :ref:`set_global_end_position<class_NavigationLink3D_method_set_global_end_position>`\ (\ position\: :ref:`Vector3<class_Vector3>`\ ) |
  57. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | |void| | :ref:`set_global_start_position<class_NavigationLink3D_method_set_global_start_position>`\ (\ position\: :ref:`Vector3<class_Vector3>`\ ) |
  59. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | |void| | :ref:`set_navigation_layer_value<class_NavigationLink3D_method_set_navigation_layer_value>`\ (\ layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) |
  61. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | |void| | :ref:`set_navigation_map<class_NavigationLink3D_method_set_navigation_map>`\ (\ navigation_map\: :ref:`RID<class_RID>`\ ) |
  63. +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. .. rst-class:: classref-section-separator
  65. ----
  66. .. rst-class:: classref-descriptions-group
  67. Property Descriptions
  68. ---------------------
  69. .. _class_NavigationLink3D_property_bidirectional:
  70. .. rst-class:: classref-property
  71. :ref:`bool<class_bool>` **bidirectional** = ``true`` :ref:`🔗<class_NavigationLink3D_property_bidirectional>`
  72. .. rst-class:: classref-property-setget
  73. - |void| **set_bidirectional**\ (\ value\: :ref:`bool<class_bool>`\ )
  74. - :ref:`bool<class_bool>` **is_bidirectional**\ (\ )
  75. Whether this link can be traveled in both directions or only from :ref:`start_position<class_NavigationLink3D_property_start_position>` to :ref:`end_position<class_NavigationLink3D_property_end_position>`.
  76. .. rst-class:: classref-item-separator
  77. ----
  78. .. _class_NavigationLink3D_property_enabled:
  79. .. rst-class:: classref-property
  80. :ref:`bool<class_bool>` **enabled** = ``true`` :ref:`🔗<class_NavigationLink3D_property_enabled>`
  81. .. rst-class:: classref-property-setget
  82. - |void| **set_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  83. - :ref:`bool<class_bool>` **is_enabled**\ (\ )
  84. Whether this link is currently active. If ``false``, :ref:`NavigationServer3D.map_get_path<class_NavigationServer3D_method_map_get_path>` will ignore this link.
  85. .. rst-class:: classref-item-separator
  86. ----
  87. .. _class_NavigationLink3D_property_end_position:
  88. .. rst-class:: classref-property
  89. :ref:`Vector3<class_Vector3>` **end_position** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_NavigationLink3D_property_end_position>`
  90. .. rst-class:: classref-property-setget
  91. - |void| **set_end_position**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  92. - :ref:`Vector3<class_Vector3>` **get_end_position**\ (\ )
  93. Ending position of the link.
  94. This position will search out the nearest polygon in the navigation mesh to attach to.
  95. The distance the link will search is controlled by :ref:`NavigationServer3D.map_set_link_connection_radius<class_NavigationServer3D_method_map_set_link_connection_radius>`.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_NavigationLink3D_property_enter_cost:
  99. .. rst-class:: classref-property
  100. :ref:`float<class_float>` **enter_cost** = ``0.0`` :ref:`🔗<class_NavigationLink3D_property_enter_cost>`
  101. .. rst-class:: classref-property-setget
  102. - |void| **set_enter_cost**\ (\ value\: :ref:`float<class_float>`\ )
  103. - :ref:`float<class_float>` **get_enter_cost**\ (\ )
  104. When pathfinding enters this link from another regions navigation mesh the :ref:`enter_cost<class_NavigationLink3D_property_enter_cost>` value is added to the path distance for determining the shortest path.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_NavigationLink3D_property_navigation_layers:
  108. .. rst-class:: classref-property
  109. :ref:`int<class_int>` **navigation_layers** = ``1`` :ref:`🔗<class_NavigationLink3D_property_navigation_layers>`
  110. .. rst-class:: classref-property-setget
  111. - |void| **set_navigation_layers**\ (\ value\: :ref:`int<class_int>`\ )
  112. - :ref:`int<class_int>` **get_navigation_layers**\ (\ )
  113. A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with :ref:`NavigationServer3D.map_get_path<class_NavigationServer3D_method_map_get_path>`.
  114. .. rst-class:: classref-item-separator
  115. ----
  116. .. _class_NavigationLink3D_property_start_position:
  117. .. rst-class:: classref-property
  118. :ref:`Vector3<class_Vector3>` **start_position** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_NavigationLink3D_property_start_position>`
  119. .. rst-class:: classref-property-setget
  120. - |void| **set_start_position**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  121. - :ref:`Vector3<class_Vector3>` **get_start_position**\ (\ )
  122. Starting position of the link.
  123. This position will search out the nearest polygon in the navigation mesh to attach to.
  124. The distance the link will search is controlled by :ref:`NavigationServer3D.map_set_link_connection_radius<class_NavigationServer3D_method_map_set_link_connection_radius>`.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_NavigationLink3D_property_travel_cost:
  128. .. rst-class:: classref-property
  129. :ref:`float<class_float>` **travel_cost** = ``1.0`` :ref:`🔗<class_NavigationLink3D_property_travel_cost>`
  130. .. rst-class:: classref-property-setget
  131. - |void| **set_travel_cost**\ (\ value\: :ref:`float<class_float>`\ )
  132. - :ref:`float<class_float>` **get_travel_cost**\ (\ )
  133. When pathfinding moves along the link the traveled distance is multiplied with :ref:`travel_cost<class_NavigationLink3D_property_travel_cost>` for determining the shortest path.
  134. .. rst-class:: classref-section-separator
  135. ----
  136. .. rst-class:: classref-descriptions-group
  137. Method Descriptions
  138. -------------------
  139. .. _class_NavigationLink3D_method_get_global_end_position:
  140. .. rst-class:: classref-method
  141. :ref:`Vector3<class_Vector3>` **get_global_end_position**\ (\ ) |const| :ref:`🔗<class_NavigationLink3D_method_get_global_end_position>`
  142. Returns the :ref:`end_position<class_NavigationLink3D_property_end_position>` that is relative to the link as a global position.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_NavigationLink3D_method_get_global_start_position:
  146. .. rst-class:: classref-method
  147. :ref:`Vector3<class_Vector3>` **get_global_start_position**\ (\ ) |const| :ref:`🔗<class_NavigationLink3D_method_get_global_start_position>`
  148. Returns the :ref:`start_position<class_NavigationLink3D_property_start_position>` that is relative to the link as a global position.
  149. .. rst-class:: classref-item-separator
  150. ----
  151. .. _class_NavigationLink3D_method_get_navigation_layer_value:
  152. .. rst-class:: classref-method
  153. :ref:`bool<class_bool>` **get_navigation_layer_value**\ (\ layer_number\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_NavigationLink3D_method_get_navigation_layer_value>`
  154. Returns whether or not the specified layer of the :ref:`navigation_layers<class_NavigationLink3D_property_navigation_layers>` bitmask is enabled, given a ``layer_number`` between 1 and 32.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_NavigationLink3D_method_get_navigation_map:
  158. .. rst-class:: classref-method
  159. :ref:`RID<class_RID>` **get_navigation_map**\ (\ ) |const| :ref:`🔗<class_NavigationLink3D_method_get_navigation_map>`
  160. Returns the current navigation map :ref:`RID<class_RID>` used by this link.
  161. .. rst-class:: classref-item-separator
  162. ----
  163. .. _class_NavigationLink3D_method_get_rid:
  164. .. rst-class:: classref-method
  165. :ref:`RID<class_RID>` **get_rid**\ (\ ) |const| :ref:`🔗<class_NavigationLink3D_method_get_rid>`
  166. Returns the :ref:`RID<class_RID>` of this link on the :ref:`NavigationServer3D<class_NavigationServer3D>`.
  167. .. rst-class:: classref-item-separator
  168. ----
  169. .. _class_NavigationLink3D_method_set_global_end_position:
  170. .. rst-class:: classref-method
  171. |void| **set_global_end_position**\ (\ position\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_NavigationLink3D_method_set_global_end_position>`
  172. Sets the :ref:`end_position<class_NavigationLink3D_property_end_position>` that is relative to the link from a global ``position``.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_NavigationLink3D_method_set_global_start_position:
  176. .. rst-class:: classref-method
  177. |void| **set_global_start_position**\ (\ position\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_NavigationLink3D_method_set_global_start_position>`
  178. Sets the :ref:`start_position<class_NavigationLink3D_property_start_position>` that is relative to the link from a global ``position``.
  179. .. rst-class:: classref-item-separator
  180. ----
  181. .. _class_NavigationLink3D_method_set_navigation_layer_value:
  182. .. rst-class:: classref-method
  183. |void| **set_navigation_layer_value**\ (\ layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_NavigationLink3D_method_set_navigation_layer_value>`
  184. Based on ``value``, enables or disables the specified layer in the :ref:`navigation_layers<class_NavigationLink3D_property_navigation_layers>` bitmask, given a ``layer_number`` between 1 and 32.
  185. .. rst-class:: classref-item-separator
  186. ----
  187. .. _class_NavigationLink3D_method_set_navigation_map:
  188. .. rst-class:: classref-method
  189. |void| **set_navigation_map**\ (\ navigation_map\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_NavigationLink3D_method_set_navigation_map>`
  190. Sets the :ref:`RID<class_RID>` of the navigation map this link should use. By default the link will automatically join the :ref:`World3D<class_World3D>` default navigation map so this function is only required to override the default map.
  191. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  192. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  193. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  194. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  195. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  196. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  197. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  198. .. |void| replace:: :abbr:`void (No return value.)`