Hi guys,
I've manage to convert single .obj file to .navmesh using the Sample_TileMesh.cpp file and calling SaveAll at the end of the handlebuild function in the recast demo code. It works fine but it would be way too long to convert each object file this way. The object files were extracted using wowmapper.
I've been trying to do it with my own code but I can't seem to get it working properly. I'm not setting the parameters correctly. Here's the code I'm using. I know that somewhere in the I should set the parameters but I don't know where to avoid having recast reset them to other values...
Now my question is, where should I set the parameters. I'm using the ones suggested by namreeb and I tried setting them inside the handlesbuild() function, but it doesn't work properly. The mesh is created but it's always 1k, so there is a problem with the params somewhere in the params structure creation.int _tmain(int argc, _TCHAR* argv[])
{
std::cerr <<"Création de la mesh !" << std::endl;
dtNavMesh* m_navMesh = new dtNavMesh();
Sample_TileMesh* STM = new Sample_TileMesh();
BuildContext ctx;
STM->setContext(&ctx);
InputGeom* geom = new InputGeom;
std::cerr << "Load l'objet" << std::endl;
geom->loadMesh(&ctx,"C:\\Users\\Millow\\Desktop\\Azeroth\\32_48.obj");
Sample* SampleInstance = new Sample();
STM->handleMeshChanged(geom);
STM->handleBuild();
STM->saveAll("C:\\Users\\Millow\\Desktop\\Azeroth\\32_48.navmesh",m_navMesh);
std::cerr <<
"Succes !" << std::endl;
char c;
c = getchar();
return 0;
}
Anyone has any suggestions/tips/code snippet that could help me. And yes, I did read pretty much everything I could find about navmesh creation, I'm still working on fixing this but it's long ans frustrating ! So any help is welcome.
Cheers !