Commit a92f10fd authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

youpi

parent 2f25e584
......@@ -52,31 +52,23 @@ void Agent::updateAgentNeighbors()
for(std::vector<Agent*>::iterator it = agents.begin(); it != agents.end(); ++it)
{
VEC3 pop = part_.m_position - (*it)->part_.m_position;
float distSq = pop.norm2();
float distSq = (part_.m_position - (*it)->part_.m_position).norm2();
if(*it != this && (agentNeighbors_.size() < maxNeighbors_ || distSq < maxDist) && distSq < neighborDistSq_)
{
if(distSq > maxDist)
maxDist = distSq;
// if( sim_->envMap_.map.sameFace(part_.d,(*it)->part_.d) ||
// !sim_->envMap_.buildingMark.isMarked(sim_->envMap_.map.phi2(part_.faceOrientationState((*it)->getPosition()))))
agentNeighbors_.push_back(std::make_pair(distSq, *it));
agentNeighbors_.push_back(std::make_pair(distSq, *it));
}
}
for(std::vector<Agent*>::iterator it = neighborAgents.begin(); it != neighborAgents.end(); ++it)
{
VEC3 pop = part_.m_position - (*it)->part_.m_position;
float distSq = pop.norm2();
float distSq = (part_.m_position - (*it)->part_.m_position).norm2();
if((agentNeighbors_.size() < maxNeighbors_ || distSq < maxDist) && distSq < neighborDistSq_)
{
if(distSq > maxDist)
maxDist = distSq;
// if( sim_->envMap_.map.sameFace(part_.d,(*it)->part_.d) ||
// !sim_->envMap_.buildingMark.isMarked(sim_->envMap_.map.phi2(part_.faceOrientationState((*it)->getPosition()))))
agentNeighbors_.push_back(std::make_pair(distSq, *it));
agentNeighbors_.push_back(std::make_pair(distSq, *it));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment