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

10_01_2013

parent 78c423cc
......@@ -181,7 +181,7 @@ inline void renderAgent(EnvMap& m, Agent* agent, bool showNeighborDist = false,
for (std::vector<VEC3>::iterator it = ++(agent->goals_.begin()) ; it != agent->goals_.end() ;
++it)
{
glVertex3f((*it)[0], (*it)[1], (*it)[2]) ;
glVertex3f((*it)[0], (*it)[1], agent->agentNo) ;
}
glEnd() ;
glLineWidth(1.0f) ;
......
......@@ -563,8 +563,12 @@ void Agent::computeNewVelocity()
VEC3 u_goal = p_goal - getPosition();
u_goal.normalize();
cerr << agentNo << "---------------- position = " << getPosition() << endl;
forces += goal_attraction_force * u_goal;
cerr << "forces = " << forces << endl;
//----- forces dues à la répulsion des obstacles en mouvement ----------
VEC3 norm;
......@@ -648,6 +652,7 @@ void Agent::computeNewVelocity()
norm[0]=vec[1] ;
norm[1]=-vec[0] ;
forces += force_value * norm;
cerr << "obstacles fixes : nobst=" << nobst << " dist=" << dist << " force=" << force_value*norm << endl;
// cerr << "force_value = " << force_value << endl;
// cerr << "norm=" << norm << endl;
......@@ -693,13 +698,15 @@ void Agent::computeNewVelocity()
float force_value = - ag_stiffness*collision_softening_factor*(combinedRadius-dist)
- ag_damping * (dist - previous_dist) / sim_->timeStep_;
cerr << "autres agents : force_value = " << force_value << endl;
forces += force_value * u_other;
}
}
//------- calcul de la trainee --------------------------------------
forces -= ag_ambient_damping * velocity_;
// forces -= ag_ambient_damping * velocity_;
//------- calcul de la nouvelle valeur de la vitesse ----------------
......
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