class_navigationpathqueryparameters2d.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  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/NavigationPathQueryParameters2D.xml.
  6. .. _class_NavigationPathQueryParameters2D:
  7. NavigationPathQueryParameters2D
  8. ===============================
  9. **Experimental:** This class may be changed or removed in future versions.
  10. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  11. Provides parameters for 2D navigation path queries.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. By changing various properties of this object, such as the start and target position, you can configure path queries to the :ref:`NavigationServer2D<class_NavigationServer2D>`.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Using NavigationPathQueryObjects <../tutorials/navigation/navigation_using_navigationpathqueryobjects>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  26. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`excluded_regions<class_NavigationPathQueryParameters2D_property_excluded_regions>` | ``[]`` |
  27. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  28. | :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`included_regions<class_NavigationPathQueryParameters2D_property_included_regions>` | ``[]`` |
  29. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  30. | :ref:`RID<class_RID>` | :ref:`map<class_NavigationPathQueryParameters2D_property_map>` | ``RID()`` |
  31. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  32. | |bitfield|\[:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`\] | :ref:`metadata_flags<class_NavigationPathQueryParameters2D_property_metadata_flags>` | ``7`` |
  33. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  34. | :ref:`int<class_int>` | :ref:`navigation_layers<class_NavigationPathQueryParameters2D_property_navigation_layers>` | ``1`` |
  35. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  36. | :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` | :ref:`path_postprocessing<class_NavigationPathQueryParameters2D_property_path_postprocessing>` | ``0`` |
  37. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  38. | :ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>` | :ref:`pathfinding_algorithm<class_NavigationPathQueryParameters2D_property_pathfinding_algorithm>` | ``0`` |
  39. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  40. | :ref:`float<class_float>` | :ref:`simplify_epsilon<class_NavigationPathQueryParameters2D_property_simplify_epsilon>` | ``0.0`` |
  41. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  42. | :ref:`bool<class_bool>` | :ref:`simplify_path<class_NavigationPathQueryParameters2D_property_simplify_path>` | ``false`` |
  43. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  44. | :ref:`Vector2<class_Vector2>` | :ref:`start_position<class_NavigationPathQueryParameters2D_property_start_position>` | ``Vector2(0, 0)`` |
  45. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  46. | :ref:`Vector2<class_Vector2>` | :ref:`target_position<class_NavigationPathQueryParameters2D_property_target_position>` | ``Vector2(0, 0)`` |
  47. +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------+
  48. .. rst-class:: classref-section-separator
  49. ----
  50. .. rst-class:: classref-descriptions-group
  51. Enumerations
  52. ------------
  53. .. _enum_NavigationPathQueryParameters2D_PathfindingAlgorithm:
  54. .. rst-class:: classref-enumeration
  55. enum **PathfindingAlgorithm**: :ref:`🔗<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>`
  56. .. _class_NavigationPathQueryParameters2D_constant_PATHFINDING_ALGORITHM_ASTAR:
  57. .. rst-class:: classref-enumeration-constant
  58. :ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>` **PATHFINDING_ALGORITHM_ASTAR** = ``0``
  59. The path query uses the default A\* pathfinding algorithm.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _enum_NavigationPathQueryParameters2D_PathPostProcessing:
  63. .. rst-class:: classref-enumeration
  64. enum **PathPostProcessing**: :ref:`🔗<enum_NavigationPathQueryParameters2D_PathPostProcessing>`
  65. .. _class_NavigationPathQueryParameters2D_constant_PATH_POSTPROCESSING_CORRIDORFUNNEL:
  66. .. rst-class:: classref-enumeration-constant
  67. :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **PATH_POSTPROCESSING_CORRIDORFUNNEL** = ``0``
  68. Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes.
  69. .. _class_NavigationPathQueryParameters2D_constant_PATH_POSTPROCESSING_EDGECENTERED:
  70. .. rst-class:: classref-enumeration-constant
  71. :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **PATH_POSTPROCESSING_EDGECENTERED** = ``1``
  72. Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center.
  73. .. _class_NavigationPathQueryParameters2D_constant_PATH_POSTPROCESSING_NONE:
  74. .. rst-class:: classref-enumeration-constant
  75. :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **PATH_POSTPROCESSING_NONE** = ``2``
  76. Applies no postprocessing and returns the raw path corridor as found by the pathfinding algorithm.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _enum_NavigationPathQueryParameters2D_PathMetadataFlags:
  80. .. rst-class:: classref-enumeration
  81. flags **PathMetadataFlags**: :ref:`🔗<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`
  82. .. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_NONE:
  83. .. rst-class:: classref-enumeration-constant
  84. :ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_NONE** = ``0``
  85. Don't include any additional metadata about the returned path.
  86. .. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_TYPES:
  87. .. rst-class:: classref-enumeration-constant
  88. :ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_TYPES** = ``1``
  89. Include the type of navigation primitive (region or link) that each point of the path goes through.
  90. .. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_RIDS:
  91. .. rst-class:: classref-enumeration-constant
  92. :ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_RIDS** = ``2``
  93. Include the :ref:`RID<class_RID>`\ s of the regions and links that each point of the path goes through.
  94. .. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_OWNERS:
  95. .. rst-class:: classref-enumeration-constant
  96. :ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_OWNERS** = ``4``
  97. Include the ``ObjectID``\ s of the :ref:`Object<class_Object>`\ s which manage the regions and links each point of the path goes through.
  98. .. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_ALL:
  99. .. rst-class:: classref-enumeration-constant
  100. :ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_ALL** = ``7``
  101. Include all available metadata about the returned path.
  102. .. rst-class:: classref-section-separator
  103. ----
  104. .. rst-class:: classref-descriptions-group
  105. Property Descriptions
  106. ---------------------
  107. .. _class_NavigationPathQueryParameters2D_property_excluded_regions:
  108. .. rst-class:: classref-property
  109. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **excluded_regions** = ``[]`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_excluded_regions>`
  110. .. rst-class:: classref-property-setget
  111. - |void| **set_excluded_regions**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\]\ )
  112. - :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **get_excluded_regions**\ (\ )
  113. The list of region :ref:`RID<class_RID>`\ s that will be excluded from the path query. Use :ref:`NavigationRegion2D.get_rid()<class_NavigationRegion2D_method_get_rid>` to get the :ref:`RID<class_RID>` associated with a :ref:`NavigationRegion2D<class_NavigationRegion2D>` node.
  114. \ **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then set it to the property again.
  115. .. rst-class:: classref-item-separator
  116. ----
  117. .. _class_NavigationPathQueryParameters2D_property_included_regions:
  118. .. rst-class:: classref-property
  119. :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **included_regions** = ``[]`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_included_regions>`
  120. .. rst-class:: classref-property-setget
  121. - |void| **set_included_regions**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\]\ )
  122. - :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **get_included_regions**\ (\ )
  123. The list of region :ref:`RID<class_RID>`\ s that will be included by the path query. Use :ref:`NavigationRegion2D.get_rid()<class_NavigationRegion2D_method_get_rid>` to get the :ref:`RID<class_RID>` associated with a :ref:`NavigationRegion2D<class_NavigationRegion2D>` node. If left empty all regions are included. If a region ends up being both included and excluded at the same time it will be excluded.
  124. \ **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then set it to the property again.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_NavigationPathQueryParameters2D_property_map:
  128. .. rst-class:: classref-property
  129. :ref:`RID<class_RID>` **map** = ``RID()`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_map>`
  130. .. rst-class:: classref-property-setget
  131. - |void| **set_map**\ (\ value\: :ref:`RID<class_RID>`\ )
  132. - :ref:`RID<class_RID>` **get_map**\ (\ )
  133. The navigation map :ref:`RID<class_RID>` used in the path query.
  134. .. rst-class:: classref-item-separator
  135. ----
  136. .. _class_NavigationPathQueryParameters2D_property_metadata_flags:
  137. .. rst-class:: classref-property
  138. |bitfield|\[:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`\] **metadata_flags** = ``7`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_metadata_flags>`
  139. .. rst-class:: classref-property-setget
  140. - |void| **set_metadata_flags**\ (\ value\: |bitfield|\[:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`\]\ )
  141. - |bitfield|\[:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`\] **get_metadata_flags**\ (\ )
  142. Additional information to include with the navigation path.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_NavigationPathQueryParameters2D_property_navigation_layers:
  146. .. rst-class:: classref-property
  147. :ref:`int<class_int>` **navigation_layers** = ``1`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_navigation_layers>`
  148. .. rst-class:: classref-property-setget
  149. - |void| **set_navigation_layers**\ (\ value\: :ref:`int<class_int>`\ )
  150. - :ref:`int<class_int>` **get_navigation_layers**\ (\ )
  151. The navigation layers the query will use (as a bitmask).
  152. .. rst-class:: classref-item-separator
  153. ----
  154. .. _class_NavigationPathQueryParameters2D_property_path_postprocessing:
  155. .. rst-class:: classref-property
  156. :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **path_postprocessing** = ``0`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_path_postprocessing>`
  157. .. rst-class:: classref-property-setget
  158. - |void| **set_path_postprocessing**\ (\ value\: :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>`\ )
  159. - :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **get_path_postprocessing**\ (\ )
  160. The path postprocessing applied to the raw path corridor found by the :ref:`pathfinding_algorithm<class_NavigationPathQueryParameters2D_property_pathfinding_algorithm>`.
  161. .. rst-class:: classref-item-separator
  162. ----
  163. .. _class_NavigationPathQueryParameters2D_property_pathfinding_algorithm:
  164. .. rst-class:: classref-property
  165. :ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>` **pathfinding_algorithm** = ``0`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_pathfinding_algorithm>`
  166. .. rst-class:: classref-property-setget
  167. - |void| **set_pathfinding_algorithm**\ (\ value\: :ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>`\ )
  168. - :ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>` **get_pathfinding_algorithm**\ (\ )
  169. The pathfinding algorithm used in the path query.
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_NavigationPathQueryParameters2D_property_simplify_epsilon:
  173. .. rst-class:: classref-property
  174. :ref:`float<class_float>` **simplify_epsilon** = ``0.0`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_simplify_epsilon>`
  175. .. rst-class:: classref-property-setget
  176. - |void| **set_simplify_epsilon**\ (\ value\: :ref:`float<class_float>`\ )
  177. - :ref:`float<class_float>` **get_simplify_epsilon**\ (\ )
  178. The path simplification amount in worlds units.
  179. .. rst-class:: classref-item-separator
  180. ----
  181. .. _class_NavigationPathQueryParameters2D_property_simplify_path:
  182. .. rst-class:: classref-property
  183. :ref:`bool<class_bool>` **simplify_path** = ``false`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_simplify_path>`
  184. .. rst-class:: classref-property-setget
  185. - |void| **set_simplify_path**\ (\ value\: :ref:`bool<class_bool>`\ )
  186. - :ref:`bool<class_bool>` **get_simplify_path**\ (\ )
  187. If ``true`` a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by :ref:`simplify_epsilon<class_NavigationPathQueryParameters2D_property_simplify_epsilon>`. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation.
  188. Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields".
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_NavigationPathQueryParameters2D_property_start_position:
  192. .. rst-class:: classref-property
  193. :ref:`Vector2<class_Vector2>` **start_position** = ``Vector2(0, 0)`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_start_position>`
  194. .. rst-class:: classref-property-setget
  195. - |void| **set_start_position**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  196. - :ref:`Vector2<class_Vector2>` **get_start_position**\ (\ )
  197. The pathfinding start position in global coordinates.
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_NavigationPathQueryParameters2D_property_target_position:
  201. .. rst-class:: classref-property
  202. :ref:`Vector2<class_Vector2>` **target_position** = ``Vector2(0, 0)`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_target_position>`
  203. .. rst-class:: classref-property-setget
  204. - |void| **set_target_position**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  205. - :ref:`Vector2<class_Vector2>` **get_target_position**\ (\ )
  206. The pathfinding target position in global coordinates.
  207. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  208. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  209. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  210. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  211. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  212. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  213. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  214. .. |void| replace:: :abbr:`void (No return value.)`