NavigationPathQueryResult2D
Represents the result of a 2D pathfinding query.
Description
Section titled “Description”This class stores the result of a 2D navigation path query from the Navigation2D.
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
[]Vector2 | path | PackedVector2Array() |
| float | path_length | 0.0 |
[]int | path_owner_ids | PackedInt64Array() |
[]RID | path_rids | [] |
[]i32 | path_types | PackedInt32Array() |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| void | reset() |
Enumerations and constants
Section titled “Enumerations and constants”enum PathSegmentType
Section titled “enum PathSegmentType”- PATH_SEGMENT_TYPE_REGION =
0— This segment of the path goes through a region.
- PATH_SEGMENT_TYPE_LINK =
1— This segment of the path goes through a link.
Property descriptions
Section titled “Property descriptions”[]Vector2 path = PackedVector2Array()
Setter/getter: set_path(), get_path()
The resulting path array from the navigation query. All path array positions are in global coordinates. Without customized query parameters this is the same path as returned by Navigation2D.map_get_path().
path_length
Section titled “path_length”float path_length = 0.0
Setter/getter: set_path_length(), get_path_length()
Returns the length of the path.
path_owner_ids
Section titled “path_owner_ids”[]int path_owner_ids = PackedInt64Array()
Setter/getter: set_path_owner_ids(), get_path_owner_ids()
The ObjectIDs of the Objects which manage the regions and links each point of the path goes through.
path_rids
Section titled “path_rids”[]RID path_rids = []
Setter/getter: set_path_rids(), get_path_rids()
The RIDs of the regions and links that each point of the path goes through.
path_types
Section titled “path_types”[]i32 path_types = PackedInt32Array()
Setter/getter: set_path_types(), get_path_types()
The type of navigation primitive (region or link) that each point of the path goes through.
Method descriptions
Section titled “Method descriptions”void reset()
Reset the result object to its initial state. This is useful to reuse the object across multiple queries.