Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

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