- fixed missing index in calls to get query filter

- fixed bug in dtCrowd:addAgent getNearestPolygon()
This commit is contained in:
Mikko Mononen 2014-05-24 18:48:43 +03:00
parent ad74197c8f
commit d477061f83
2 changed files with 4 additions and 4 deletions

View File

@ -525,6 +525,8 @@ int dtCrowd::addAgent(const float* pos, const dtCrowdAgentParams* params)
dtCrowdAgent* ag = &m_agents[idx];
updateAgentParameters(idx, params);
// Find nearest position on navmesh and place the agent there.
float nearest[3];
dtPolyRef ref = 0;
@ -540,8 +542,6 @@ int dtCrowd::addAgent(const float* pos, const dtCrowdAgentParams* params)
ag->boundary.reset();
ag->partial = false;
updateAgentParameters(idx, params);
ag->topologyOptTime = 0;
ag->targetReplanTime = 0;
ag->nneis = 0;

View File

@ -155,7 +155,7 @@ void CrowdToolState::init(class Sample* sample)
crowd->init(MAX_AGENTS, m_sample->getAgentRadius(), nav);
// Make polygons with 'disabled' flag invalid.
crowd->getEditableFilter()->setExcludeFlags(SAMPLE_POLYFLAGS_DISABLED);
crowd->getEditableFilter(0)->setExcludeFlags(SAMPLE_POLYFLAGS_DISABLED);
// Setup local avoidance params to different qualities.
dtObstacleAvoidanceParams params;
@ -707,7 +707,7 @@ void CrowdToolState::setMoveTarget(const float* p, bool adjust)
// Find nearest point on navmesh and set move request to that location.
dtNavMeshQuery* navquery = m_sample->getNavMeshQuery();
dtCrowd* crowd = m_sample->getCrowd();
const dtQueryFilter* filter = crowd->getFilter();
const dtQueryFilter* filter = crowd->getFilter(0);
const float* ext = crowd->getQueryExtents();
if (adjust)