esp::nav::NavMeshSettings struct

Configuration structure for NavMesh generation with recast.

Passed to PathFinder::build to construct the NavMesh.

Serialized with saved .navmesh files for later equivalency checks upon re-load.

See examples/tutorials/notebooks/ECCV_2020_Navigation.py and http://digestingduck.blogspot.com/2009/08/recast-settings-uncovered.html for more details on configuring these parameters for your use case.

Constructors, destructors, conversion operators

NavMeshSettings()

Public functions

void setDefaults()
void readFromJSON(const std::string& jsonFile)
Load the settings from a JSON file.
void writeToJSON(const std::string& jsonFile) const
Save the settings to a JSON file.

Public variables

float cellSize
XZ-plane cell size in world units. Size of square voxel sides in XZ.
float cellHeight
Y-axis cell height in world units. Voxel height.
float agentHeight
Minimum floor to 'ceiling' height that will still allow the floor area to be considered unobstructed in world units.
float agentRadius
Agent radius in world units.
float agentMaxClimb
Maximum ledge height that is considered to be traversable in world units.
float agentMaxSlope
The maximum slope that is considered walkable in degrees.
float regionMinSize
Region minimum size in voxels.
float regionMergeSize
Region merge size in voxels.
float edgeMaxLen
Edge max length in world units.
float edgeMaxError
The maximum distance a simplfied contour's border edges should deviate the original raw contour.
float vertsPerPoly
The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. [Limit: >= 3].
float detailSampleDist
Detail sample distance in voxels.
float detailSampleMaxError
Detail sample max error in voxel heights.
bool filterLowHangingObstacles
Marks navigable spans as non-navigable if the clearence above the span is less than the specified height.
bool filterLedgeSpans
Marks spans that are ledges as non-navigable.
bool filterWalkableLowHeightSpans
Marks navigable spans as non-navigable if the clearence above the span is less than the specified height.
bool includeStaticObjects
Whether or not to include STATIC RigidObjects as NavMesh constraints. Note: Used in Simulator recomputeNavMesh pre-process.

Variable documentation

float esp::nav::NavMeshSettings::agentHeight

Minimum floor to 'ceiling' height that will still allow the floor area to be considered unobstructed in world units.

Will be rounded up to a multiple of cellHeight.

float esp::nav::NavMeshSettings::agentRadius

Agent radius in world units.

The distance to erode/shrink the walkable area of the heightfield away from obstructions. Will be rounded up to a multiple of cellSize.

float esp::nav::NavMeshSettings::agentMaxClimb

Maximum ledge height that is considered to be traversable in world units.

For example, this constrains the maximum step height for traversing stairways. Will be truncated to a multiple of cellHeight.

float esp::nav::NavMeshSettings::regionMinSize

Region minimum size in voxels.

regionMinSize = sqrt(regionMinArea) The minimum number of cells allowed to form isolated island areas.

float esp::nav::NavMeshSettings::regionMergeSize

Region merge size in voxels.

regionMergeSize = sqrt(regionMergeArea) Any 2-D regions with a smaller span (cell count) will, if possible, be merged with larger regions.

float esp::nav::NavMeshSettings::edgeMaxLen

Edge max length in world units.

The maximum allowed length for contour edges along the border of the mesh.

Extra vertices will be inserted as needed to keep contour edges below this length. A value of zero effectively disables this feature.

A good value for edgeMaxLen is something like agenRadius*8. Will be rounded to a multiple of cellSize.

float esp::nav::NavMeshSettings::edgeMaxError

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

Good values are between 1.1-1.5 (1.3 usually yield good results). More results in jaggies, less cuts corners.

float esp::nav::NavMeshSettings::detailSampleDist

Detail sample distance in voxels.

Sets the sampling distance to use when generating the detail mesh. (For height detail only.)

[Limits: 0 or >= 0.9] [x cell_size]

float esp::nav::NavMeshSettings::detailSampleMaxError

Detail sample max error in voxel heights.

The maximum distance the detail mesh surface should deviate from heightfield data. (For height detail only.)

[Limit: >=0] [x cell_height]

bool esp::nav::NavMeshSettings::filterLedgeSpans

Marks spans that are ledges as non-navigable.

This filter reduces the impact of the overestimation of conservative voxelization so the resulting mesh will not have regions hanging in the air over ledges.

bool esp::nav::NavMeshSettings::filterWalkableLowHeightSpans

Marks navigable spans as non-navigable if the clearence above the span is less than the specified height.

Allows the formation of navigable regions that will flow over low lying objects such as curbs, and up structures such as stairways.