NavigationPathQueryParameters2D
Provides parameters for 2D navigation path queries.
Provides parameters for 2D navigation path queries.
By changing various properties of this object, such as the start and target position, you can configure path queries to the NavigationServer2D.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
NavigationPathQueryParameters2DConstructor
public NavigationPathQueryParameters2D();Properties15
ExcludedRegionsProperty
public Reckfell.Collections.Array<Rid> ExcludedRegions { get; set; }Region RIDs omitted from the query. A region that is both included and excluded is not used. The filter remains in the parameters object until changed or cleared.
IncludedRegionsProperty
public Reckfell.Collections.Array<Rid> IncludedRegions { get; set; }A nonempty list admits only listed regions; ExcludedRegions takes precedence. Installed 1.0.0 limitation: such a list blocks the tested NavigationLink route even with both connected regions included. For that case, leave it empty and verify layer-based access restrictions.
MapProperty
public Rid Map { get; set; }RID of the live navigation map to query. A new map must be published by the server before querying; a nonzero iteration ID does not guarantee that the latest changes have synchronized. Do not use a freed RID.
MetadataFlagsProperty
public NavigationPathQueryParameters2D.PathMetadataFlags MetadataFlags { get; set; }Selects point metadata: types, RIDs and owner IDs. Defaults to All; None disables collection. Read the corresponding array only when its flag is enabled; a checked repeated query with None clears previous metadata arrays.
NavigationLayersProperty
public uint NavigationLayers { get; set; }Unsigned 32-bit mask of allowed navigation layers. Layer N is bit 1u << (N - 1), for N from 1 to 32. A region is eligible when masks overlap; zero admits no region. Does not define physics collisions or agent clearance.
PathPostprocessingProperty
public NavigationPathQueryParameters2D.PathPostProcessing PathPostprocessing { get; set; }Processes the found corridor: Corridorfunnel shortens the path within it, Edgecentered uses crossed-edge centers, and None leaves the raw variant. Does not select another globally shortest corridor.
PathReturnMaxLengthProperty
public float PathReturnMaxLength { get; set; }Clips the returned path to this length after searching; zero disables the limit. A clipped path may not reach the target. Limits output rather than the search budget.
PathReturnMaxRadiusProperty
public float PathReturnMaxRadius { get; set; }Clips output by a radius around the start; zero disables the limit. The endpoint can intentionally remain short of the target. Does not replace a path-length limit along turns.
PathSearchMaxDistanceProperty
public float PathSearchMaxDistance { get; set; }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.
PathSearchMaxPolygonsProperty
public int PathSearchMaxPolygons { get; set; }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.
PathfindingAlgorithmProperty
public NavigationPathQueryParameters2D.PathfindingAlgorithmEnum PathfindingAlgorithm { get; set; }The pathfinding algorithm used in the path query.
SimplifyEpsilonProperty
public float SimplifyEpsilon { get; set; }Simplification tolerance when SimplifyPath is enabled, in map coordinate units. It is not the acceptable distance to a gameplay target.
SimplifyPathProperty
public bool SimplifyPath { get; set; }Enables additional path simplification using SimplifyEpsilon. Check removed points on your geometry; preserving endpoints in a simple fixture does not establish quality on a complex level.
StartPositionProperty
public Vector2 StartPosition { get; set; }Start in navigation-map global coordinates. The query may project it onto an allowed polygon: check the first returned point when the requested start must be preserved.
TargetPositionProperty
public Vector2 TargetPosition { get; set; }Target in map-global coordinates. A nonempty result may end at an accessible boundary instead of the target; compare its last point against the target using your game tolerance.
Methods30
GetExcludedRegionsReckfell.Collections.Array<Rid>
public Reckfell.Collections.Array<Rid> GetExcludedRegions();Reckfell.Collections.Array<Rid>GetIncludedRegionsReckfell.Collections.Array<Rid>
public Reckfell.Collections.Array<Rid> GetIncludedRegions();Reckfell.Collections.Array<Rid>GetMapRid
public Rid GetMap();RidGetMetadataFlagsNavigationPathQueryParameters2D.PathMetadataFlags
public NavigationPathQueryParameters2D.PathMetadataFlags GetMetadataFlags();NavigationPathQueryParameters2D.PathMetadataFlagsGetNavigationLayersuint
public uint GetNavigationLayers();uintGetPathPostprocessingNavigationPathQueryParameters2D.PathPostProcessing
public NavigationPathQueryParameters2D.PathPostProcessing GetPathPostprocessing();NavigationPathQueryParameters2D.PathPostProcessingGetPathReturnMaxLengthfloat
public float GetPathReturnMaxLength();floatGetPathReturnMaxRadiusfloat
public float GetPathReturnMaxRadius();floatGetPathSearchMaxDistancefloat
public float GetPathSearchMaxDistance();floatGetPathSearchMaxPolygonsint
public int GetPathSearchMaxPolygons();intGetPathfindingAlgorithmNavigationPathQueryParameters2D.PathfindingAlgorithmEnum
public NavigationPathQueryParameters2D.PathfindingAlgorithmEnum GetPathfindingAlgorithm();NavigationPathQueryParameters2D.PathfindingAlgorithmEnumGetSimplifyEpsilonfloat
public float GetSimplifyEpsilon();floatGetSimplifyPathbool
public bool GetSimplifyPath();boolGetStartPositionVector2
public Vector2 GetStartPosition();Vector2GetTargetPositionVector2
public Vector2 GetTargetPosition();Vector2SetExcludedRegionsvoid
public void SetExcludedRegions(Reckfell.Collections.Array<Rid> regions);| Name | Type | Default |
|---|---|---|
regions | Reckfell.Collections.Array<Rid> | — |
SetIncludedRegionsvoid
public void SetIncludedRegions(Reckfell.Collections.Array<Rid> regions);| Name | Type | Default |
|---|---|---|
regions | Reckfell.Collections.Array<Rid> | — |
SetMapvoid
public void SetMap(Rid map);| Name | Type | Default |
|---|---|---|
map | Rid | — |
SetMetadataFlagsvoid
public void SetMetadataFlags(NavigationPathQueryParameters2D.PathMetadataFlags flags);| Name | Type | Default |
|---|---|---|
flags | NavigationPathQueryParameters2D.PathMetadataFlags | — |
SetNavigationLayersvoid
public void SetNavigationLayers(uint navigationLayers);| Name | Type | Default |
|---|---|---|
navigationLayers | uint | — |
SetPathPostprocessingvoid
public void SetPathPostprocessing(NavigationPathQueryParameters2D.PathPostProcessing pathPostprocessing);| Name | Type | Default |
|---|---|---|
pathPostprocessing | NavigationPathQueryParameters2D.PathPostProcessing | — |
SetPathReturnMaxLengthvoid
public void SetPathReturnMaxLength(float length);| Name | Type | Default |
|---|---|---|
length | float | — |
SetPathReturnMaxRadiusvoid
public void SetPathReturnMaxRadius(float radius);| Name | Type | Default |
|---|---|---|
radius | float | — |
SetPathSearchMaxDistancevoid
public void SetPathSearchMaxDistance(float distance);| Name | Type | Default |
|---|---|---|
distance | float | — |
SetPathSearchMaxPolygonsvoid
public void SetPathSearchMaxPolygons(int maxPolygons);| Name | Type | Default |
|---|---|---|
maxPolygons | int | — |
SetPathfindingAlgorithmvoid
public void SetPathfindingAlgorithm(NavigationPathQueryParameters2D.PathfindingAlgorithmEnum pathfindingAlgorithm);| Name | Type | Default |
|---|---|---|
pathfindingAlgorithm | NavigationPathQueryParameters2D.PathfindingAlgorithmEnum | — |
SetSimplifyEpsilonvoid
public void SetSimplifyEpsilon(float epsilon);| Name | Type | Default |
|---|---|---|
epsilon | float | — |
SetSimplifyPathvoid
public void SetSimplifyPath(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetStartPositionvoid
public void SetStartPosition(Vector2 startPosition);| Name | Type | Default |
|---|---|---|
startPosition | Vector2 | — |
SetTargetPositionvoid
public void SetTargetPosition(Vector2 targetPosition);| Name | Type | Default |
|---|---|---|
targetPosition | Vector2 | — |
NavigationPathQueryParameters2D.PathMetadataFlags
| Value | Description |
|---|---|
All = 7 | Include all available metadata about the returned path. |
None = 0 | Don't include any additional metadata about the returned path. |
Owners = 4 | Include the |
Rids = 2 | Include the |
Types = 1 | Include the type of navigation primitive (region or link) that each point of the path goes through. |
NavigationPathQueryParameters2D.PathPostProcessing
| Value | Description |
|---|---|
Corridorfunnel = 0 | Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. |
Edgecentered = 1 | Centers every position in the middle of the traveled navigation mesh's polygon edge. This creates better paths for tile- or grid-based layouts that restrict the movement to the cells' centers. |
None = 2 | Applies no postprocessing and returns the raw path corridor as found by the pathfinding algorithm. |
NavigationPathQueryParameters2D.PathfindingAlgorithmEnum
| Value | Description |
|---|---|
Astar = 0 | The path query uses the default A* pathfinding algorithm. |