All right thanx,
I was wondering if it was integrated directly in the demo. I'll code it then, thx
All right thanx,
I was wondering if it was integrated directly in the demo. I'll code it then, thx
"What can be asserted without proof can be dismissed without proof." --- Christopher Hitchens
Wow now it gets verry mysteryus. If i use your mesh settings (origion...) its the same as my Problem. But if i use the Original code, than i can navigat in the same Tile but not from tile to tile :S
If you cannot navigate from one tile to the other, your settings are likely incorrect.
KK that error i resolved^^ Seems like recast can't handle 533.333.... So now the Tiled Navigation reworks now i will tray your methode^^
But still the same error: Can dump mesh if X: 0 Y: 0 it works well if i change the Tile Position Navigation is not working
Here the Build Funktion:
Code:void Sample_TileMesh::buildAllTiles() { if (!m_geom) return; if (!m_navMesh) return; const float* bmin = m_geom->getMeshBoundsMin(); const float* bmax = m_geom->getMeshBoundsMax(); int gw = 0, gh = 0; rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh); const int ts = (int)m_tileSize; const int tw = (gw + ts-1) / ts; const int th = (gh + ts-1) / ts; const float tcs = m_tileSize*m_cellSize; int AdtX = 40; int AdtY = 33; // Start the build process. m_ctx->startTimer(RC_TIMER_TEMP); for (int y = 0; y < th; ++y) { for (int x =0; x < tw; ++x) { m_tileBmin[0] = bmin[0] + x*tcs; m_tileBmin[1] = bmin[1]; m_tileBmin[2] = bmin[2] + y*tcs; m_tileBmax[0] = bmin[0] + (x+1)*tcs; m_tileBmax[1] = bmax[1]; m_tileBmax[2] = bmin[2] + (y+1)*tcs; int dataSize = 0; unsigned char* data = buildTileMesh((AdtX * tw)+x, (AdtY * th) + y, m_tileBmin, m_tileBmax, dataSize); if (data) { // Remove any previous data (navmesh owns and deletes the data). m_navMesh->removeTile(m_navMesh->getTileRefAt(x,y,0),0,0); // Let the navmesh own the data. dtStatus status = m_navMesh->addTile(data,dataSize,DT_TILE_FREE_DATA,0,0); if (dtStatusFailed(status)) dtFree(data); } } } // Start the build process. m_ctx->stopTimer(RC_TIMER_TEMP); m_totalBuildTimeMs = m_ctx->getAccumulatedTime(RC_TIMER_TEMP)/1000.0f; }
Last edited by hamburger12; 08-24-2011 at 05:14 PM.
check returned code at each step... ie
1. navMesh->calcTileLoc(startPoint, &start_tile_x, &start_tile_y)
check if tile_x and tile_y are loaded
2. step 1 for endPoint
3. rc = m_navQuery->findNearestPoly( startPoint, m_extent, filter, &startRef, 0) ;
check dtStatusSucceed(rc) and navMesh->isValidPolyRef(startRef) both true
4. step 3 for endPoint, endRef
5. make sure tiles required for navigation are loaded
6. rc = m_navQuery->findPath(....)
check rc - you will get precise info why (if any) findPath failed.
something like that.
Seems like calcTileLoc fails :S
well then, either coordinates are wrong (x,y) or/and origin is wrong or tileHeight/tileWidth
calcTileLoc is pretty straightforward
*tx = (int)floorf((pos[0]-m_orig[0]) / m_tileWidth);
*ty = (int)floorf((pos[2]-m_orig[2]) / m_tileHeight);
I think m_orig is the Problem.
Ok got it until the part of loading meshes. All went right, if i just want to navigate in the same ADT. But if i want to navigate from atd to adt it just navigate till the endline.
Last edited by hamburger12; 08-28-2011 at 04:04 PM.
it's again a problem of tile number.
Sure? I use 1 tile per adt. I also can navigate in both tiles when they loaded at Same time. But not from tile to tile. For calculate tile x and y i use calctilelocation and the x and y are the Same as the adt x y.
most likey tiles are not getting connected. When detour loads tiles it builds portals between tiles for intertile navigation and if tiles have gap between edges - detour consider them as not connected therefore navigation fails. the best way to check it - make standalone program (or alter demo project) to load your generated mesh and visually check if there is gap between tiles.
when you generate tiles with recast - make sure you triangles soup has some more data around calculated area (that is for each adt add some triangles from neighbor adts)
Mh seems like its not connected o.O
![]()
Last edited by hamburger12; 08-29-2011 at 12:41 PM.
yup. to fix it as i said - feed more data from neighboring adts
Mh think the prob is that the Navgeneartion is not 100% :S
![]()