Documentation
¶
Overview ¶
A link between two positions on NavigationRegion2Ds that agents can be routed through. These positions can be on the same NavigationRegion2D or on two different ones. Links are useful to express navigation methods other than traveling along the surface of the navigation polygon, such as ziplines, teleporters, or gaps that can be jumped across.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsNavigationLink2D() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) Bidirectional() bool
- func (self Instance) Enabled() bool
- func (self Instance) EndPosition() Vector2.XY
- func (self Instance) EnterCost() Float.X
- func (self Instance) GetGlobalEndPosition() Vector2.XY
- func (self Instance) GetGlobalStartPosition() Vector2.XY
- func (self Instance) GetNavigationLayerValue(layer_number int) bool
- func (self Instance) GetNavigationMap() RID.NavigationMap2D
- func (self Instance) GetRid() RID.NavigationLink2D
- func (self Instance) ID() ID
- func (self Instance) NavigationLayers() int
- func (self Instance) SetBidirectional(value bool)
- func (self Instance) SetEnabled(value bool)
- func (self Instance) SetEndPosition(value Vector2.XY)
- func (self Instance) SetEnterCost(value Float.X)
- func (self Instance) SetGlobalEndPosition(position Vector2.XY)
- func (self Instance) SetGlobalStartPosition(position Vector2.XY)
- func (self Instance) SetNavigationLayerValue(layer_number int, value bool)
- func (self Instance) SetNavigationLayers(value int)
- func (self Instance) SetNavigationMap(navigation_map RID.NavigationMap2D)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetStartPosition(value Vector2.XY)
- func (self Instance) SetTravelCost(value Float.X)
- func (self Instance) StartPosition() Vector2.XY
- func (self Instance) TravelCost() Float.X
- func (self Instance) Virtual(name string) reflect.Value
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 Extension ¶
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]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
func (*Extension[T]) AsNavigationLink2D ¶
type 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.
type Instance ¶
type Instance [1]gdclass.NavigationLink2D
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 (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsNavigationLink2D ¶
func (Instance) Bidirectional ¶
Whether this link can be traveled in both directions or only from StartPosition to EndPosition.
func (Instance) Enabled ¶
Whether this link is currently active. If false, NavigationServer2D.MapGetPath will ignore this link.
func (Instance) EndPosition ¶
Ending position of the link.
This position will search out the nearest polygon in the navigation mesh to attach to.
The distance the link will search is controlled by NavigationServer2D.MapSetLinkConnectionRadius.
func (Instance) EnterCost ¶
When pathfinding enters this link from another regions navigation mesh the EnterCost value is added to the path distance for determining the shortest path.
func (Instance) GetGlobalEndPosition ¶
Returns the EndPosition that is relative to the link as a global position.
func (Instance) GetGlobalStartPosition ¶
Returns the StartPosition that is relative to the link as a global position.
func (Instance) GetNavigationLayerValue ¶
Returns whether or not the specified layer of the NavigationLayers bitmask is enabled, given a 'layer_number' between 1 and 32.
func (Instance) GetNavigationMap ¶
func (self Instance) GetNavigationMap() RID.NavigationMap2D
Returns the current navigation map Resource.ID used by this link.
func (Instance) GetRid ¶
func (self Instance) GetRid() RID.NavigationLink2D
Returns the Resource.ID of this link on the NavigationServer2D.
func (Instance) NavigationLayers ¶
A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with NavigationServer2D.MapGetPath.
func (Instance) SetBidirectional ¶
SetBidirectional sets the property returned by [IsBidirectional].
func (Instance) SetEnabled ¶
SetEnabled sets the property returned by [IsEnabled].
func (Instance) SetEndPosition ¶
SetEndPosition sets the property returned by [GetEndPosition].
func (Instance) SetEnterCost ¶
SetEnterCost sets the property returned by [GetEnterCost].
func (Instance) SetGlobalEndPosition ¶
Sets the EndPosition that is relative to the link from a global 'position'.
func (Instance) SetGlobalStartPosition ¶
Sets the StartPosition that is relative to the link from a global 'position'.
func (Instance) SetNavigationLayerValue ¶
Based on 'value', enables or disables the specified layer in the NavigationLayers bitmask, given a 'layer_number' between 1 and 32.
func (Instance) SetNavigationLayers ¶
SetNavigationLayers sets the property returned by [GetNavigationLayers].
func (Instance) SetNavigationMap ¶
func (self Instance) SetNavigationMap(navigation_map RID.NavigationMap2D)
Sets the Resource.ID of the navigation map this link should use. By default the link will automatically join the World2D default navigation map so this function is only required to override the default map.
func (Instance) SetStartPosition ¶
SetStartPosition sets the property returned by [GetStartPosition].
func (Instance) SetTravelCost ¶
SetTravelCost sets the property returned by [GetTravelCost].
func (Instance) StartPosition ¶
Starting position of the link.
This position will search out the nearest polygon in the navigation mesh to attach to.
The distance the link will search is controlled by NavigationServer2D.MapSetLinkConnectionRadius.
func (Instance) TravelCost ¶
When pathfinding moves along the link the traveled distance is multiplied with TravelCost for determining the shortest path.