`vleue_navigator` integration
There's landmass_oxidized_navigation for oxidized_navigation integration, which is convenient for generating navmeshes from avian colliders. But the plugin only supports 3D worlds.
On the other hand vleue_navigator, another Bevy pathfinding plugin, supports both 2D and 3D worlds. It'd be nice if support for vleue_navigator can be added too.
I think when I looked into this, there wasn't a way to get at the nav meshes, which is the only thing landmass needs. If we could split vlueu_navigator into the navigation part and the nav mesh generation part, that would be helpful. I might need to take another look into this, maybe I misunderstood.
If you're looking for 2d, I can share my janky 2d nav mesh generating code. It's not productionized, but it was working ok enough for my little project.
Yes, I'd love to see the code! Tried to figure out how to generate nav meshes from avian2d colliders, but no luck.
DetermineNavMeshPoint and ValidNavMeshPoint are unrelated (just a little utility). Essentially you add the plugin, set the NavMeshBuildSettings and NavMeshBounds, and then you add NavMeshCollider to any Avian collider you want to affect the nav mesh. Looks like I only supported ConvexPolygon colliders.
The algorithm is very simple:
- Start with a
georectangle the size ofNavMeshBounds - Create a
geopolygon for each collider. - Iteratively subtract each collider polygon from the original rectangle.
- Triangulate.
- Try to merge adjacent triangles into bigger polygons (as long as they remain convex).
- Pass that to landmass.
It doesn't support multiple islands (though you could certainly modify the code to do that), and it's almost definitely very slow, but for my purposes it was sufficient.
https://gist.github.com/andriyDev/d25cb698df06a4a9fbc09e54e295b849
Rerecast exists now, acting as hopefully the canonical way to do navmeshes in Rust :) Since vleue_navigator is also moving to rerecast, and you can easily write a backend for any 2D needs you may have in like 50 lines, I suggest closing this issue in favor of https://github.com/andriyDev/landmass/issues/131
I agree. Moving forward, I'm gonna focus on rerecast and treat vleue_navigator as a "competitor" navigation system (but hopefully friendly haha)