Commit bb89f2f5 authored by Arash HABIBI's avatar Arash HABIBI
Browse files

commentaire

parent eee58981
......@@ -223,7 +223,6 @@ inline void renderAgent(EnvMap& m, Agent* agent, bool showNeighborDist = false,
//show goals
if (renderPath)
{
<<<<<<< HEAD
glLineWidth(3.0f) ;
glBegin(GL_LINE_STRIP) ;
for (std::vector<VEC3>::iterator it = (agent->goals_.begin()) ; it != agent->goals_.end() ;
......
......@@ -602,8 +602,9 @@ void Agent::computeNewVelocity()
int obst_power = 2 ; // the power to which elevate the agent-obstacle distance
Obstacle* obst ;
#define ARASH
#define ARASH
#ifdef ARASH
nb_mos = 0;
for(std::vector<std::pair<float, Obstacle*> >::iterator it = movingObstacleNeighbors_.begin() ;
it != movingObstacleNeighbors_.end() ;
......@@ -621,6 +622,7 @@ void Agent::computeNewVelocity()
mo_count++)
{
mo = movingObstacles_[mo_count];
// cerr << "mo_use_ellipse = " << mo->use_ellipse << endl;
if(mo->use_ellipse)
{
float dist = (getPosition()-mo->focus2).norm() + (getPosition()-mo->focus1).norm();
......@@ -647,6 +649,7 @@ void Agent::computeNewVelocity()
{
}
}
#else
float force_value;
for(std::vector<std::pair<float, Obstacle*> >::iterator it = movingObstacleNeighbors_.begin() ;
......@@ -706,9 +709,9 @@ void Agent::computeNewVelocity()
force_value = fixed_obst_stiffness*collision_softening_factor*(effective_range-dist);
}
if(fixed_obst.mo!=NULL)
cerr << "Collision avec limace !!!" << endl;
fixed_obst=it->second ;
if(fixed_obst->mo!=NULL)
cerr << "Collision avec limace !!!" << endl;
VEC3 p1=fixed_obst->p1 ;
VEC3 p2=fixed_obst->p2 ;
vec=p2-p1;
......
......@@ -757,7 +757,8 @@ void MovingObstacle::computePrefVelocity() //calcul du vecteur optimal pour atte
float goalDist2 = goalVector.norm2() ;
if (goalDist2 < 5.0f)
// if (goalDist2 < 5.0f)
if (goalDist2 < 500.0f)
{
curGoal_ = (curGoal_ + 1) % goals_.size() ;
goalVector = goals_[curGoal_] - center ;
......
......@@ -579,7 +579,7 @@ void SocialAgents::animate()
// if (CityGenerator::animateCity<PFP>(&sim.envMap_)) sim.addPathToCorner() ;
// sim.addPathsToAgents() ;
//
std::cout << "t : " << simulator.globalTime_ << std::endl ;
// std::cout << "t : " << simulator.globalTime_ << std::endl ;
//
// timeval startTime ;
// gettimeofday(&startTime, NULL) ;
......
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