Robmaister / SharpNav

Advanced Pathfinding for C#
sharpnav.com
Other
537 stars 129 forks source link

Set mesh as walkable, non-walkable. #6

Closed SallyDT closed 10 years ago

SallyDT commented 10 years ago

Set certain meshes as walkable and non-walkable.

Robmaister commented 10 years ago

This is planned. Heightfield.RasterizeTriangles will eventually allow for more vertex formats (e.g. float[] for vertices and int[] for indices) and more control over what's considered walkable and unwalkable.

SallyDT commented 10 years ago

can you also provide a GUI interface to set which areas are walkable and not walkable?

Robmaister commented 10 years ago

I can add a slider for making slopes of a certain angle walkable/unwalkable, but for very similar reasons to #5, I'm not going to add any advanced features to the Examples project. The Examples project is supposed to be roughly functionally equivalent to the RecastDemo project in the Recast repository, which only allows you to tweak generation settings for a single mesh and also interact with the generated navmesh at a very basic level.

Robmaister commented 10 years ago

It is now possible to rasterize meshes with either per-object or per-triangle AreaFlags.

Heightfield.Rasterization.cs

You can generate an AreaFlags[] from a mesh using the AreaFlagsGenerator class. I'm not too happy with the implementation (and possibly even the public API) for AreaFlagsGenerator, so that will probably change in a short while.

This can't be controlled from the GUI in the Examples project yet, though, and likely won't change until after I make AreaFlagsGenerator better.

Robmaister commented 10 years ago

Controllable in 6e86822. I'm going to consider this issue resolved now.