Documentation
¶
Overview ¶
A navigation mesh is a collection of polygons that define which areas of an environment are traversable to aid agents in pathfinding through complicated spaces.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AddPolygon(polygon []int32)
- func (self Instance) AgentHeight() Float.X
- func (self Instance) AgentMaxClimb() Float.X
- func (self Instance) AgentMaxSlope() Float.X
- func (self Instance) AgentRadius() Float.X
- func (self Instance) AsNavigationMesh() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) BorderSize() Float.X
- func (self Instance) CellHeight() Float.X
- func (self Instance) CellSize() Float.X
- func (self Instance) Clear()
- func (self Instance) ClearPolygons()
- func (self Instance) CreateFromMesh(mesh Mesh.Instance)
- func (self Instance) DetailSampleDistance() Float.X
- func (self Instance) DetailSampleMaxError() Float.X
- func (self Instance) EdgeMaxError() Float.X
- func (self Instance) EdgeMaxLength() Float.X
- func (self Instance) FilterBakingAabb() AABB.PositionSize
- func (self Instance) FilterBakingAabbOffset() Vector3.XYZ
- func (self Instance) FilterLedgeSpans() bool
- func (self Instance) FilterLowHangingObstacles() bool
- func (self Instance) FilterWalkableLowHeightSpans() bool
- func (self Instance) GeometryCollisionMask() int
- func (self Instance) GeometryParsedGeometryType() ParsedGeometryType
- func (self Instance) GeometrySourceGeometryMode() SourceGeometryMode
- func (self Instance) GeometrySourceGroupName() string
- func (self Instance) GetCollisionMaskValue(layer_number int) bool
- func (self Instance) GetPolygon(idx int) []int32
- func (self Instance) GetPolygonCount() int
- func (self Instance) ID() ID
- func (self Instance) RegionMergeSize() Float.X
- func (self Instance) RegionMinSize() Float.X
- func (self Instance) SamplePartitionType() SamplePartitionType
- func (self Instance) SetAgentHeight(value Float.X)
- func (self Instance) SetAgentMaxClimb(value Float.X)
- func (self Instance) SetAgentMaxSlope(value Float.X)
- func (self Instance) SetAgentRadius(value Float.X)
- func (self Instance) SetBorderSize(value Float.X)
- func (self Instance) SetCellHeight(value Float.X)
- func (self Instance) SetCellSize(value Float.X)
- func (self Instance) SetCollisionMaskValue(layer_number int, value bool)
- func (self Instance) SetDetailSampleDistance(value Float.X)
- func (self Instance) SetDetailSampleMaxError(value Float.X)
- func (self Instance) SetEdgeMaxError(value Float.X)
- func (self Instance) SetEdgeMaxLength(value Float.X)
- func (self Instance) SetFilterBakingAabb(value AABB.PositionSize)
- func (self Instance) SetFilterBakingAabbOffset(value Vector3.XYZ)
- func (self Instance) SetFilterLedgeSpans(value bool)
- func (self Instance) SetFilterLowHangingObstacles(value bool)
- func (self Instance) SetFilterWalkableLowHeightSpans(value bool)
- func (self Instance) SetGeometryCollisionMask(value int)
- func (self Instance) SetGeometryParsedGeometryType(value ParsedGeometryType)
- func (self Instance) SetGeometrySourceGeometryMode(value SourceGeometryMode)
- func (self Instance) SetGeometrySourceGroupName(value string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetRegionMergeSize(value Float.X)
- func (self Instance) SetRegionMinSize(value Float.X)
- func (self Instance) SetSamplePartitionType(value SamplePartitionType)
- func (self Instance) SetVertices(value []Vector3.XYZ)
- func (self Instance) SetVerticesPerPolygon(value Float.X)
- func (self Instance) Vertices() []Vector3.XYZ
- func (self Instance) VerticesPerPolygon() Float.X
- func (self Instance) Virtual(name string) reflect.Value
- type ParsedGeometryType
- type SamplePartitionType
- type SourceGeometryMode
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]) AsNavigationMesh ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
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.NavigationMesh
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) AddPolygon ¶
Adds a polygon using the indices of the vertices you get when calling GetVertices.
func (Instance) AgentHeight ¶
The minimum floor to ceiling height that will still allow the floor area to be considered walkable.
Note: While baking, this value will be rounded up to the nearest multiple of CellHeight.
func (Instance) AgentMaxClimb ¶
The minimum ledge height that is considered to still be traversable.
Note: While baking, this value will be rounded down to the nearest multiple of CellHeight.
func (Instance) AgentMaxSlope ¶
The maximum slope that is considered walkable, in degrees.
func (Instance) AgentRadius ¶
The distance to erode/shrink the walkable area of the heightfield away from obstructions.
Note: While baking, this value will be rounded up to the nearest multiple of CellSize.
Note: The radius must be equal or higher than 0.0. If the radius is 0.0, it won't be possible to fix invalid outline overlaps and other precision errors during the baking process. As a result, some obstacles may be excluded incorrectly from the final navigation mesh, or may delete the navigation mesh's polygons.
func (Instance) AsNavigationMesh ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) BorderSize ¶
The size of the non-navigable border around the bake bounding area.
In conjunction with the FilterBakingAabb and a EdgeMaxError value at 1.0 or below the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by AgentRadius.
Note: If this value is not 0.0, it will be rounded up to the nearest multiple of CellSize during baking.
func (Instance) CellHeight ¶
The cell height used to rasterize the navigation mesh vertices on the Y axis. Must match with the cell height on the navigation map.
func (Instance) CellSize ¶
The cell size used to rasterize the navigation mesh vertices on the XZ plane. Must match with the cell size on the navigation map.
func (Instance) Clear ¶
func (self Instance) Clear()
Clears the internal arrays for vertices and polygon indices.
func (Instance) ClearPolygons ¶
func (self Instance) ClearPolygons()
Clears the array of polygons, but it doesn't clear the array of vertices.
func (Instance) CreateFromMesh ¶
Initializes the navigation mesh by setting the vertices and indices according to a Mesh.
Note: The given 'mesh' must be of type [Mesh.PrimitiveTriangles] and have an index array.
func (Instance) DetailSampleDistance ¶
The sampling distance to use when generating the detail mesh, in cell unit.
func (Instance) DetailSampleMaxError ¶
The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
func (Instance) EdgeMaxError ¶
The maximum distance a simplified contour's border edges should deviate the original raw contour.
func (Instance) EdgeMaxLength ¶
The maximum allowed length for contour edges along the border of the mesh. A value of 0.0 disables this feature.
Note: While baking, this value will be rounded up to the nearest multiple of CellSize.
func (Instance) FilterBakingAabb ¶
func (self Instance) FilterBakingAabb() AABB.PositionSize
If the baking AABB.PositionSize has a volume the navigation mesh baking will be restricted to its enclosing area.
func (Instance) FilterBakingAabbOffset ¶
The position offset applied to the FilterBakingAabb AABB.PositionSize.
func (Instance) FilterLedgeSpans ¶
If true, marks spans that are ledges as non-walkable.
func (Instance) FilterLowHangingObstacles ¶
If true, marks non-walkable spans as walkable if their maximum is within AgentMaxClimb of a walkable neighbor.
func (Instance) FilterWalkableLowHeightSpans ¶
If true, marks walkable spans as not walkable if the clearance above the span is less than AgentHeight.
func (Instance) GeometryCollisionMask ¶
The physics layers to scan for static colliders.
Only used when GeometryParsedGeometryType is ParsedGeometryStaticColliders or ParsedGeometryBoth.
func (Instance) GeometryParsedGeometryType ¶
func (self Instance) GeometryParsedGeometryType() ParsedGeometryType
Determines which type of nodes will be parsed as geometry.
func (Instance) GeometrySourceGeometryMode ¶
func (self Instance) GeometrySourceGeometryMode() SourceGeometryMode
The source of the geometry used when baking.
func (Instance) GeometrySourceGroupName ¶
The name of the group to scan for geometry.
Only used when GeometrySourceGeometryMode is SourceGeometryGroupsWithChildren or SourceGeometryGroupsExplicit.
func (Instance) GetCollisionMaskValue ¶
Returns whether or not the specified layer of the GeometryCollisionMask is enabled, given a 'layer_number' between 1 and 32.
func (Instance) GetPolygon ¶
Returns a []int32 containing the indices of the vertices of a created polygon.
func (Instance) GetPolygonCount ¶
Returns the number of polygons in the navigation mesh.
func (Instance) RegionMergeSize ¶
Any regions with a size smaller than this will be merged with larger regions if possible.
Note: This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400.
func (Instance) RegionMinSize ¶
The minimum size of a region for it to be created.
Note: This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64.
func (Instance) SamplePartitionType ¶
func (self Instance) SamplePartitionType() SamplePartitionType
Partitioning algorithm for creating the navigation mesh polys.
func (Instance) SetAgentHeight ¶
SetAgentHeight sets the property returned by [GetAgentHeight].
func (Instance) SetAgentMaxClimb ¶
SetAgentMaxClimb sets the property returned by [GetAgentMaxClimb].
func (Instance) SetAgentMaxSlope ¶
SetAgentMaxSlope sets the property returned by [GetAgentMaxSlope].
func (Instance) SetAgentRadius ¶
SetAgentRadius sets the property returned by [GetAgentRadius].
func (Instance) SetBorderSize ¶
SetBorderSize sets the property returned by [GetBorderSize].
func (Instance) SetCellHeight ¶
SetCellHeight sets the property returned by [GetCellHeight].
func (Instance) SetCellSize ¶
SetCellSize sets the property returned by [GetCellSize].
func (Instance) SetCollisionMaskValue ¶
Based on 'value', enables or disables the specified layer in the GeometryCollisionMask, given a 'layer_number' between 1 and 32.
func (Instance) SetDetailSampleDistance ¶
SetDetailSampleDistance sets the property returned by [GetDetailSampleDistance].
func (Instance) SetDetailSampleMaxError ¶
SetDetailSampleMaxError sets the property returned by [GetDetailSampleMaxError].
func (Instance) SetEdgeMaxError ¶
SetEdgeMaxError sets the property returned by [GetEdgeMaxError].
func (Instance) SetEdgeMaxLength ¶
SetEdgeMaxLength sets the property returned by [GetEdgeMaxLength].
func (Instance) SetFilterBakingAabb ¶
func (self Instance) SetFilterBakingAabb(value AABB.PositionSize)
SetFilterBakingAabb sets the property returned by [GetFilterBakingAabb].
func (Instance) SetFilterBakingAabbOffset ¶
SetFilterBakingAabbOffset sets the property returned by [GetFilterBakingAabbOffset].
func (Instance) SetFilterLedgeSpans ¶
SetFilterLedgeSpans sets the property returned by [GetFilterLedgeSpans].
func (Instance) SetFilterLowHangingObstacles ¶
SetFilterLowHangingObstacles sets the property returned by [GetFilterLowHangingObstacles].
func (Instance) SetFilterWalkableLowHeightSpans ¶
SetFilterWalkableLowHeightSpans sets the property returned by [GetFilterWalkableLowHeightSpans].
func (Instance) SetGeometryCollisionMask ¶
SetGeometryCollisionMask sets the property returned by [GetCollisionMask].
func (Instance) SetGeometryParsedGeometryType ¶
func (self Instance) SetGeometryParsedGeometryType(value ParsedGeometryType)
SetGeometryParsedGeometryType sets the property returned by [GetParsedGeometryType].
func (Instance) SetGeometrySourceGeometryMode ¶
func (self Instance) SetGeometrySourceGeometryMode(value SourceGeometryMode)
SetGeometrySourceGeometryMode sets the property returned by [GetSourceGeometryMode].
func (Instance) SetGeometrySourceGroupName ¶
SetGeometrySourceGroupName sets the property returned by [GetSourceGroupName].
func (Instance) SetRegionMergeSize ¶
SetRegionMergeSize sets the property returned by [GetRegionMergeSize].
func (Instance) SetRegionMinSize ¶
SetRegionMinSize sets the property returned by [GetRegionMinSize].
func (Instance) SetSamplePartitionType ¶
func (self Instance) SetSamplePartitionType(value SamplePartitionType)
SetSamplePartitionType sets the property returned by [GetSamplePartitionType].
func (Instance) SetVertices ¶
SetVertices sets the property returned by [GetVertices].
func (Instance) SetVerticesPerPolygon ¶
SetVerticesPerPolygon sets the property returned by [GetVerticesPerPolygon].
func (Instance) VerticesPerPolygon ¶
The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
type ParsedGeometryType ¶
type ParsedGeometryType int //gd:NavigationMesh.ParsedGeometryType
const ( // Parses mesh instances as geometry. This includes [MeshInstance3D], [CSGShape3D], and [GridMap] nodes. // // [CSGShape3D]: https://pkg.go.dev/graphics.gd/classdb/CSGShape3D // [GridMap]: https://pkg.go.dev/graphics.gd/classdb/GridMap // [MeshInstance3D]: https://pkg.go.dev/graphics.gd/classdb/MeshInstance3D ParsedGeometryMeshInstances ParsedGeometryType = 0 // Parses [StaticBody3D] colliders as geometry. The collider should be in any of the layers specified by [GeometryCollisionMask]. // // [GeometryCollisionMask]: https://pkg.go.dev/graphics.gd/classdb/#Instance.GeometryCollisionMask // [StaticBody3D]: https://pkg.go.dev/graphics.gd/classdb/StaticBody3D ParsedGeometryStaticColliders ParsedGeometryType = 1 // Both [ParsedGeometryMeshInstances] and [ParsedGeometryStaticColliders]. ParsedGeometryBoth ParsedGeometryType = 2 // Represents the size of the [ParsedGeometryType] enum. ParsedGeometryMax ParsedGeometryType = 3 )
type SamplePartitionType ¶
type SamplePartitionType int //gd:NavigationMesh.SamplePartitionType
const ( // Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas. SamplePartitionWatershed SamplePartitionType = 0 // Monotone partitioning. Use this if you want fast navigation mesh generation. SamplePartitionMonotone SamplePartitionType = 1 // Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles. SamplePartitionLayers SamplePartitionType = 2 // Represents the size of the [SamplePartitionType] enum. SamplePartitionMax SamplePartitionType = 3 )
type SourceGeometryMode ¶
type SourceGeometryMode int //gd:NavigationMesh.SourceGeometryMode
const ( // Scans the child nodes of the root node recursively for geometry. SourceGeometryRootNodeChildren SourceGeometryMode = 0 // Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [GeometrySourceGroupName]. // // [GeometrySourceGroupName]: https://pkg.go.dev/graphics.gd/classdb/#Instance.GeometrySourceGroupName SourceGeometryGroupsWithChildren SourceGeometryMode = 1 // Uses nodes in a group for geometry. The group is specified by [GeometrySourceGroupName]. // // [GeometrySourceGroupName]: https://pkg.go.dev/graphics.gd/classdb/#Instance.GeometrySourceGroupName SourceGeometryGroupsExplicit SourceGeometryMode = 2 // Represents the size of the [SourceGeometryMode] enum. SourceGeometryMax SourceGeometryMode = 3 )