MachoChen / recastnavigation

Automatically exported from code.google.com/p/recastnavigation
zlib License
0 stars 0 forks source link

Pathfind Follow end pos bug #203

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Test Navmesh -> Pathfind Follow 

Screenshots: 
 Bug: http://img.mentalx.org/30523337.jpg 
 No bug: http://img.mentalx.org/96222704.jpg 
 Bug again: http://img.mentalx.org/80978739.jpg 
 No bug: http://img.mentalx.org/64305071.jpg 
 Bug: http://img.mentalx.org/96285360.jpg

Simplest way to reproduce problem:
Put start location on first floor and end location on second floor like this:
http://img.mentalx.org/10805234.jpg
If path not bugged, try move little bit one of locations.

Code below fix problem for me:

void NavMeshTesterTool::recalc() 
{ 
   ... 
   if (m_toolMode == TOOLMODE_PATHFIND_FOLLOW) 
   { 
     ... 
     // old code 
     //m_navQuery->closestPointOnPolyBoundary(polys[npolys-1], m_epos, 
 targetPos); 

    // fix 
     dtVcopy(targetPos, m_EndPos); 
     if (polys[npolys - 1] != m_EndRef) 
       m_navQuery->closestPointOnPoly(polys[npolys - 1], m_EndPos, 
 targetPos); 
     ... 
   } 
   ... 
}

Original issue reported on code.google.com by execm...@gmail.com on 2 Jun 2012 at 5:10

GoogleCodeExporter commented 8 years ago
Fixed on R345.

Original comment by memono...@gmail.com on 12 Jun 2012 at 3:53