class_navigationlink3d.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/NavigationLink3D.xml.
  6. .. _class_NavigationLink3D:
  7. NavigationLink3D
  8. ================
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A link between two positions on :ref:`NavigationRegion3D<class_NavigationRegion3D>`\ s that agents can be routed through.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`Using NavigationLinks <../tutorials/navigation/navigation_using_navigationlinks>`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  25. | :ref:`bool<class_bool>` | :ref:`bidirectional<class_NavigationLink3D_property_bidirectional>` | ``true`` |
  26. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  27. | :ref:`bool<class_bool>` | :ref:`enabled<class_NavigationLink3D_property_enabled>` | ``true`` |
  28. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  29. | :ref:`Vector3<class_Vector3>` | :ref:`end_position<class_NavigationLink3D_property_end_position>` | ``Vector3(0, 0, 0)`` |
  30. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  31. | :ref:`float<class_float>` | :ref:`enter_cost<class_NavigationLink3D_property_enter_cost>` | ``0.0`` |
  32. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  33. | :ref:`int<class_int>` | :ref:`navigation_layers<class_NavigationLink3D_property_navigation_layers>` | ``1`` |
  34. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  35. | :ref:`Vector3<class_Vector3>` | :ref:`start_position<class_NavigationLink3D_property_start_position>` | ``Vector3(0, 0, 0)`` |
  36. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  37. | :ref:`float<class_float>` | :ref:`travel_cost<class_NavigationLink3D_property_travel_cost>` | ``1.0`` |
  38. +-------------------------------+-----------------------------------------------------------------------------+----------------------+
  39. .. rst-class:: classref-reftable-group
  40. Methods
  41. -------
  42. .. table::
  43. :widths: auto
  44. +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Vector3<class_Vector3>` | :ref:`get_global_end_position<class_NavigationLink3D_method_get_global_end_position>` **(** **)** |const| |
  46. +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Vector3<class_Vector3>` | :ref:`get_global_start_position<class_NavigationLink3D_method_get_global_start_position>` **(** **)** |const| |
  48. +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`get_navigation_layer_value<class_NavigationLink3D_method_get_navigation_layer_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  50. +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`RID<class_RID>` | :ref:`get_rid<class_NavigationLink3D_method_get_rid>` **(** **)** |const| |
  52. +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`set_global_end_position<class_NavigationLink3D_method_set_global_end_position>` **(** :ref:`Vector3<class_Vector3>` position **)** |
  54. +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`set_global_start_position<class_NavigationLink3D_method_set_global_start_position>` **(** :ref:`Vector3<class_Vector3>` position **)** |
  56. +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`set_navigation_layer_value<class_NavigationLink3D_method_set_navigation_layer_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  58. +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. .. rst-class:: classref-section-separator
  60. ----
  61. .. rst-class:: classref-descriptions-group
  62. Property Descriptions
  63. ---------------------
  64. .. _class_NavigationLink3D_property_bidirectional:
  65. .. rst-class:: classref-property
  66. :ref:`bool<class_bool>` **bidirectional** = ``true``
  67. .. rst-class:: classref-property-setget
  68. - void **set_bidirectional** **(** :ref:`bool<class_bool>` value **)**
  69. - :ref:`bool<class_bool>` **is_bidirectional** **(** **)**
  70. 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>`.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_NavigationLink3D_property_enabled:
  74. .. rst-class:: classref-property
  75. :ref:`bool<class_bool>` **enabled** = ``true``
  76. .. rst-class:: classref-property-setget
  77. - void **set_enabled** **(** :ref:`bool<class_bool>` value **)**
  78. - :ref:`bool<class_bool>` **is_enabled** **(** **)**
  79. Whether this link is currently active. If ``false``, :ref:`NavigationServer3D.map_get_path<class_NavigationServer3D_method_map_get_path>` will ignore this link.
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_NavigationLink3D_property_end_position:
  83. .. rst-class:: classref-property
  84. :ref:`Vector3<class_Vector3>` **end_position** = ``Vector3(0, 0, 0)``
  85. .. rst-class:: classref-property-setget
  86. - void **set_end_position** **(** :ref:`Vector3<class_Vector3>` value **)**
  87. - :ref:`Vector3<class_Vector3>` **get_end_position** **(** **)**
  88. Ending position of the link.
  89. This position will search out the nearest polygon in the navigation mesh to attach to.
  90. The distance the link will search is controlled by :ref:`NavigationServer3D.map_set_link_connection_radius<class_NavigationServer3D_method_map_set_link_connection_radius>`.
  91. .. rst-class:: classref-item-separator
  92. ----
  93. .. _class_NavigationLink3D_property_enter_cost:
  94. .. rst-class:: classref-property
  95. :ref:`float<class_float>` **enter_cost** = ``0.0``
  96. .. rst-class:: classref-property-setget
  97. - void **set_enter_cost** **(** :ref:`float<class_float>` value **)**
  98. - :ref:`float<class_float>` **get_enter_cost** **(** **)**
  99. 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.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_NavigationLink3D_property_navigation_layers:
  103. .. rst-class:: classref-property
  104. :ref:`int<class_int>` **navigation_layers** = ``1``
  105. .. rst-class:: classref-property-setget
  106. - void **set_navigation_layers** **(** :ref:`int<class_int>` value **)**
  107. - :ref:`int<class_int>` **get_navigation_layers** **(** **)**
  108. 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>`.
  109. .. rst-class:: classref-item-separator
  110. ----
  111. .. _class_NavigationLink3D_property_start_position:
  112. .. rst-class:: classref-property
  113. :ref:`Vector3<class_Vector3>` **start_position** = ``Vector3(0, 0, 0)``
  114. .. rst-class:: classref-property-setget
  115. - void **set_start_position** **(** :ref:`Vector3<class_Vector3>` value **)**
  116. - :ref:`Vector3<class_Vector3>` **get_start_position** **(** **)**
  117. Starting position of the link.
  118. This position will search out the nearest polygon in the navigation mesh to attach to.
  119. The distance the link will search is controlled by :ref:`NavigationServer3D.map_set_link_connection_radius<class_NavigationServer3D_method_map_set_link_connection_radius>`.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _class_NavigationLink3D_property_travel_cost:
  123. .. rst-class:: classref-property
  124. :ref:`float<class_float>` **travel_cost** = ``1.0``
  125. .. rst-class:: classref-property-setget
  126. - void **set_travel_cost** **(** :ref:`float<class_float>` value **)**
  127. - :ref:`float<class_float>` **get_travel_cost** **(** **)**
  128. 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.
  129. .. rst-class:: classref-section-separator
  130. ----
  131. .. rst-class:: classref-descriptions-group
  132. Method Descriptions
  133. -------------------
  134. .. _class_NavigationLink3D_method_get_global_end_position:
  135. .. rst-class:: classref-method
  136. :ref:`Vector3<class_Vector3>` **get_global_end_position** **(** **)** |const|
  137. Returns the :ref:`end_position<class_NavigationLink3D_property_end_position>` that is relative to the link as a global position.
  138. .. rst-class:: classref-item-separator
  139. ----
  140. .. _class_NavigationLink3D_method_get_global_start_position:
  141. .. rst-class:: classref-method
  142. :ref:`Vector3<class_Vector3>` **get_global_start_position** **(** **)** |const|
  143. Returns the :ref:`start_position<class_NavigationLink3D_property_start_position>` that is relative to the link as a global position.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _class_NavigationLink3D_method_get_navigation_layer_value:
  147. .. rst-class:: classref-method
  148. :ref:`bool<class_bool>` **get_navigation_layer_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  149. 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.
  150. .. rst-class:: classref-item-separator
  151. ----
  152. .. _class_NavigationLink3D_method_get_rid:
  153. .. rst-class:: classref-method
  154. :ref:`RID<class_RID>` **get_rid** **(** **)** |const|
  155. Returns the :ref:`RID<class_RID>` of this link on the :ref:`NavigationServer3D<class_NavigationServer3D>`.
  156. .. rst-class:: classref-item-separator
  157. ----
  158. .. _class_NavigationLink3D_method_set_global_end_position:
  159. .. rst-class:: classref-method
  160. void **set_global_end_position** **(** :ref:`Vector3<class_Vector3>` position **)**
  161. Sets the :ref:`end_position<class_NavigationLink3D_property_end_position>` that is relative to the link from a global ``position``.
  162. .. rst-class:: classref-item-separator
  163. ----
  164. .. _class_NavigationLink3D_method_set_global_start_position:
  165. .. rst-class:: classref-method
  166. void **set_global_start_position** **(** :ref:`Vector3<class_Vector3>` position **)**
  167. Sets the :ref:`start_position<class_NavigationLink3D_property_start_position>` that is relative to the link from a global ``position``.
  168. .. rst-class:: classref-item-separator
  169. ----
  170. .. _class_NavigationLink3D_method_set_navigation_layer_value:
  171. .. rst-class:: classref-method
  172. void **set_navigation_layer_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  173. 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.
  174. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  175. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  176. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  177. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  178. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  179. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  180. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`