C# implementation of 2D Nav-mesh, that uses axis-aligned rectangles, for FlatRedBall game framework.
- Use your favorite way to include FRBNavMesh (project or dll) into your FlatRedBall game project.
- Create main nav-mesh object using
and giving it List of FlatRedBall
new FRBNavMesh.NavMesh<FRBNavMesh.PortalNode,FRBNavMesh.Link>(..)
AxisAlignedRectangle
s that idealy share some edges. They will be used to define "wakable areas" for path-finding agents. - Use
YourFRBNavMeshInstance.FindPath(..)
to get shortest path from start to end Point, as both List ofPoint
s and List ofFRBNavMesh.PortalNode
s
-
You can use
FRBNavMesh.TiledExtensions.BuildNavMeshFromTiled<TLink,TNode>(..)
to build NavMesh from Tiled editor .tmx file, loaded by FlatRedBall Tiled plugin.- You need to have a separate Object layer in your tmx map, with rectangle shapes in it.
-
You can derive your own
PortalNode
and/orLink
classes fromFRBNavMesh.PortalNodeBase<TLink,TNode>
andFRBNavMesh.LinkBase<TLink,TNode>
. Your classes can than contain additional data used by your project.- Your derived Node and Link class(es) must be concrete (not generic) for you to be able to use them with
NavMesh<TNode,TLink>
. NavMesh class itself can be used as generic, supplying it your classes.
- Your derived Node and Link class(es) must be concrete (not generic) for you to be able to use them with
Project doesn't (yet) implement any dynamic obstacle avoidance or flocking functionality.
Will support "floors" later.
This project uses modified version of A* implementation from FlatRedBall.
This project is inspired by Phaser-Navmesh javascript rects-based nav-mesh project for Phaser engine.