View on GitHub

SharpNav

Advanced Pathfinding for C#

Download this project as a .zip file Download this project as a tar.gz file

What is it?

SharpNav is a library that generates and finds paths through navigation meshes. It is functionally equivalent to Mikko Monomen's wonderful Recast Navigation.

What are the benefits of SharpNav over alternatives?

There are several:

Usage

SharpNav is both highly configurable and simple to use. If you want to generate a NavMesh from a single mesh, it is as simple as the following block of code:

//prepare the geometry from your mesh data
var tris = TriangleEnumerable.FromIndexedVertices( ... );

//use the default generation settings
var settings = NavMeshGenerationSettings.Default;
settings.AgentHeight = 1.7f;
settings.AgentWidth = 0.6f;

//generate the mesh
var navMesh = NavMesh.Generate(tris, settings);

For finer control over the generation process, you can refer to the Examples project.

Compiling

SharpNav follows the standard C# project structure. It is actively developed on Windows with Visual Studio 2012 and on Linux and OS X with MonoDevelop, so it should compile just fine in those cases.

SharpNav can be configured to depend on other libraries. Each one has it's own compile configuration that requires the library to be installed on the machine (in the GAC or the assembly search path), with the exception being OpenTK. OpenTK is used for the Examples project, and is therefore included in the repository. If you want to compile against a different version of OpenTK, drop in your replacement in the Binaries folder.

SharpNav is proudly an RCOS project.