reckfellENGINE

NavigationMesh

A navigation mesh that defines traversable areas and obstacles.

On this page
class NavigationMeshReckfellSharpInherits Resource

A navigation mesh that defines traversable areas and obstacles.

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.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

NavigationMeshConstructor
# NavigationMesh
C#
public NavigationMesh();

Properties26

AgentHeightProperty
# AgentHeight
C#
public float AgentHeight { get; set; }

Free-space height used during 3D baking. Assignment does not change a physics shape or rebake prepared geometry. The same height-1.5 ceiling admits the checked height-1 variant but not height 2; build resolution also affects the output.

AgentMaxClimbProperty
# AgentMaxClimb
C#
public float AgentMaxClimb { get; set; }

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 NavigationMesh.CellHeight.

AgentMaxSlopeProperty
# AgentMaxSlope
C#
public float AgentMaxSlope { get; set; }

The maximum slope that is considered walkable, in degrees.

AgentRadiusProperty
# AgentRadius
C#
public float AgentRadius { get; set; }

Clearance radius used when baking traversable geometry. Changing it does not automatically rebake existing output; inspect boundaries and paths after baking. It is not a physics-shape or avoidance radius.

BorderSizeProperty
# BorderSize
C#
public float BorderSize { get; set; }

The size of the non-navigable border around the bake bounding area. In conjunction with the NavigationMesh.FilterBakingAabb and a NavigationMesh.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 NavigationMesh.AgentRadius. Note: If this value is not 0.0, it will be rounded up to the nearest multiple of NavigationMesh.CellSize during baking.

CellHeightProperty
# CellHeight
C#
public float CellHeight { get; set; }

The cell height used to rasterize the navigation mesh vertices on the Y axis. Must match with the cell height on the navigation map.

CellSizeProperty
# CellSize
C#
public float CellSize { get; set; }

The cell size used to rasterize the navigation mesh vertices on the XZ plane. Must match with the cell size on the navigation map.

DetailSampleDistanceProperty
# DetailSampleDistance
C#
public float DetailSampleDistance { get; set; }

The sampling distance to use when generating the detail mesh, in cell unit.

DetailSampleMaxErrorProperty
# DetailSampleMaxError
C#
public float DetailSampleMaxError { get; set; }

The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.

EdgeMaxErrorProperty
# EdgeMaxError
C#
public float EdgeMaxError { get; set; }

The maximum distance a simplified contour's border edges should deviate the original raw contour.

EdgeMaxLengthProperty
# EdgeMaxLength
C#
public float EdgeMaxLength { get; set; }

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 NavigationMesh.CellSize.

FilterBakingAabbProperty
# FilterBakingAabb
C#
public Aabb FilterBakingAabb { get; set; }

If the baking Aabb has a volume the navigation mesh baking will be restricted to its enclosing area.

FilterBakingAabbOffsetProperty
# FilterBakingAabbOffset
C#
public Vector3 FilterBakingAabbOffset { get; set; }

The position offset applied to the NavigationMesh.FilterBakingAabb Aabb.

FilterLedgeSpansProperty
# FilterLedgeSpans
C#
public bool FilterLedgeSpans { get; set; }

If true, marks spans that are ledges as non-walkable.

FilterLowHangingObstaclesProperty
# FilterLowHangingObstacles
C#
public bool FilterLowHangingObstacles { get; set; }

If true, marks non-walkable spans as walkable if their maximum is within NavigationMesh.AgentMaxClimb of a walkable neighbor.

FilterWalkableLowHeightSpansProperty
# FilterWalkableLowHeightSpans
C#
public bool FilterWalkableLowHeightSpans { get; set; }

If true, marks walkable spans as not walkable if the clearance above the span is less than NavigationMesh.AgentHeight.

GeometryCollisionMaskProperty
# GeometryCollisionMask
C#
public uint GeometryCollisionMask { get; set; }

The physics layers to scan for static colliders. Only used when NavigationMesh.GeometryParsedGeometryType is NavigationMesh.ParsedGeometryType.StaticColliders or NavigationMesh.ParsedGeometryType.Both.

GeometryParsedGeometryTypeProperty
# GeometryParsedGeometryType
C#
public NavigationMesh.ParsedGeometryType GeometryParsedGeometryType { get; set; }

Determines which type of nodes will be parsed as geometry.

GeometrySourceGeometryModeProperty
# GeometrySourceGeometryMode
C#
public NavigationMesh.SourceGeometryMode GeometrySourceGeometryMode { get; set; }

The source of the geometry used when baking.

GeometrySourceGroupNameProperty
# GeometrySourceGroupName
C#
public StringName GeometrySourceGroupName { get; set; }

The name of the group to scan for geometry. Only used when NavigationMesh.GeometrySourceGeometryMode is NavigationMesh.SourceGeometryMode.GroupsWithChildren or NavigationMesh.SourceGeometryMode.GroupsExplicit.

PolygonsProperty
# Polygons
C#
public Reckfell.Collections.Array Polygons { get; set; }
RegionMergeSizeProperty
# RegionMergeSize
C#
public float RegionMergeSize { get; set; }

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.

RegionMinSizeProperty
# RegionMinSize
C#
public float RegionMinSize { get; set; }

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.

SamplePartitionTypeProperty
# SamplePartitionType
C#
public NavigationMesh.SamplePartitionTypeEnum SamplePartitionType { get; set; }

Partitioning algorithm for creating the navigation mesh polys.

VerticesProperty
# Vertices
C#
public Vector3[] Vertices { get; set; }
VerticesPerPolygonProperty
# VerticesPerPolygon
C#
public float VerticesPerPolygon { get; set; }

The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.

Methods60

AddPolygon2 overloads
# AddPolygon · 1/2
C#
public void AddPolygon(int[] polygon);

Adds a polygon using the indices of the vertices you get when calling NavigationMesh.GetVertices.

Parameters
NameTypeDefault
polygonint[]—
# AddPolygon · 2/2
C#
public void AddPolygon(ReadOnlySpan<int> polygon);

Adds a polygon using the indices of the vertices you get when calling NavigationMesh.GetVertices.

Parameters
NameTypeDefault
polygonReadOnlySpan<int>—
Clearvoid
# Clear
C#
public void Clear();

Clears the internal arrays for vertices and polygon indices.

ClearPolygonsvoid
# ClearPolygons
C#
public void ClearPolygons();

Clears the array of polygons, but it doesn't clear the array of vertices.

CreateFromMeshvoid
# CreateFromMesh
C#
public void CreateFromMesh(Mesh mesh);

Initializes the navigation mesh by setting the vertices and indices according to a Mesh. Note: The given mesh must be of type Mesh.PrimitiveType.Triangles and have an index array.

Parameters
NameTypeDefault
meshMesh—
GetAgentHeightfloat
# GetAgentHeight
C#
public float GetAgentHeight();

Reads the configured bake height rather than checking the character current physics height.

Returns float

Configured AgentHeight. It does not itself establish that the resource was already baked with this parameter.

GetAgentMaxClimbfloat
# GetAgentMaxClimb
C#
public float GetAgentMaxClimb();
Returns float
GetAgentMaxSlopefloat
# GetAgentMaxSlope
C#
public float GetAgentMaxSlope();
Returns float
GetAgentRadiusfloat
# GetAgentRadius
C#
public float GetAgentRadius();
Returns float
GetBorderSizefloat
# GetBorderSize
C#
public float GetBorderSize();
Returns float
GetCellHeightfloat
# GetCellHeight
C#
public float GetCellHeight();
Returns float
GetCellSizefloat
# GetCellSize
C#
public float GetCellSize();
Returns float
GetCollisionMaskuint
# GetCollisionMask
C#
public uint GetCollisionMask();
Returns uint
GetCollisionMaskValuebool
# GetCollisionMaskValue
C#
public bool GetCollisionMaskValue(int layerNumber);

Returns whether or not the specified layer of the NavigationMesh.GeometryCollisionMask is enabled, given a layer_number between 1 and 32.

Parameters
NameTypeDefault
layerNumberint—
Returns bool
GetDetailSampleDistancefloat
# GetDetailSampleDistance
C#
public float GetDetailSampleDistance();
Returns float
GetDetailSampleMaxErrorfloat
# GetDetailSampleMaxError
C#
public float GetDetailSampleMaxError();
Returns float
GetEdgeMaxErrorfloat
# GetEdgeMaxError
C#
public float GetEdgeMaxError();
Returns float
GetEdgeMaxLengthfloat
# GetEdgeMaxLength
C#
public float GetEdgeMaxLength();
Returns float
GetFilterBakingAabbAabb
# GetFilterBakingAabb
C#
public Aabb GetFilterBakingAabb();
Returns Aabb
GetFilterBakingAabbOffsetVector3
# GetFilterBakingAabbOffset
C#
public Vector3 GetFilterBakingAabbOffset();
Returns Vector3
GetFilterLedgeSpansbool
# GetFilterLedgeSpans
C#
public bool GetFilterLedgeSpans();
Returns bool
GetFilterLowHangingObstaclesbool
# GetFilterLowHangingObstacles
C#
public bool GetFilterLowHangingObstacles();
Returns bool
GetFilterWalkableLowHeightSpansbool
# GetFilterWalkableLowHeightSpans
C#
public bool GetFilterWalkableLowHeightSpans();
Returns bool
GetParsedGeometryTypeNavigationMesh.ParsedGeometryType
# GetParsedGeometryType
C#
public NavigationMesh.ParsedGeometryType GetParsedGeometryType();
Returns NavigationMesh.ParsedGeometryType
GetPolygonint[]
# GetPolygon
C#
public int[] GetPolygon(int idx);

Returns a int[] containing the indices of the vertices of a created polygon.

Parameters
NameTypeDefault
idxint—
Returns int[]
GetPolygonCountint
# GetPolygonCount
C#
public int GetPolygonCount();

Returns the navigation resource polygon count. A positive count establishes data presence, rather than map readiness, target reachability or physical character clearance.

Returns int

Polygon count; zero means this resource has no prepared polygons.

GetRegionMergeSizefloat
# GetRegionMergeSize
C#
public float GetRegionMergeSize();
Returns float
GetRegionMinSizefloat
# GetRegionMinSize
C#
public float GetRegionMinSize();
Returns float
GetSamplePartitionTypeNavigationMesh.SamplePartitionTypeEnum
# GetSamplePartitionType
C#
public NavigationMesh.SamplePartitionTypeEnum GetSamplePartitionType();
Returns NavigationMesh.SamplePartitionTypeEnum
GetSourceGeometryModeNavigationMesh.SourceGeometryMode
# GetSourceGeometryMode
C#
public NavigationMesh.SourceGeometryMode GetSourceGeometryMode();
Returns NavigationMesh.SourceGeometryMode
GetSourceGroupNameStringName
# GetSourceGroupName
C#
public StringName GetSourceGroupName();
Returns StringName
GetVerticesVector3[]
# GetVertices
C#
public Vector3[] GetVertices();

Returns a Vector3[] containing all the vertices being used to create the polygons.

Returns Vector3[]
GetVerticesPerPolygonfloat
# GetVerticesPerPolygon
C#
public float GetVerticesPerPolygon();
Returns float
SetAgentHeightvoid
# SetAgentHeight
C#
public void SetAgentHeight(float agentHeight);

Free-space height used during 3D baking. Assignment does not change a physics shape or rebake prepared geometry. The same height-1.5 ceiling admits the checked height-1 variant but not height 2; build resolution also affects the output.

Parameters
NameTypeDefault
agentHeightfloat—
agentHeight

Nonnegative height in source-geometry units. Bake again after changing it.

SetAgentMaxClimbvoid
# SetAgentMaxClimb
C#
public void SetAgentMaxClimb(float agentMaxClimb);
Parameters
NameTypeDefault
agentMaxClimbfloat—
SetAgentMaxSlopevoid
# SetAgentMaxSlope
C#
public void SetAgentMaxSlope(float agentMaxSlope);
Parameters
NameTypeDefault
agentMaxSlopefloat—
SetAgentRadiusvoid
# SetAgentRadius
C#
public void SetAgentRadius(float agentRadius);
Parameters
NameTypeDefault
agentRadiusfloat—
SetBorderSizevoid
# SetBorderSize
C#
public void SetBorderSize(float borderSize);
Parameters
NameTypeDefault
borderSizefloat—
SetCellHeightvoid
# SetCellHeight
C#
public void SetCellHeight(float cellHeight);
Parameters
NameTypeDefault
cellHeightfloat—
SetCellSizevoid
# SetCellSize
C#
public void SetCellSize(float cellSize);
Parameters
NameTypeDefault
cellSizefloat—
SetCollisionMaskvoid
# SetCollisionMask
C#
public void SetCollisionMask(uint mask);
Parameters
NameTypeDefault
maskuint—
SetCollisionMaskValuevoid
# SetCollisionMaskValue
C#
public void SetCollisionMaskValue(int layerNumber, bool value);

Based on value, enables or disables the specified layer in the NavigationMesh.GeometryCollisionMask, given a layer_number between 1 and 32.

Parameters
NameTypeDefault
layerNumberint—
valuebool—
SetDetailSampleDistancevoid
# SetDetailSampleDistance
C#
public void SetDetailSampleDistance(float detailSampleDist);
Parameters
NameTypeDefault
detailSampleDistfloat—
SetDetailSampleMaxErrorvoid
# SetDetailSampleMaxError
C#
public void SetDetailSampleMaxError(float detailSampleMaxError);
Parameters
NameTypeDefault
detailSampleMaxErrorfloat—
SetEdgeMaxErrorvoid
# SetEdgeMaxError
C#
public void SetEdgeMaxError(float edgeMaxError);
Parameters
NameTypeDefault
edgeMaxErrorfloat—
SetEdgeMaxLengthvoid
# SetEdgeMaxLength
C#
public void SetEdgeMaxLength(float edgeMaxLength);
Parameters
NameTypeDefault
edgeMaxLengthfloat—
SetFilterBakingAabbvoid
# SetFilterBakingAabb
C#
public void SetFilterBakingAabb(Aabb bakingAabb);
Parameters
NameTypeDefault
bakingAabbAabb—
SetFilterBakingAabbOffsetvoid
# SetFilterBakingAabbOffset
C#
public void SetFilterBakingAabbOffset(Vector3 bakingAabbOffset);
Parameters
NameTypeDefault
bakingAabbOffsetVector3—
SetFilterLedgeSpansvoid
# SetFilterLedgeSpans
C#
public void SetFilterLedgeSpans(bool filterLedgeSpans);
Parameters
NameTypeDefault
filterLedgeSpansbool—
SetFilterLowHangingObstaclesvoid
# SetFilterLowHangingObstacles
C#
public void SetFilterLowHangingObstacles(bool filterLowHangingObstacles);
Parameters
NameTypeDefault
filterLowHangingObstaclesbool—
SetFilterWalkableLowHeightSpansvoid
# SetFilterWalkableLowHeightSpans
C#
public void SetFilterWalkableLowHeightSpans(bool filterWalkableLowHeightSpans);
Parameters
NameTypeDefault
filterWalkableLowHeightSpansbool—
SetParsedGeometryTypevoid
# SetParsedGeometryType
C#
public void SetParsedGeometryType(NavigationMesh.ParsedGeometryType geometryType);
Parameters
NameTypeDefault
geometryTypeNavigationMesh.ParsedGeometryType—
SetRegionMergeSizevoid
# SetRegionMergeSize
C#
public void SetRegionMergeSize(float regionMergeSize);
Parameters
NameTypeDefault
regionMergeSizefloat—
SetRegionMinSizevoid
# SetRegionMinSize
C#
public void SetRegionMinSize(float regionMinSize);
Parameters
NameTypeDefault
regionMinSizefloat—
SetSamplePartitionTypevoid
# SetSamplePartitionType
C#
public void SetSamplePartitionType(NavigationMesh.SamplePartitionTypeEnum samplePartitionType);
Parameters
NameTypeDefault
samplePartitionTypeNavigationMesh.SamplePartitionTypeEnum—
SetSourceGeometryModevoid
# SetSourceGeometryMode
C#
public void SetSourceGeometryMode(NavigationMesh.SourceGeometryMode mask);
Parameters
NameTypeDefault
maskNavigationMesh.SourceGeometryMode—
SetSourceGroupNamevoid
# SetSourceGroupName
C#
public void SetSourceGroupName(StringName mask);
Parameters
NameTypeDefault
maskStringName—
SetVertices2 overloads
# SetVertices · 1/2
C#
public void SetVertices(Vector3[] vertices);

Sets the vertices that can be then indexed to create polygons with the NavigationMesh.AddPolygon method.

Parameters
NameTypeDefault
verticesVector3[]—
# SetVertices · 2/2
C#
public void SetVertices(ReadOnlySpan<Vector3> vertices);

Sets the vertices that can be then indexed to create polygons with the NavigationMesh.AddPolygon method.

Parameters
NameTypeDefault
verticesReadOnlySpan<Vector3>—
SetVerticesPerPolygonvoid
# SetVerticesPerPolygon
C#
public void SetVerticesPerPolygon(float verticesPerPolygon);
Parameters
NameTypeDefault
verticesPerPolygonfloat—

NavigationMesh.ParsedGeometryType

ValueDescription
Both = 2

Both NavigationMesh.ParsedGeometryType.MeshInstances and NavigationMesh.ParsedGeometryType.StaticColliders.

Max = 3

Represents the size of the NavigationMesh.ParsedGeometryType enum.

MeshInstances = 0

Parses mesh instances as geometry. This includes MeshInstance3D, CsgShape3D, and GridMap nodes.

StaticColliders = 1

Parses StaticBody3D colliders as geometry. The collider should be in any of the layers specified by NavigationMesh.GeometryCollisionMask.

NavigationMesh.SamplePartitionTypeEnum

ValueDescription
Layers = 2

Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles.

Max = 3

Represents the size of the NavigationMesh.SamplePartitionTypeEnum enum.

Monotone = 1

Monotone partitioning. Use this if you want fast navigation mesh generation.

Watershed = 0

Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas.

NavigationMesh.SourceGeometryMode

ValueDescription
GroupsExplicit = 2

Uses nodes in a group for geometry. The group is specified by NavigationMesh.GeometrySourceGroupName.

GroupsWithChildren = 1

Scans nodes in a group and their child nodes recursively for geometry. The group is specified by NavigationMesh.GeometrySourceGroupName.

Max = 3

Represents the size of the NavigationMesh.SourceGeometryMode enum.

RootNodeChildren = 0

Scans the child nodes of the root node recursively for geometry.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.