diff --git a/DetourCrowd/Source/DetourCrowd.cpp b/DetourCrowd/Source/DetourCrowd.cpp index 9548c7b..7564958 100644 --- a/DetourCrowd/Source/DetourCrowd.cpp +++ b/DetourCrowd/Source/DetourCrowd.cpp @@ -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; diff --git a/RecastDemo/Source/CrowdTool.cpp b/RecastDemo/Source/CrowdTool.cpp index 98ded8e..c838a1e 100644 --- a/RecastDemo/Source/CrowdTool.cpp +++ b/RecastDemo/Source/CrowdTool.cpp @@ -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)