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¶
继承: RefCounted < Object
为 2D 导航路径查询提供参数。
描述¶
更改该对象的起始和结束位置等属性可以配置对 NavigationServer2D 的路径查询。
教程¶
属性¶
|
||
BitField<PathMetadataFlags> |
|
|
|
||
|
||
|
||
|
||
|
枚举¶
enum PathfindingAlgorithm:
PathfindingAlgorithm PATHFINDING_ALGORITHM_ASTAR = 0
路径查询使用默认的 A* 寻路算法。
enum PathPostProcessing:
PathPostProcessing PATH_POSTPROCESSING_CORRIDORFUNNEL = 0
将漏斗算法应用于寻路算法找到的原始路径走廊。这将导致最短路径可能在路径走廊内。该后处理在很大程度上取决于导航网格多边形布局和创建的走廊。特别是基于图块和网格的布局,可能会由于单元格形状强加的锯齿状的路径走廊,而面临对角线移动的人工角落。
PathPostProcessing PATH_POSTPROCESSING_EDGECENTERED = 1
将路径上的所有位置在经过的导航网格多边形边缘上居中。这样就把移动限制在了单元格的中心,能够为基于图块或栅格的布局创建更好的路径。
flags PathMetadataFlags:
PathMetadataFlags PATH_METADATA_INCLUDE_NONE = 0
不要包含任何关于返回路径的额外元数据。
PathMetadataFlags PATH_METADATA_INCLUDE_TYPES = 1
包含路径上的各个点所经过的导航图元类型(地区或链接)。
PathMetadataFlags PATH_METADATA_INCLUDE_RIDS = 2
包含路径上的各个点所经过的地区和链接的 RID。
PathMetadataFlags PATH_METADATA_INCLUDE_OWNERS = 4
包含管理路径上的各个点所经过的地区和链接的 Object 的 ObjectID
。
PathMetadataFlags PATH_METADATA_INCLUDE_ALL = 7
包含关于返回路径的所有可用元数据。
属性说明¶
RID map = RID()
在路径查询中使用的导航地图 RID。
BitField<PathMetadataFlags> metadata_flags = 7
void set_metadata_flags ( BitField<PathMetadataFlags> value )
BitField<PathMetadataFlags> get_metadata_flags ( )
包含在导航路径中的额外信息。
int navigation_layers = 1
查询所使用的导航层(形式为位掩码)。
PathPostProcessing path_postprocessing = 0
void set_path_postprocessing ( PathPostProcessing value )
PathPostProcessing get_path_postprocessing ( )
对 pathfinding_algorithm 找到的原始路径走廊应用的路径后期处理。
PathfindingAlgorithm pathfinding_algorithm = 0
void set_pathfinding_algorithm ( PathfindingAlgorithm value )
PathfindingAlgorithm get_pathfinding_algorithm ( )
路径查询中使用的寻路算法。
Vector2 start_position = Vector2(0, 0)
寻路起始点,使用全局坐标。
Vector2 target_position = Vector2(0, 0)
寻路目标点,使用全局坐标。