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...
NavigationPathQueryParameters3D
實驗性: This class may be changed or removed in future versions.
繼承: RefCounted < Object
為 3D 導覽路徑查詢提供參數。
說明
更改該物件的起始和結束位置等屬性可以配置對 NavigationServer3D 的路徑查詢。
教學
屬性
|
||
|
||
|
||
BitField[PathMetadataFlags] |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
列舉
enum PathfindingAlgorithm: 🔗
PathfindingAlgorithm PATHFINDING_ALGORITHM_ASTAR = 0
路徑查詢使用預設的 A* 尋路演算法。
enum PathPostProcessing: 🔗
PathPostProcessing PATH_POSTPROCESSING_CORRIDORFUNNEL = 0
將漏斗演算法套用於尋路演算法找到的原始路徑走廊。這將導致最短路徑可能在路徑走廊內。該後處理在很大程度上取決於導覽網格多邊形佈局和建立的走廊。特別是基於圖塊和網格的佈局,可能會由於儲存格形狀強加的鋸齒狀的路徑走廊,而面臨對角線移動的人工角落。
PathPostProcessing PATH_POSTPROCESSING_EDGECENTERED = 1
將路徑上的所有位置在經過的導覽網格多邊形邊緣上居中。這樣就把移動限制在了單元格的中心,能夠為基於圖塊或柵格的佈局建立更好的路徑。
PathPostProcessing PATH_POSTPROCESSING_NONE = 2
Applies no postprocessing and returns the raw path corridor as found by the pathfinding algorithm.
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
包含關於返回路徑的所有可用中繼資料。
屬性說明
Array[RID] excluded_regions = [] 🔗
The list of region RIDs that will be excluded from the path query. Use NavigationRegion3D.get_rid() to get the RID associated with a NavigationRegion3D 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 NavigationRegion3D.get_rid() to get the RID associated with a NavigationRegion3D 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.
The navigation map RID used in the path query.
BitField[PathMetadataFlags] metadata_flags = 7 🔗
void set_metadata_flags(value: BitField[PathMetadataFlags])
BitField[PathMetadataFlags] get_metadata_flags()
包含在導覽路徑中的額外資訊。
查詢所使用的導覽層(形式為位元遮罩)。
PathPostProcessing path_postprocessing = 0 🔗
void set_path_postprocessing(value: PathPostProcessing)
PathPostProcessing get_path_postprocessing()
對 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 sphere shaped clip operation on the path with the first path position being the sphere'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()
路徑查詢中使用的尋路演算法。
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".
Vector3 start_position = Vector3(0, 0, 0) 🔗
尋路起始點,使用全域座標。
Vector3 target_position = Vector3(0, 0, 0) 🔗
尋路目標點,使用全域座標。