recastnavigation / recastnavigation

Industry-standard navigation-mesh toolset for games

Home Page:http://recastnav.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] how dose dtPathQueue work with only one dtNavMeshQuery?

Git0Shuai opened this issue · comments

commented

Hello. I'm trying to figure out how dtPathQueue works and find this in the dtPathQueue::update() function.

// Handle query start.
if (q.status == 0)
{
q.status = m_navquery->initSlicedFindPath(q.startRef, q.endRef, q.startPos, q.endPos, q.filter);
}
// Handle query in progress.
if (dtStatusInProgress(q.status))
{
int iters = 0;
q.status = m_navquery->updateSlicedFindPath(iterCount, &iters);
iterCount -= iters;
}
if (dtStatusSucceed(q.status))
{
q.status = m_navquery->finalizeSlicedFindPath(q.path, &q.npath, m_maxPathSize);
}

if there are more than one dtPathQuery InProgress, how to determine which should be updated in line 120 as all dtPathQuery share the same m_navquery?

dosen't every dtPathQuery in the queue need a corresponding dtNavmeshQuery instead of sharing the same one?