Integrating recast & detour to project #583
-
Hello! Im trying to integrate rc and dt to my project however im a bit stuck trying to figure out how to use it. I have the library itself included in my project but im not sure how to actually use it. I have checked out both of them but there is just so much so i don't know what is necessery for it to work. Like i tried copying the Sample_SoloMesh to my project but then it wanted InputGeom and Sample which needed SampleInterfaces etc.. idk how much of this is needed to just get the core to work. Like i already have a modelloader from which i can get verts, indices, normals etc.. Can i use this info to use recast or do i actually need InputGeom and everything else? EDIT: I figured it out after a while of experimenting :P |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi! I'm in the process of writing up a more detailed intro guide to Recast, but the gist of it is:
Yes, you can use your modelloader! You likely don't need 95% of what's in RecastDemo. The demo code tries to be a super full featured demo that uses every feature Recast has to offer, and keep intermediate results so you can examine them in the UI, and track build timing information. There's a lot of code in there you probably don't need. The relevant code is probably just these lines in recastnavigation/RecastDemo/Source/Sample_SoloMesh.cpp Lines 388 to 641 in d0b2ed8 For just building a navmesh you essentially need to call the following functions:
There's a lot happening here, but that's by design. It's extremely common to want to tie into the navmesh building process at certain points to add things like spatial annotations, cover points, etc. so Recast airs on the side of being overly verbose, with the goal of being easily customizable. Long term I'd like to add a higher-level API that's a bit simpler to use, but for now this is about as concise as it gets. |
Beta Was this translation helpful? Give feedback.
Hi! I'm in the process of writing up a more detailed intro guide to Recast, but the gist of it is:
Yes, you can use your modelloader! You likely don't need 95% of what's in RecastDemo.
The demo code tries to be a super full featured demo that uses every feature Recast has to offer, and keep intermediate results so you can examine them in the UI, and track build timing information. There's a lot of code in there you probably don't need.
The relevant code is probably just these lines in
Sample_SoloMesh::handleBuild
:r…