NavigationPathQueryParameters2D

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsNavigationPathQueryParameters2D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsNavigationPathQueryParameters2D

func (self *Extension[T]) AsNavigationPathQueryParameters2D() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsNavigationPathQueryParameters2D

func (self Instance) AsNavigationPathQueryParameters2D() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) ExcludedRegions

func (self Instance) ExcludedRegions() []RID.Any

The list of region Resource.IDs that will be excluded from the path query. Use NavigationRegion2D.GetRid to get the Resource.ID associated with a NavigationRegion2D 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.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IncludedRegions

func (self Instance) IncludedRegions() []RID.Any

The list of region Resource.IDs that will be included by the path query. Use NavigationRegion2D.GetRid to get the Resource.ID associated with a NavigationRegion2D 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.

func (Instance) Map

func (self Instance) Map() RID.NavigationMap2D

The navigation map Resource.ID used in the path query.

func (Instance) MetadataFlags

func (self Instance) MetadataFlags() PathMetadataFlags

Additional information to include with the navigation path.

func (Instance) NavigationLayers

func (self Instance) NavigationLayers() int

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

func (Instance) PathPostprocessing

func (self Instance) PathPostprocessing() PathPostProcessing

The path postprocessing applied to the raw path corridor found by the PathfindingAlgorithm.

func (Instance) PathReturnMaxLength

func (self Instance) PathReturnMaxLength() Float.X

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.

func (Instance) PathReturnMaxRadius

func (self Instance) PathReturnMaxRadius() Float.X

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 circle shaped clip operation on the path with the first path position being the circle's center position.

func (Instance) PathSearchMaxDistance

func (self Instance) PathSearchMaxDistance() Float.X

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.

func (Instance) PathSearchMaxPolygons

func (self Instance) PathSearchMaxPolygons() int

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.

func (Instance) PathfindingAlgorithm

func (self Instance) PathfindingAlgorithm() PathfindingAlgorithm

The pathfinding algorithm used in the path query.

func (Instance) SetExcludedRegions

func (self Instance) SetExcludedRegions(value []RID.Any)

SetExcludedRegions sets the property returned by [GetExcludedRegions].

func (Instance) SetIncludedRegions

func (self Instance) SetIncludedRegions(value []RID.Any)

SetIncludedRegions sets the property returned by [GetIncludedRegions].

func (Instance) SetMap

func (self Instance) SetMap(value RID.NavigationMap2D)

SetMap sets the property returned by [GetMap].

func (Instance) SetMetadataFlags

func (self Instance) SetMetadataFlags(value PathMetadataFlags)

SetMetadataFlags sets the property returned by [GetMetadataFlags].

func (Instance) SetNavigationLayers

func (self Instance) SetNavigationLayers(value int)

SetNavigationLayers sets the property returned by [GetNavigationLayers].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetPathPostprocessing

func (self Instance) SetPathPostprocessing(value PathPostProcessing)

SetPathPostprocessing sets the property returned by [GetPathPostprocessing].

func (Instance) SetPathReturnMaxLength

func (self Instance) SetPathReturnMaxLength(value Float.X)

SetPathReturnMaxLength sets the property returned by [GetPathReturnMaxLength].

func (Instance) SetPathReturnMaxRadius

func (self Instance) SetPathReturnMaxRadius(value Float.X)

SetPathReturnMaxRadius sets the property returned by [GetPathReturnMaxRadius].

func (Instance) SetPathSearchMaxDistance

func (self Instance) SetPathSearchMaxDistance(value Float.X)

SetPathSearchMaxDistance sets the property returned by [GetPathSearchMaxDistance].

func (Instance) SetPathSearchMaxPolygons

func (self Instance) SetPathSearchMaxPolygons(value int)

SetPathSearchMaxPolygons sets the property returned by [GetPathSearchMaxPolygons].

func (Instance) SetPathfindingAlgorithm

func (self Instance) SetPathfindingAlgorithm(value PathfindingAlgorithm)

SetPathfindingAlgorithm sets the property returned by [GetPathfindingAlgorithm].

func (Instance) SetSimplifyEpsilon

func (self Instance) SetSimplifyEpsilon(value Float.X)

SetSimplifyEpsilon sets the property returned by [GetSimplifyEpsilon].

func (Instance) SetSimplifyPath

func (self Instance) SetSimplifyPath(value bool)

SetSimplifyPath sets the property returned by [GetSimplifyPath].

func (Instance) SetStartPosition

func (self Instance) SetStartPosition(value Vector2.XY)

SetStartPosition sets the property returned by [GetStartPosition].

func (Instance) SetTargetPosition

func (self Instance) SetTargetPosition(value Vector2.XY)

SetTargetPosition sets the property returned by [GetTargetPosition].

func (Instance) SimplifyEpsilon

func (self Instance) SimplifyEpsilon() Float.X

The path simplification amount in worlds units.

func (Instance) SimplifyPath

func (self Instance) SimplifyPath() bool

If true a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by SimplifyEpsilon. 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".

func (Instance) StartPosition

func (self Instance) StartPosition() Vector2.XY

The pathfinding start position in global coordinates.

func (Instance) TargetPosition

func (self Instance) TargetPosition() Vector2.XY

The pathfinding target position in global coordinates.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type PathMetadataFlags

type PathMetadataFlags int //gd:NavigationPathQueryParameters2D.PathMetadataFlags
const (
	// Don't include any additional metadata about the returned path.
	PathMetadataIncludeNone PathMetadataFlags = 0
	// Include the type of navigation primitive (region or link) that each point of the path goes through.
	PathMetadataIncludeTypes PathMetadataFlags = 1
	// Include the [Resource.ID]s of the regions and links that each point of the path goes through.
	//
	// [Resource.ID]: https://pkg.go.dev/graphics.gd/variant/Resource#ID
	PathMetadataIncludeRids PathMetadataFlags = 2
	// Include the ObjectIDs of the [Object]s which manage the regions and links each point of the path goes through.
	//
	// [Object]: https://pkg.go.dev/graphics.gd/variant/Object
	PathMetadataIncludeOwners PathMetadataFlags = 4
	// Include all available metadata about the returned path.
	PathMetadataIncludeAll PathMetadataFlags = 7
)

type PathPostProcessing

type PathPostProcessing int //gd:NavigationPathQueryParameters2D.PathPostProcessing
const (
	// 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.
	PathPostprocessingCorridorfunnel PathPostProcessing = 0
	// 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.
	PathPostprocessingEdgecentered PathPostProcessing = 1
	// Applies no postprocessing and returns the raw path corridor as found by the pathfinding algorithm.
	PathPostprocessingNone PathPostProcessing = 2
)

type PathfindingAlgorithm

type PathfindingAlgorithm int //gd:NavigationPathQueryParameters2D.PathfindingAlgorithm
const (
	// The path query uses the default A* pathfinding algorithm.
	PathfindingAlgorithmAstar PathfindingAlgorithm = 0
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL