Class reference

NavigationPathQueryParameters3D

Inherits RefCounted

Experimental.

Provides parameters for 3D navigation path queries.

Description

By changing various properties of this object, such as the start and target position, you can configure path queries to the NavigationServer3D.

Properties

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.

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.

RID map = RID()

The navigation map RID used in the path query.

int metadata_flags = 7

Additional information to include with the navigation path.

int navigation_layers = 1

The navigation layers the query will use (as a bitmask).

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.

int pathfinding_algorithm = 0

The pathfinding algorithm used in the path query.

float simplify_epsilon = 0.0

The path simplification amount in worlds units.

bool simplify_path = false

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)

The pathfinding start position in global coordinates.

Vector3 target_position = Vector3(0, 0, 0)

The pathfinding target position in global coordinates.

Constants

PATHFINDING_ALGORITHM_ASTAR = 0

Enum: PathfindingAlgorithm

The path query uses the default A* pathfinding algorithm.

PATH_POSTPROCESSING_CORRIDORFUNNEL = 0

Enum: PathPostProcessing

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.

PATH_POSTPROCESSING_EDGECENTERED = 1

Enum: PathPostProcessing

Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center.

PATH_POSTPROCESSING_NONE = 2

Enum: PathPostProcessing

Applies no postprocessing and returns the raw path corridor as found by the pathfinding algorithm.

PATH_METADATA_INCLUDE_NONE = 0

Enum: PathMetadataFlags

Don't include any additional metadata about the returned path.

PATH_METADATA_INCLUDE_TYPES = 1

Enum: PathMetadataFlags

Include the type of navigation primitive (region or link) that each point of the path goes through.

PATH_METADATA_INCLUDE_RIDS = 2

Enum: PathMetadataFlags

Include the RIDs of the regions and links that each point of the path goes through.

PATH_METADATA_INCLUDE_OWNERS = 4

Enum: PathMetadataFlags

Include the ObjectIDs of the Objects which manage the regions and links each point of the path goes through.

PATH_METADATA_INCLUDE_ALL = 7

Enum: PathMetadataFlags

Include all available metadata about the returned path.

Tutorials

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.