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.
Constructor
Variables
agent__height:Single
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 godot.NavigationMesh.cell__height
.
agent__maxClimb:Single
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 godot.NavigationMesh.cell__height
.
agent__radius:Single
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 godot.NavigationMesh.cell__size
.
detail__sampleDistance:Single
The sampling distance to use when generating the detail mesh, in cell unit.
detail__sampleMaxError:Single
The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
edge__maxError:Single
The maximum distance a simplfied contour's border edges should deviate the original raw contour.
edge__maxLength:Single
The maximum allowed length for contour edges along the border of the mesh.
Note: While baking, this value will be rounded up to the nearest multiple of godot.NavigationMesh.cell__size
.
filter__filterWalkableLowHeightSpans:Bool
If true
, marks walkable spans as not walkable if the clearance above the span is less than godot.NavigationMesh.agent__height
.
filter__lowHangingObstacles:Bool
If true
, marks non-walkable spans as walkable if their maximum is within godot.NavigationMesh.agent__maxClimb
of a walkable neighbor.
geometry__collisionMask:UInt
The physics layers to scan for static colliders.
Only used when godot.NavigationMesh.geometry__parsedGeometryType
is godot.NavigationMesh_ParsedGeometryType.staticColliders
or godot.NavigationMesh_ParsedGeometryType.both
.
geometry__parsedGeometryType:NavigationMesh_ParsedGeometryType
Determines which type of nodes will be parsed as geometry. See godot.NavigationMesh_ParsedGeometryType
for possible values.
geometry__sourceGeometryMode:NavigationMesh_SourceGeometryMode
The source of the geometry used when baking. See godot.NavigationMesh_SourceGeometryMode
for possible values.
geometry__sourceGroupName:String
The name of the group to scan for geometry.
Only used when godot.NavigationMesh.geometry__sourceGeometryMode
is godot.NavigationMesh_SourceGeometryMode.groupsWithChildren
or godot.NavigationMesh_SourceGeometryMode.groupsExplicit
.
polygon__vertsPerPoly:Single
The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
region__mergeSize:Single
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.
region__minSize:Single
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.
samplePartitionType__samplePartitionType:NavigationMesh_SamplePartitionType
Partitioning algorithm for creating the navigation mesh polys. See godot.NavigationMesh_SamplePartitionType
for possible values.
Methods
addPolygon(polygon:HaxeArray<Int>):Void
Adds a polygon using the indices of the vertices you get when calling godot.NavigationMesh.getVertices
.
createFromMesh(mesh:Mesh):Void
Initializes the navigation mesh by setting the vertices and indices according to a godot.Mesh
.
getCollisionMaskBit(bit:Int):Bool
Returns whether the specified bit
of the godot.NavigationMesh.geometry__collisionMask
is set.
inlinegetPolygon(idx:Int):Array<Int>
Returns a Int
containing the indices of the vertices of a created polygon.
inlinegetVertices():Array<Vector3>
Returns a godot.Vector3
containing all the vertices being used to create the polygons.
setCollisionMaskBit(bit:Int, value:Bool):Void
If value
is true
, sets the specified bit
in the godot.NavigationMesh.geometry__collisionMask
.
If value
is false
, clears the specified bit
in the godot.NavigationMesh.geometry__collisionMask
.
setVertices(vertices:HaxeArray<Vector3>):Void
Sets the vertices that can be then indexed to create polygons with the godot.NavigationMesh.addPolygon
method.