- fixed missing index in calls to get query filter
- fixed bug in dtCrowd:addAgent getNearestPolygon()
This commit is contained in:
parent
ad74197c8f
commit
d477061f83
@ -525,6 +525,8 @@ int dtCrowd::addAgent(const float* pos, const dtCrowdAgentParams* params)
|
|||||||
|
|
||||||
dtCrowdAgent* ag = &m_agents[idx];
|
dtCrowdAgent* ag = &m_agents[idx];
|
||||||
|
|
||||||
|
updateAgentParameters(idx, params);
|
||||||
|
|
||||||
// Find nearest position on navmesh and place the agent there.
|
// Find nearest position on navmesh and place the agent there.
|
||||||
float nearest[3];
|
float nearest[3];
|
||||||
dtPolyRef ref = 0;
|
dtPolyRef ref = 0;
|
||||||
@ -540,8 +542,6 @@ int dtCrowd::addAgent(const float* pos, const dtCrowdAgentParams* params)
|
|||||||
ag->boundary.reset();
|
ag->boundary.reset();
|
||||||
ag->partial = false;
|
ag->partial = false;
|
||||||
|
|
||||||
updateAgentParameters(idx, params);
|
|
||||||
|
|
||||||
ag->topologyOptTime = 0;
|
ag->topologyOptTime = 0;
|
||||||
ag->targetReplanTime = 0;
|
ag->targetReplanTime = 0;
|
||||||
ag->nneis = 0;
|
ag->nneis = 0;
|
||||||
|
@ -155,7 +155,7 @@ void CrowdToolState::init(class Sample* sample)
|
|||||||
crowd->init(MAX_AGENTS, m_sample->getAgentRadius(), nav);
|
crowd->init(MAX_AGENTS, m_sample->getAgentRadius(), nav);
|
||||||
|
|
||||||
// Make polygons with 'disabled' flag invalid.
|
// 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.
|
// Setup local avoidance params to different qualities.
|
||||||
dtObstacleAvoidanceParams params;
|
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.
|
// Find nearest point on navmesh and set move request to that location.
|
||||||
dtNavMeshQuery* navquery = m_sample->getNavMeshQuery();
|
dtNavMeshQuery* navquery = m_sample->getNavMeshQuery();
|
||||||
dtCrowd* crowd = m_sample->getCrowd();
|
dtCrowd* crowd = m_sample->getCrowd();
|
||||||
const dtQueryFilter* filter = crowd->getFilter();
|
const dtQueryFilter* filter = crowd->getFilter(0);
|
||||||
const float* ext = crowd->getQueryExtents();
|
const float* ext = crowd->getQueryExtents();
|
||||||
|
|
||||||
if (adjust)
|
if (adjust)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user