Navmesh Creator

The NavMesh Creator is a tool that allows converting any geometry into a Golaem navMesh. This navMesh can be used for navigation and pathfinding, as well as for placing crowd entities while avoiding obstacles.

The tool designed to compute a NavMesh and save it in the Golaem Crowd file format (.gse) can be accessed through:

  • Crowd Shelf: 
  • Crowd Menu: NavMesh Creator
  • MEL command: glmNavMeshCreatorCmd;

Geometry Prerequisites

The NavMesh Creator only handles meshes composed of triangles or convex quads. All other meshes will be considered invalid. However, Maya provides a tool that can triangulate any mesh, thus making it useable by the NavMesh Creator. Just select the geometry and use the Maya Polygons / Mesh / Triangulate menu.
 
Also notice that even if the geometry is displayed with a smooth level, the NavMesh Creator will only take into account the base geometry without smoothing.
 

Configuration

To start using the NavMesh Creator, first select the geometry you wish to transform. You can select any mesh or group of meshes in Maya.
If no mesh is selected a warning will be displayed.
 
This part explains how to configure the navmesh creation 
 
The navmesh creator tool
 

Creation Type

This combo box specifies the subdivision technique used to process the input geometry. The available choices are:
  • Voxel Based Subdivision: this technique creates a voxel mold that approximates the input geometry. The voxels are then used to extract contours around obstacles and around the edges of the world, which in turn are used to create the navigation mesh. The process uses the Recast library (see http://code.google.com/p/recastnavigation/).

    This technique is very fast on most environments, especially when increasing the voxel size. On the other hand, the computed navigation mesh is only a loose approximation of the input geometry (depending on the voxel size), and some details like steps will not be preserved. The computation time mostly depends on the size of the environment, and it is not influenced by the topological complexity of it (like the number of triangles, of obstacles, holes, slopes, etc.).
  • Exact Subdivision: this technique conserves all the details of the original geometry, which means that the resulting navigation mesh will follow the original geometry very closely (some simplifications will be made when dealing with nearly coplanar triangles). The computation time mostly depends on the topological complexity of the environment and it is not influenced by the size of the environment.
While both techniques can be used on any input geometry, Voxel Based Subdivision works best with complex environments that are not very large, like a building for example, while Exact Subdivision works best with huge simple environments, like a battlefield.
 

Statistics

The statistics panel is updated each time the geometry selection changes. It shows the total number of triangles, the bounding box origin and the bounding box size of the selected meshes.
 

Crowd Unit

This combo box specifies how to convert Maya's units to Crowd units. It should be set also in the Crowd Manager afterwards.
 

Crowd Entity Parameters

This tab contains all the Entity related parameters needed to compute the navMesh. These parameters are available on both voxel based and exact subdivisions.
 
The CrowdEntity parameters tab
 
Maximum Step Height the maximum navigable step height for the Entities that will be simulated in the computed navMesh. An object with a height exceeding this parameter will be considered an obstacle and crowd entities will navigate around it. This parameter cannot exceed the minimum clearance (see below).
Minimum Radius the minimum radius of the Entities that will be simulated in the computed navMesh. This parameter only affects the roadmap that will be built on top of the navigation mesh (see 6.5.2).
Minimum Clearance the minimum height that a Entity will have when navigating on the computed navMesh. This parameter cannot be smaller than the maximum step height (see above).
Maximum Navigable Slope the maximum angle of a slope on which a Entity will navigate on the computed navMesh. Slopes with a higher angle will be considered obstacles.

Advanced Parameters - Voxel Subdivision

Notice that the default advanced parameters are suitable for most cases.

This tab contains the advanced parameters of the voxel subdivision. They are divided into 3 categories: Rasterization, Regions and Contours.
 
The Rasterization parameters are:
The advanced voxel subdivision parmeters tab - Rasterization
 
Double Sided Geometry voxel based subdivision is sensitive to the orientation of the input triangles. Triangles facing down will not be taken into account unless this option is checked.
Voxel Length/Width this parameter determines the width and length of a voxel. Using bigger voxels reduces computing time but the computed navmesh will also be less precise.
Voxel Height this parameter determines the height of a voxel. Using bigger voxels reduces computing time but the computed navmesh will also be less precise.
Voxel Count this label displays the total number of voxels that will be generated from the input geometry, and also the number of voxels along each axis (x, y and z). The voxels count is updated when the voxel length/width, height, or input geometry change.
Tile Length/Width large environments are divided into square tiles that can be computed individually, thus reducing the memory footprint of the computation. This parameter defines the length and width of each tile, in voxels.
Tiles Count this label displays the number of tiles along the x and the z axis. The tiles count is updated then the voxel length/width, the tile length/width or the input geometry change.
The walkable voxels are grouped together into regions, based on the obstacles detected in the environment. The Regions parameters are:
 
The advanced  voxel subdivision parameters tab - Regions
 
Minimum Region Size this parameter defines the minimum number of interconnected voxels that are allowed to form isolated areas.
Merged Region Size regions with a voxel count smaller than this parameter will be merged with other regions if possible.
The contours are the limits between regions. The Contours parameters are:
 
The advanced voxel subdivision parameters tab - Contours
 
Maximum Edge Length this parameter sets the maximum length of an edge along the borders of the navigation mesh. Edges longer than this value will be split into several edges as needed.
Maximum Edge Error raw contours are computed as limits between voxels of different regions. These contours are then simplified to reduce the number of edges in the navMesh. This parameter sets the maximum distance a simplified contour's borders should deviate from the original raw contour.

 

Advanced Parameters - Exact Subdivision

Notice that the default advanced parameters are suitable for most cases.

This tab contains the advanced parameters of the exact subdivision.
 
The advanced exact subdivision parameters tab
 
Keep Only Greatest Connex Zone

if checked, only the greatest (in term of area) isolated portion of the spatial environment will be kept

Minimum Connex Zone Surface Minimum area (in maya unit²) for an isolated portion of the spatial environment to be kept. It's used when the Keep Only Greatest Connex Zone is unchecked.
Maximum Flat Height the maximum height at which a step will be considered flat by the crowd entities
Vertices Merge Distance if two input geometry vertices are closer to each other than this value, they are merged in the computed navMesh
Altitude Precision if geometry triangle vertices distances to a plane are less that the given value, this triangle is considered coplanar with this plane
Vertical Threshold if the 2D projection of an original geometry triangle has a minimum height inferior to this value, it is modified to be vertical
Alignment Threshold given two 2D segments [p1,p2] and [p2,p3], if distance(p2,[p1,p3]) < Alignment Threshold, the three points are aligned
Maximum Horizontal Slope the maximum angle to which a slope is considered horizontal.
Project Walls Geometry if checked, the walls geometry is projected when computing the prisms section (might help if some walls are ignored)

Export

The NavMesh computation can be launched by using the "Compute and save…" button.
 
Note that depending on the scene complexity, computation can take a long time and that you will not be able to use this Maya instance until it ends. You can check the computation progress in the NavMesh Creator status bar.
 
This creates a .gse file and a Terrain Locator that uses this NavMesh file and the input geometry