Skip to content

HyungseobKim/NavMesh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Navigation Mesh

Automatic generation of navigation meshes and pathfinding on the meshes.
It uses a polygon triangulation algorithm to generate navigation meshes and the A* algorithm to find a path.

Used C++, SDL2, OpenGL, and ImGui.
All source codes are in the NavMesh folder, and the executable is in the Demo folder with libraries.

How to use the demo

Use left/right mouse buttons to set start/end points of a path.
You can change the weight of the heuristic for A* using "Weight" bar.
Use "Show all nodes considered" option to see how it affects the pathfinding.
"Path smoothing" option shows a more narrowed path.
You may change colors using the color editor.

How to edit the geography in the demo

Click "Edit mode" in the UI.
To move walls, drag a red box at the center of a wall.
To change the shape of the wall, drag a red box on the vertices of a wall.

Algorithms

Generating navigation meshes uses Polygon Triangulation algorithm, which has two parts.

  1. Partition the polygon into y-monotone pieces.
  2. Triangulate each piece.

After triangulation has done, there is the pathfinding section.

  1. Find the path between two given points on the polygon using A*.
  2. Smooth the path using Funnel Algorithm.

You can read the detailed explanation of the algorithms below.

  1. Partitioning
  2. Triangulation
  3. Pathfinding
  4. Conclusion

About

Automatic navigation mesh generation and pathfinding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors