NMGen is adaptation of Recast's static mesh functionality in the Java language for purposes of study and experimentation.

See:
          Description

Packages
org.critterai.nmgen Provides data structures and algorithms useful for generating navigation meshes which represent the traversable surface area of an arbitrary source triangle mesh.

 

NMGen is adaptation of Recast's static mesh functionality in the Java language for purposes of study and experimentation. It takes an arbitrary triangle mesh as input and outputs meshes representing the traversable surface of the original mesh.

Project Home
Project Source
License

Navigation Mesh Generation Process

This process is an adaptation of portions of Recast, a C++ navigation mesh generator created and released by Mikko Mononen under the MIT license.

The general process is as follows:

  1. Voxelization - Create a solid heightfield from the source geometry.
  2. Generate Regions - Detect the top surface area of the solid heightfield and divide it up into contiguous regions.
  3. Generate Contours - Detect the contours of the regions and form them into simple polygons.
  4. Generate Polygon Mesh - Divide the contours into convex polygons.
  5. Generate Detailed Mesh - Triangulate the polygon mesh and add height detail.

See The High Level Process for more information.

The class which implements this process is NavmeshGenerator.

Each stage of the process is implemented by data and builder classes. The output of one stage is required as input for the next:

Stage Builder Class Data Class (output) Builder Input
Voxelization SolidHeightfieldBuilder SolidHeightfield Source Geometry
Region Generation OpenHeightfieldBuilder OpenHeightfield SolidHeightfield
Contour Generation ContourSetBuilder ContourSet OpenHeightfield (Fully built.)
Polygon Mesh Generation PolyMeshField PolyMeshField ContourSet
Detail Mesh Generation DetailMeshBuilder TriangleMesh PolyMeshField



Project Home and Source Code

Copyright 2010 Stephen Pratt. All rights reserved. Use is subject to license terms.