Files
godot-docs-l10n/classes/fr/class_navigationpathqueryparameters2d.rst
2025-12-19 14:34:07 +01:00

452 lines
25 KiB
ReStructuredText
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. _class_NavigationPathQueryParameters2D:
NavigationPathQueryParameters2D
===============================
**Expérimental:** This class may be changed or removed in future versions.
**Hérite de:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
Fournit des paramètres pour des requêtes de chemin de navigation 2D.
.. rst-class:: classref-introduction-group
Description
-----------
En changeant diverses propriétés de cet objet, comme la position de démarrage et cible, vous pouvez configurer des requêtes de chemin au :ref:`NavigationServer2D<class_NavigationServer2D>`.
.. rst-class:: classref-introduction-group
Tutoriels
------------------
- :doc:`Utilisation de NavigationPathQueryObjects <../tutorials/navigation/navigation_using_navigationpathqueryobjects>`
.. rst-class:: classref-reftable-group
Propriétés
--------------------
.. table::
:widths: auto
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`excluded_regions<class_NavigationPathQueryParameters2D_property_excluded_regions>` | ``[]`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`included_regions<class_NavigationPathQueryParameters2D_property_included_regions>` | ``[]`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`RID<class_RID>` | :ref:`map<class_NavigationPathQueryParameters2D_property_map>` | ``RID()`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| |bitfield|\[:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`\] | :ref:`metadata_flags<class_NavigationPathQueryParameters2D_property_metadata_flags>` | ``7`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`int<class_int>` | :ref:`navigation_layers<class_NavigationPathQueryParameters2D_property_navigation_layers>` | ``1`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` | :ref:`path_postprocessing<class_NavigationPathQueryParameters2D_property_path_postprocessing>` | ``0`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`float<class_float>` | :ref:`path_return_max_length<class_NavigationPathQueryParameters2D_property_path_return_max_length>` | ``0.0`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`float<class_float>` | :ref:`path_return_max_radius<class_NavigationPathQueryParameters2D_property_path_return_max_radius>` | ``0.0`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`float<class_float>` | :ref:`path_search_max_distance<class_NavigationPathQueryParameters2D_property_path_search_max_distance>` | ``0.0`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`int<class_int>` | :ref:`path_search_max_polygons<class_NavigationPathQueryParameters2D_property_path_search_max_polygons>` | ``4096`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>` | :ref:`pathfinding_algorithm<class_NavigationPathQueryParameters2D_property_pathfinding_algorithm>` | ``0`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`float<class_float>` | :ref:`simplify_epsilon<class_NavigationPathQueryParameters2D_property_simplify_epsilon>` | ``0.0`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`bool<class_bool>` | :ref:`simplify_path<class_NavigationPathQueryParameters2D_property_simplify_path>` | ``false`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`start_position<class_NavigationPathQueryParameters2D_property_start_position>` | ``Vector2(0, 0)`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`target_position<class_NavigationPathQueryParameters2D_property_target_position>` | ``Vector2(0, 0)`` |
+------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+-------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Énumérations
------------------------
.. _enum_NavigationPathQueryParameters2D_PathfindingAlgorithm:
.. rst-class:: classref-enumeration
enum **PathfindingAlgorithm**: :ref:`🔗<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>`
.. _class_NavigationPathQueryParameters2D_constant_PATHFINDING_ALGORITHM_ASTAR:
.. rst-class:: classref-enumeration-constant
:ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>` **PATHFINDING_ALGORITHM_ASTAR** = ``0``
The path query uses the default A\* pathfinding algorithm.
.. rst-class:: classref-item-separator
----
.. _enum_NavigationPathQueryParameters2D_PathPostProcessing:
.. rst-class:: classref-enumeration
enum **PathPostProcessing**: :ref:`🔗<enum_NavigationPathQueryParameters2D_PathPostProcessing>`
.. _class_NavigationPathQueryParameters2D_constant_PATH_POSTPROCESSING_CORRIDORFUNNEL:
.. rst-class:: classref-enumeration-constant
:ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **PATH_POSTPROCESSING_CORRIDORFUNNEL** = ``0``
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.
.. _class_NavigationPathQueryParameters2D_constant_PATH_POSTPROCESSING_EDGECENTERED:
.. rst-class:: classref-enumeration-constant
:ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **PATH_POSTPROCESSING_EDGECENTERED** = ``1``
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.
.. _class_NavigationPathQueryParameters2D_constant_PATH_POSTPROCESSING_NONE:
.. rst-class:: classref-enumeration-constant
:ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **PATH_POSTPROCESSING_NONE** = ``2``
Applies no postprocessing and returns the raw path corridor as found by the pathfinding algorithm.
.. rst-class:: classref-item-separator
----
.. _enum_NavigationPathQueryParameters2D_PathMetadataFlags:
.. rst-class:: classref-enumeration
flags **PathMetadataFlags**: :ref:`🔗<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`
.. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_NONE:
.. rst-class:: classref-enumeration-constant
:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_NONE** = ``0``
Don't include any additional metadata about the returned path.
.. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_TYPES:
.. rst-class:: classref-enumeration-constant
:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_TYPES** = ``1``
Include the type of navigation primitive (region or link) that each point of the path goes through.
.. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_RIDS:
.. rst-class:: classref-enumeration-constant
:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_RIDS** = ``2``
Include the :ref:`RID<class_RID>`\ s of the regions and links that each point of the path goes through.
.. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_OWNERS:
.. rst-class:: classref-enumeration-constant
:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_OWNERS** = ``4``
Include the ``ObjectID``\ s of the :ref:`Object<class_Object>`\ s which manage the regions and links each point of the path goes through.
.. _class_NavigationPathQueryParameters2D_constant_PATH_METADATA_INCLUDE_ALL:
.. rst-class:: classref-enumeration-constant
:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>` **PATH_METADATA_INCLUDE_ALL** = ``7``
Inclure toutes les métadonnées disponibles sur le chemin renvoyé.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Descriptions des propriétés
------------------------------------------------------
.. _class_NavigationPathQueryParameters2D_property_excluded_regions:
.. rst-class:: classref-property
:ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **excluded_regions** = ``[]`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_excluded_regions>`
.. rst-class:: classref-property-setget
- |void| **set_excluded_regions**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\]\ )
- :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **get_excluded_regions**\ (\ )
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.
\ **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.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_included_regions:
.. rst-class:: classref-property
:ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **included_regions** = ``[]`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_included_regions>`
.. rst-class:: classref-property-setget
- |void| **set_included_regions**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\]\ )
- :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **get_included_regions**\ (\ )
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.
\ **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.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_map:
.. rst-class:: classref-property
:ref:`RID<class_RID>` **map** = ``RID()`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_map>`
.. rst-class:: classref-property-setget
- |void| **set_map**\ (\ value\: :ref:`RID<class_RID>`\ )
- :ref:`RID<class_RID>` **get_map**\ (\ )
The navigation map :ref:`RID<class_RID>` used in the path query.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_metadata_flags:
.. rst-class:: classref-property
|bitfield|\[:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`\] **metadata_flags** = ``7`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_metadata_flags>`
.. rst-class:: classref-property-setget
- |void| **set_metadata_flags**\ (\ value\: |bitfield|\[:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`\]\ )
- |bitfield|\[:ref:`PathMetadataFlags<enum_NavigationPathQueryParameters2D_PathMetadataFlags>`\] **get_metadata_flags**\ (\ )
Informations supplémentaires à inclure avec le chemin de navigation.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_navigation_layers:
.. rst-class:: classref-property
:ref:`int<class_int>` **navigation_layers** = ``1`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_navigation_layers>`
.. rst-class:: classref-property-setget
- |void| **set_navigation_layers**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_navigation_layers**\ (\ )
The navigation layers the query will use (as a bitmask).
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_path_postprocessing:
.. rst-class:: classref-property
:ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **path_postprocessing** = ``0`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_path_postprocessing>`
.. rst-class:: classref-property-setget
- |void| **set_path_postprocessing**\ (\ value\: :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>`\ )
- :ref:`PathPostProcessing<enum_NavigationPathQueryParameters2D_PathPostProcessing>` **get_path_postprocessing**\ (\ )
Le post-traitement du chemin appliqué au couloir de chemin brut trouvé par :ref:`pathfinding_algorithm<class_NavigationPathQueryParameters2D_property_pathfinding_algorithm>`.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_path_return_max_length:
.. rst-class:: classref-property
:ref:`float<class_float>` **path_return_max_length** = ``0.0`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_path_return_max_length>`
.. rst-class:: classref-property-setget
- |void| **set_path_return_max_length**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_path_return_max_length**\ (\ )
The maximum allowed length of the returned path in world units. A path will be clipped when going over this length. A value of ``0`` or below counts as disabled.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_path_return_max_radius:
.. rst-class:: classref-property
:ref:`float<class_float>` **path_return_max_radius** = ``0.0`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_path_return_max_radius>`
.. rst-class:: classref-property-setget
- |void| **set_path_return_max_radius**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_path_return_max_radius**\ (\ )
The maximum allowed radius in world units that the returned path can be from the path start. The path will be clipped when going over this radius. A value of ``0`` or below counts as disabled.
\ **Note:** This will perform a circle shaped clip operation on the path with the first path position being the circle's center position.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_path_search_max_distance:
.. rst-class:: classref-property
:ref:`float<class_float>` **path_search_max_distance** = ``0.0`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_path_search_max_distance>`
.. rst-class:: classref-property-setget
- |void| **set_path_search_max_distance**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_path_search_max_distance**\ (\ )
The maximum distance a searched polygon can be away from the start polygon before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest to the target position so far. A value of ``0`` or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_path_search_max_polygons:
.. rst-class:: classref-property
:ref:`int<class_int>` **path_search_max_polygons** = ``4096`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_path_search_max_polygons>`
.. rst-class:: classref-property-setget
- |void| **set_path_search_max_polygons**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_path_search_max_polygons**\ (\ )
The maximum number of polygons that are searched before the pathfinding cancels the search for a path to the (possibly unreachable or very far away) target position polygon. In this case the pathfinding resets and builds a path from the start polygon to the polygon that was found closest to the target position so far. A value of ``0`` or below counts as unlimited. In case of unlimited the pathfinding will search all polygons connected with the start polygon until either the target position polygon is found or all available polygon search options are exhausted.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_pathfinding_algorithm:
.. rst-class:: classref-property
:ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>` **pathfinding_algorithm** = ``0`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_pathfinding_algorithm>`
.. rst-class:: classref-property-setget
- |void| **set_pathfinding_algorithm**\ (\ value\: :ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>`\ )
- :ref:`PathfindingAlgorithm<enum_NavigationPathQueryParameters2D_PathfindingAlgorithm>` **get_pathfinding_algorithm**\ (\ )
L'algorithme de recherche de chemin utilisé dans la recherche de chemin.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_simplify_epsilon:
.. rst-class:: classref-property
:ref:`float<class_float>` **simplify_epsilon** = ``0.0`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_simplify_epsilon>`
.. rst-class:: classref-property-setget
- |void| **set_simplify_epsilon**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_simplify_epsilon**\ (\ )
Le montant de simplification du chemin en unités du monde.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_simplify_path:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **simplify_path** = ``false`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_simplify_path>`
.. rst-class:: classref-property-setget
- |void| **set_simplify_path**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **get_simplify_path**\ (\ )
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.
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".
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_start_position:
.. rst-class:: classref-property
:ref:`Vector2<class_Vector2>` **start_position** = ``Vector2(0, 0)`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_start_position>`
.. rst-class:: classref-property-setget
- |void| **set_start_position**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
- :ref:`Vector2<class_Vector2>` **get_start_position**\ (\ )
The pathfinding start position in global coordinates.
.. rst-class:: classref-item-separator
----
.. _class_NavigationPathQueryParameters2D_property_target_position:
.. rst-class:: classref-property
:ref:`Vector2<class_Vector2>` **target_position** = ``Vector2(0, 0)`` :ref:`🔗<class_NavigationPathQueryParameters2D_property_target_position>`
.. rst-class:: classref-property-setget
- |void| **set_target_position**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
- :ref:`Vector2<class_Vector2>` **get_target_position**\ (\ )
The pathfinding target position in global coordinates.
.. |virtual| replace:: :abbr:`virtual (Cette méthode doit typiquement être redéfinie par l'utilisateur pour avoir un effet.)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (Cette méthode n'a pas d'effets de bord. Elle ne modifie aucune des variables membres de l'instance.)`
.. |vararg| replace:: :abbr:`vararg (Cette méthode accepte n'importe quel nombre d'arguments après ceux décris ici.)`
.. |constructor| replace:: :abbr:`constructor (Cette méthode est utilisée pour construire un type.)`
.. |static| replace:: :abbr:`static (Cette méthode n'a pas besoin d'instance pour être appelée, elle peut donc être directement appelée en utilisant le nom de la classe.)`
.. |operator| replace:: :abbr:`operator (Cette méthode décrit un opérateur valide à utiliser avec ce type en tant qu'opérande gauche.)`
.. |bitfield| replace:: :abbr:`BitField (Cette valeur est un nombre entier composé d'un masque de bits des options suivantes.)`
.. |void| replace:: :abbr:`void (Aucune valeur de retour.)`