NavigationPathQueryParameters2D
Experimental: This class may be changed or removed in future versions.
Hereda: RefCounted < Object
Proporciona parámetros para consultas de ruta de navegación 2D.
Descripción
Al cambiar varias propiedades de este objeto, como la posición de inicio y de destino, puedes configurar consultas de ruta a NavigationServer2D.
Tutoriales
Propiedades
|
||
|
||
|
||
BitField[PathMetadataFlags] |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Enumeraciones
enum PathfindingAlgorithm: 🔗
PathfindingAlgorithm PATHFINDING_ALGORITHM_ASTAR = 0
The path query uses the default A* pathfinding algorithm.
enum PathPostProcessing: 🔗
PathPostProcessing PATH_POSTPROCESSING_CORRIDORFUNNEL = 0
Aplica un algoritmo de embudo al corredor de ruta sin procesar encontrado por el algoritmo de búsqueda de rutas. Esto resultará en la ruta más corta posible dentro del corredor de ruta. Este postprocesamiento depende mucho del diseño del polígono de la malla de navegación y del corredor creado. Especialmente los diseños basados en tiles o cuadrículas pueden enfrentar esquinas artificiales con movimiento diagonal debido a un corredor de ruta irregular impuesto por las formas de las celdas.
PathPostProcessing PATH_POSTPROCESSING_EDGECENTERED = 1
Centra cada posición de la ruta en el medio del borde del polígono de la malla de navegación recorrido. Esto crea mejores rutas para diseños basados en tiles o cuadrículas que restringen el movimiento al centro de las celdas.
PathPostProcessing PATH_POSTPROCESSING_NONE = 2
No aplica ningún postprocesamiento y devuelve el corredor de ruta sin procesar tal como lo encontró el algoritmo de búsqueda de rutas.
flags PathMetadataFlags: 🔗
PathMetadataFlags PATH_METADATA_INCLUDE_NONE = 0
No incluir metadatos adicionales sobre la ruta devuelta.
PathMetadataFlags PATH_METADATA_INCLUDE_TYPES = 1
Incluye el tipo de primitiva de navegación (región o enlace) por la que pasa cada punto de la ruta.
PathMetadataFlags PATH_METADATA_INCLUDE_RIDS = 2
Incluye los RIDs de las regiones y los enlaces por los que pasa cada punto de la ruta.
PathMetadataFlags PATH_METADATA_INCLUDE_OWNERS = 4
Incluye los ObjectIDs de los Objects que gestionan las regiones y los enlaces por los que pasa cada punto de la ruta.
PathMetadataFlags PATH_METADATA_INCLUDE_ALL = 7
Incluye todos los metadatos disponibles sobre la ruta devuelta.
Descripciones de Propiedades
Array[RID] excluded_regions = [] 🔗
The list of region RIDs that will be excluded from the path query. Use NavigationRegion2D.get_rid() to get the RID associated with a 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.
Array[RID] included_regions = [] 🔗
The list of region RIDs that will be included by the path query. Use NavigationRegion2D.get_rid() to get the RID associated with a 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.
El mapa de navegación RID utilizado en la consulta de ruta.
BitField[PathMetadataFlags] metadata_flags = 7 🔗
void set_metadata_flags(value: BitField[PathMetadataFlags])
BitField[PathMetadataFlags] get_metadata_flags()
Additional information to include with the navigation path.
The navigation layers the query will use (as a bitmask).
PathPostProcessing path_postprocessing = 0 🔗
void set_path_postprocessing(value: PathPostProcessing)
PathPostProcessing get_path_postprocessing()
The path postprocessing applied to the raw path corridor found by the pathfinding_algorithm.
float path_return_max_length = 0.0 🔗
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.
float path_return_max_radius = 0.0 🔗
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.
float path_search_max_distance = 0.0 🔗
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.
int path_search_max_polygons = 4096 🔗
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.
PathfindingAlgorithm pathfinding_algorithm = 0 🔗
void set_pathfinding_algorithm(value: PathfindingAlgorithm)
PathfindingAlgorithm get_pathfinding_algorithm()
The pathfinding algorithm used in the path query.
float simplify_epsilon = 0.0 🔗
The path simplification amount in worlds units.
If true a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by 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".
Vector2 start_position = Vector2(0, 0) 🔗
La posición de inicio de la búsqueda de ruta en coordenadas globales.
Vector2 target_position = Vector2(0, 0) 🔗
La posición del objetivo de búsqueda de rutas en coordenadas globales.