Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
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 = [] 🔗
La lista de RIDs de región que serán excluidos de la consulta de ruta. Usa NavigationRegion2D.get_rid() para obtener el RID asociado a un nodo NavigationRegion2D.
Nota: El array devuelto es copiado y cualquier cambio en él no actualizará el valor de la propiedad original. Para actualizar el valor, necesitas modificar el array devuelto y luego establecerlo de nuevo en la propiedad.
Array[RID] included_regions = [] 🔗
La lista de RIDs de región que serán incluidos por la consulta de ruta. Usa NavigationRegion2D.get_rid() para obtener el RID asociado a un nodo NavigationRegion2D. Si se deja vacío, se incluyen todas las regiones. Si una región termina siendo incluida y excluida al mismo tiempo, será excluida.
Nota: El array devuelto es copiado y cualquier cambio en él no actualizará el valor de la propiedad original. Para actualizar el valor, necesitas modificar el array devuelto y luego establecerlo de nuevo en la propiedad.
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()
Información adicional a incluir con la ruta de navegación.
Las capas de navegación que usará la consulta (como una máscara de bits).
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 🔗
La longitud máxima permitida de la ruta devuelta en unidades del mundo. Una ruta se cortará al exceder esta longitud. Un valor de 0 o inferior se considera deshabilitado.
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.
Si es true, se devolverá una versión simplificada del trayecto con menos puntos críticos de trayectos eliminados. La cantidad de simplificación se controla mediante simplify_epsilon. La simplificación utiliza una variante del algoritmo Ramer-Douglas-Peucker para la diezma de puntos de curva.
La simplificación de trayectos puede ser útil para mitigar varios problemas de seguimiento de trayectos que pueden surgir con ciertos tipos de agentes y comportamientos de script. Por ejemplo, agentes de "dirección" o evitación en "campos abiertos".
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.