Documentation
¶
Overview ¶
A traversable 3D region based on a graphics.gd/classdb/NavigationMesh that [graphics.gd/classdb/NavigationAgent3D]s can use for pathfinding.
Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using graphics.gd/classdb/NavigationServer3D.MapSetEdgeConnectionMargin.
Note: Overlapping two regions' navigation meshes is not enough for connecting two regions. They must share a similar edge.
The cost of entering this region from another region can be controlled with the Instance.EnterCost value.
Note: This value is not added to the path cost when the start position is already inside this region.
The cost of traveling distances inside this region can be controlled with the Instance.TravelCost multiplier.
Note: This node caches changes to its properties, so if you make changes to the underlying region [Resource.ID] in graphics.gd/classdb/NavigationServer3D, they will not be reflected in this node's properties.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AsNavigationRegion3D() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) BakeNavigationMesh()
- func (self Instance) Enabled() bool
- func (self Instance) EnterCost() Float.X
- func (self Instance) GetBounds() AABB.PositionSize
- func (self Instance) GetNavigationLayerValue(layer_number int) bool
- func (self Instance) GetNavigationMap() RID.NavigationMap3D
- func (self Instance) GetRegionRid() RID.NavigationRegion3D
- func (self Instance) GetRid() RID.NavigationRegion3D
- func (self Instance) ID() ID
- func (self Instance) IsBaking() bool
- func (self Instance) NavigationLayers() int
- func (self Instance) NavigationMesh() NavigationMesh.Instance
- func (self Instance) OnBakeFinished(cb func(), flags ...Signal.Flags)
- func (self Instance) OnNavigationMeshChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) SetEnabled(value bool)
- func (self Instance) SetEnterCost(value Float.X)
- func (self Instance) SetNavigationLayerValue(layer_number int, value bool)
- func (self Instance) SetNavigationLayers(value int)
- func (self Instance) SetNavigationMap(navigation_map RID.NavigationMap3D)
- func (self Instance) SetNavigationMesh(value NavigationMesh.Instance)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetTravelCost(value Float.X)
- func (self Instance) SetUseEdgeConnections(value bool)
- func (self Instance) TravelCost() Float.X
- func (self Instance) UseEdgeConnections() bool
- 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 Expanded ¶
type Expanded [1]gdclass.NavigationRegion3D
func (Expanded) BakeNavigationMesh ¶
Bakes the graphics.gd/classdb/NavigationMesh. If 'on_thread' is set to true (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new graphics.gd/classdb/NavigationMesh. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as Web with threads disabled).
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]) AsNavigationRegion3D ¶
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.NavigationRegion3D
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) AsNavigationRegion3D ¶
func (Instance) BakeNavigationMesh ¶
func (self Instance) BakeNavigationMesh()
Bakes the graphics.gd/classdb/NavigationMesh. If 'on_thread' is set to true (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new graphics.gd/classdb/NavigationMesh. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as Web with threads disabled).
func (Instance) GetBounds ¶
func (self Instance) GetBounds() AABB.PositionSize
Returns the axis-aligned bounding box for the region's transformed navigation mesh.
func (Instance) GetNavigationLayerValue ¶
Returns whether or not the specified layer of the Instance.NavigationLayers bitmask is enabled, given a 'layer_number' between 1 and 32.
func (Instance) GetNavigationMap ¶
func (self Instance) GetNavigationMap() RID.NavigationMap3D
Returns the current navigation map [Resource.ID] used by this region.
func (Instance) GetRegionRid ¶
func (self Instance) GetRegionRid() RID.NavigationRegion3D
Returns the [Resource.ID] of this region on the graphics.gd/classdb/NavigationServer3D.
func (Instance) GetRid ¶
func (self Instance) GetRid() RID.NavigationRegion3D
Returns the [Resource.ID] of this region on the graphics.gd/classdb/NavigationServer3D. Combined with graphics.gd/classdb/NavigationServer3D.MapGetClosestPointOwner can be used to identify the graphics.gd/classdb/NavigationRegion3D closest to a point on the merged navigation map.
func (Instance) IsBaking ¶
Returns true when the graphics.gd/classdb/NavigationMesh is being baked on a background thread.
func (Instance) NavigationLayers ¶
func (Instance) NavigationMesh ¶
func (self Instance) NavigationMesh() NavigationMesh.Instance
func (Instance) OnBakeFinished ¶
func (Instance) OnNavigationMeshChanged ¶
func (Instance) SetEnabled ¶
func (Instance) SetEnterCost ¶
func (Instance) SetNavigationLayerValue ¶
Based on 'value', enables or disables the specified layer in the Instance.NavigationLayers bitmask, given a 'layer_number' between 1 and 32.
func (Instance) SetNavigationLayers ¶
func (Instance) SetNavigationMap ¶
func (self Instance) SetNavigationMap(navigation_map RID.NavigationMap3D)
Sets the [Resource.ID] of the navigation map this region should use. By default the region will automatically join the graphics.gd/classdb/World3D default navigation map so this function is only required to override the default map.
func (Instance) SetNavigationMesh ¶
func (self Instance) SetNavigationMesh(value NavigationMesh.Instance)