Commit 6fef9060 authored by pitiot's avatar pitiot
Browse files

obstacles = 1 seule particule + cellmarkermemo

parent e69d1be0
......@@ -121,8 +121,8 @@ public:
CellMarker<FACE> pedWayMark ;
// ajout moving obst
void addObstAsNeighbor (Obstacle * o, const std::list<Dart>& belonging_cells, std::list<Dart> * nieghbor_cells);
// void addMovingObstAsNeighbor (MovingObstacle * mo,std::list<Dart> belonging_cells, std::list<Dart> *neighbor_cells);
void addObstAsNeighbor (Obstacle * o, const std::vector<Dart>& belonging_cells, std::vector<Dart> * nieghbor_cells);
// void addMovingObstAsNeighbor (MovingObstacle * mo,std::vector<Dart> belonging_cells, std::vector<Dart> *neighbor_cells);
void pushObstNeighborInCells(Obstacle* o, Dart d);
void popObstNeighborInCells(Obstacle* o, Dart d);
void find_next(Obstacle* o,Dart * d, CellMarkerStore<FACE>& cms);
......@@ -194,9 +194,9 @@ public:
void update_registration(Obstacle * o);
void register_pop(Obstacle* o, int n);
void resetObstInFace(Obstacle* o);
void resetObstPartInFace(Obstacle* o, Dart d);
void resetPart(MovingObstacle * mo,int index, Dart d);
void resetPartSubdiv(Obstacle* o);
void resetObstPartInFace(Obstacle* o, Dart d);// empeche de viser une dart ayant disparu
void resetPart(MovingObstacle * mo, Dart d); // empeche de viser une dart ayant disparu pour les voisins
void displayMO(Obstacle * o);
/**************************************
......@@ -293,28 +293,28 @@ inline void EnvMap::popAgentInCells(Agent* agent, Dart d)
//ajout moving obst///////////////////////////////////////////////////////////////////////////////////////////////////////
inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::list<Dart>& belonging_cells, std::list<Dart> *neighbor_cells)
inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::vector<Dart>& belonging_cells, std::vector<Dart> *neighbor_cells)
{
assert(map.getCurrentLevel() == map.getMaxLevel());
assert(!belonging_cells.empty());
neighbor_cells->clear();
CellMarkerStore<FACE> MovingObstMark(map);
CellMarkerStore<FACE> OneRingMark(map);
for(std::list<Dart>::const_iterator it= belonging_cells.begin();it!=belonging_cells.end();++it)
for(std::vector<Dart>::const_iterator it= belonging_cells.begin();it!=belonging_cells.end();++it)
{
assert(!buildingMark.isMarked(*it)) ;
MovingObstMark.mark(*it);
}
std::list<Dart>::const_iterator it=belonging_cells.begin();
std::vector<Dart>::const_iterator it=belonging_cells.begin();
Dart beg = NIL;
Dart first =NIL;
Dart d=NIL;
Dart dd=NIL;
// CGoGNout<<"beg : "<<(*it)<<CGoGNendl;
//boucle pour trouver une face du voisinage de l'obstacle ne contenant pas l'obstacle
do
{
......@@ -337,7 +337,8 @@ inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::list<Dart>& bel
++it;
}while(first==NIL && it!=belonging_cells.end());
assert(!buildingMark.isMarked(d)) ;
assert(first!=NIL) ;
// CGoGNout<<"first : "<<first<<CGoGNendl;
d=first;
do
{
......@@ -348,7 +349,7 @@ inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::list<Dart>& bel
}
find_next(o,&d, MovingObstMark);
// CGoGNout<<"d : "<<d<<CGoGNendl;
}while(!map.sameFace(d,first));
}
......
......@@ -5,12 +5,12 @@
#include "utils.h"
#include "env_map.h"
#include <list>
#include "Algo/MovingObjects/particle_cell_2D_memo.h"
using namespace std;
PFP::VEC3 rotate (PFP::VEC3 pos1, PFP::VEC3 center, float angle);
float get_angle (PFP::VEC3 v1, PFP::VEC3 v2);
void register_add(Obstacle* o, int n, const std::list<Dart>& memo);
void register_add(Obstacle* o, int n, const std::vector<Dart>& memo);
class Simulator ;
......@@ -23,17 +23,18 @@ public:
bool is_inside (VEC3 p);
void computePrefVelocity();
std::list<Dart> getMemoCross(const Algo::MovingObjects::ParticleCell2D<PFP>* p1, const VEC3& dest);
std::vector<Dart> getMemoCross(const VEC3& pos, const VEC3& dest, Dart * d1);
void update();
void register_ (Obstacle* o,Dart d, int n );
void register_oneRingAdd(Obstacle * o, Dart d, int n);
void register_update(Obstacle* o, Dart d, int n);
void register_update(Obstacle* o, int n);
// void difference_list (std::list<Dart> old_, std::list<Dart> new_);
unsigned int nbVertices;
CGoGN::Algo::MovingObjects::ParticleCell2D<PFP>* * parts_;
CGoGN::Algo::MovingObjects::ParticleCell2DMemo<PFP> *registering_part;
std::vector<PFP::VEC3> vertices;
float gravity_dist;
VEC3 center;
int nb_agents_voisins;
......@@ -42,10 +43,10 @@ public:
int max_x_ind;
int min_x_ind;
Obstacle* * obstacles_;
std::list<Dart> * belonging_cells;
std::list<Dart> * neighbor_cells;
std::list<Dart> general_belonging;
std::vector<Dart> * belonging_cells;
std::vector<Dart> * neighbor_cells;
std::vector<Dart> general_belonging;
VEC3 front;
//difference entre 2 listes utilisé pour update
// std::list<Dart> * res_diff;
......
......@@ -547,7 +547,7 @@ void EnvMap::updateMap()
//same for obstacles contained
for (PFP::OBSTACLEVECT::iterator ait = oldObst.begin(); ait != oldObst.end(); ++ait)
{
resetObstInFace(*ait) ;
resetPartSubdiv(*ait);
update_registration(*ait) ;
}
......@@ -555,7 +555,7 @@ void EnvMap::updateMap()
for (PFP::OBSTACLEVECT::iterator ait = oldNeighborObst.begin();
ait != oldNeighborObst.end(); ++ait)
{
resetObstInFace(*ait) ;
update_registration(*ait) ;
}
......@@ -738,7 +738,7 @@ void EnvMap::updateMap()
// MovingObstacle* mo = (*ait)->mo ;
// if (mo != NULL)
// {
// resetPart(mo,(*ait)->index, nf) ;
// resetPart(mo,nf) ;
// }
// }
// map.setCurrentLevel(fLevel - 1) ;
......@@ -762,6 +762,9 @@ void EnvMap::updateMap()
// map.setCurrentLevel(fLevel - 1) ;
// }
// neighborAgentvect[old].clear() ;
//
// for (PFP::OBSTACLEVECT::iterator ait = obst.begin(); ait != obst.end(); ++ait)
// removeElementFromVector<Obstacle* >(neighborObst, (*ait));
// // TODO Check with optimisation
// map.setCurrentLevel(map.getMaxLevel()) ;
// for (PFP::OBSTACLEVECT::iterator ait = obst.begin(); ait != obst.end(); ++ait)
......
......@@ -80,32 +80,27 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, V
velocity_factor = 0.8f;
nbVertices = pos.size();
Dart d = sim_->envMap_.getBelongingCell(pos[0]);
registering_part = new CGoGN::Algo::MovingObjects::ParticleCell2DMemo<PFP>(sim_->envMap_.map, d, pos[0], sim_->envMap_.position);
parts_ = new CGoGN::Algo::MovingObjects::ParticleCell2D<PFP>*[nbVertices];
vertices.reserve(nbVertices);
obstacles_ = new Obstacle*[nbVertices];
belonging_cells = new std::list<Dart>[nbVertices];
neighbor_cells = new std::list<Dart>[nbVertices];
belonging_cells = new std::vector<Dart>[nbVertices];
neighbor_cells = new std::vector<Dart>[nbVertices];
for (unsigned int i = 0; i < nbVertices; ++i)
{
sum += pos[i];
// CGoGNout << "Au début : Obstacle "<< o << " position :" << pos[i] << CGoGNendl;
Dart d = sim_->envMap_.getBelongingCell(pos[i]);
CGoGN::Algo::MovingObjects::ParticleCell2D<PFP>* part =
new CGoGN::Algo::MovingObjects::ParticleCell2D<PFP>(sim_->envMap_.map, d, pos[i], sim_->envMap_.position);
parts_[i] = part;
vertices[i]=pos [i];
}
for (unsigned int i = 0; i < nbVertices; ++i)
{
Obstacle* o = new Obstacle(parts_[i]->getPosition(),
parts_[(i + 1) % nbVertices]->getPosition(),
parts_[(i - 1 + nbVertices) % nbVertices]->getPosition(),
parts_[(i + 2) % nbVertices]->getPosition(), this, i);
sum += vertices[i];
Obstacle* o = new Obstacle(vertices[i],
vertices[(i + 1) % nbVertices],
vertices[(i - 1 + nbVertices) % nbVertices],
vertices[(i + 2) % nbVertices], this, i);
obstacles_[i] = o;
register_(o, parts_[i]->d, i);
update_registration(o);
}
......@@ -119,7 +114,8 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, V
gravity_dist = pos_max + 5.0f;
obstacle_range = 15.0f * 15.0f;
make_half_turn = get_angle(finalGoal - center, (parts_[0]->getPosition() + parts_[1]->getPosition()) / 2 - center) * nbVertices;
front=(vertices[0] + vertices[1]) / 2;
make_half_turn = get_angle(finalGoal - center,front - center) * nbVertices;
goals_.push_back(center);
goals_.push_back(goal);
......@@ -130,9 +126,9 @@ bool MovingObstacle::test_opposition(VEC3 o, VEC3 p1, VEC3 p2)
{
o.normalize();
o *= -1;
VEC3 vect(p1 - p2);
vect.normalize();
return (o - vect).norm2() < 0.1;
VEC3 vector(p1 - p2);
vector.normalize();
return (o - vector).norm2() < 0.1;
}
// TODO Check position
......@@ -141,12 +137,11 @@ void MovingObstacle::updateFixedObstNeighbors()
PFP::VEC3 toto;
PFP::VEC3 toto_norm;
//for particles in the "front" of the object (to modify)
for(int k =0;k<3;k++)
for(int k =0;k<2;k++)
{
if (k==2)
k=nbVertices-1;
std::vector<Obstacle*>& obst = sim_->envMap_.obstvect[parts_[k]->d];
registering_part->get_memo(vertices[k]);
std::vector<Obstacle*>& obst = sim_->envMap_.obstvect[registering_part->d];
//search all obstacles around
for(std::vector<Obstacle*>::const_iterator it = obst.begin(); it != obst.end(); ++it)
......@@ -154,7 +149,7 @@ void MovingObstacle::updateFixedObstNeighbors()
//only for fixed obstacles around
if ((*it)->mo==NULL)
{
float distSq = distSqPointLineSegment((*it)->p1, (*it)->p2, parts_[0]->getPosition());
float distSq = distSqPointLineSegment((*it)->p1, (*it)->p2, vertices[k]);
if(distSq < detectionFixedObst*detectionFixedObst)
{
toto= (*it)->p1 -(*it)->p2;
......@@ -162,12 +157,12 @@ void MovingObstacle::updateFixedObstNeighbors()
toto_norm[0]=-toto[1];
toto_norm[1]=toto[0];
if(test_opposition(toto_norm,parts_[0]->getPosition(),center)) //// à changer ////////////
if(test_opposition(toto_norm,front,center)) //// à changer ////////////
{
int co = rand() % 2 ;
if (toto[0]==0)
{
finalGoal[0]=parts_[0]->getPosition()[0];
finalGoal[0]=front[0];
if (co == 0)
finalGoal[0]=sim_->envMap_.geometry.max()[1]-maxNeighbors_;
else
......@@ -175,14 +170,14 @@ void MovingObstacle::updateFixedObstNeighbors()
}
else
{
finalGoal[1]=parts_[0]->getPosition()[1];
finalGoal[1]=front[1];
if (co == 0)
finalGoal[0]=sim_->envMap_.geometry.max()[1]-maxNeighbors_;
else
finalGoal[0]=sim_->envMap_.geometry.min()[1]+maxNeighbors_;
}
float angle =get_angle(finalGoal-center,(parts_[0]->getPosition())-center);
float angle =get_angle(finalGoal-center,front -center);
make_half_turn=angle*nbVertices;
break;
}
......@@ -259,27 +254,26 @@ void MovingObstacle::update()
for (unsigned int i = 0; i < nbVertices; ++i)
{
// CGoGNout << "update particule : "<< i << CGoGNendl;
VEC3 target = parts_[i]->getPosition();
VEC3 target =vertices[i];
// Dart oldFace = parts_[i]->d;
if (make_half_turn == 0)
{
if (rot != 0)
{
target += rotate(parts_[i]->getPosition(), center, rot);
target += rotate(vertices[i], center, rot);
}
target += (velocity_ * sim_->timeStep_);
}
else
{
target += rotate(parts_[i]->getPosition(), center, rotor);
target += rotate(vertices[i], center, rotor);
}
parts_[i]->move(target);
vertices[i]=target;
bary += target;
}
make_half_turn -= rotor * nbVertices;
if (make_half_turn == 0)
......@@ -294,10 +288,9 @@ void MovingObstacle::update()
// o->p2 = parts_[(i + 1) % nbVertices]->getPosition();
// o->prevP = parts_[(i - 1 + nbVertices) % nbVertices]->getPosition();
// o->nextP = parts_[(i + 2) % nbVertices]->getPosition();
d = parts_[i]->d;
register_update(o, d, i);
register_update(o,i);
//
// for (std::list<Dart>::iterator it = belonging_cells[i].begin(); it != belonging_cells[i].end(); ++it)
// for (std::vector<Dart>::iterator it = belonging_cells[i].begin(); it != belonging_cells[i].end(); ++it)
// {
// general_belonging.push_back(*it);
// }
......@@ -308,7 +301,7 @@ void MovingObstacle::update()
// envMap_->addMovingObstAsNeighbor(this,general_belonging,&(general_neighbors));
// CGoGNout << "nouvel update : "<< CGoGNendl;
// for (std::list<Dart>::iterator it2 = general_belonging.begin(); it2 != general_belonging.end(); ++ it2)
// for (std::vector<Dart>::iterator it2 = general_belonging.begin(); it2 != general_belonging.end(); ++ it2)
// {
// std::vector<Agent*> vector =envMap_->agentvect[(*it2)];
// for(std::vector<Agent*>::iterator it=vector.begin();it!=vector.end(); ++it)
......@@ -327,45 +320,18 @@ void MovingObstacle::update()
}
void MovingObstacle::register_(Obstacle* o, Dart d, int n)
{
VEC3 start = o->p1;
VEC3 stop = o->p2;
CGoGN::Algo::MovingObjects::ParticleCell2DMemo<PFP> * part =
new CGoGN::Algo::MovingObjects::ParticleCell2DMemo<PFP>(sim_->envMap_.map, d, start, sim_->envMap_.position);
part->move(stop);
belonging_cells[n] = part->memo_cross;
sim_->envMap_.addObstAsNeighbor(o, belonging_cells[n], &(neighbor_cells[n]));
// CGoGNout << "coucou je suis sorti de addNeighbor" << CGoGNendl;
for (std::list<Dart>::iterator it = part->memo_cross.begin(); it != part->memo_cross.end(); ++it)
{
general_belonging.push_back(*it);
sim_->envMap_.pushObstacleInCells(o, *it);
}
for (std::list<Dart>::iterator it = this->neighbor_cells[n].begin(); it != this->neighbor_cells[n].end(); ++it)
{
sim_->envMap_.pushObstNeighborInCells(o, *it);
}
}
void register_pop(Obstacle* o, int n)
{
MovingObstacle * mo = o->mo;
if (mo != NULL)
{
for (std::list<Dart>::iterator it = mo->belonging_cells[n].begin(); it != mo->belonging_cells[n].end(); ++it)
for (std::vector<Dart>::iterator it = mo->belonging_cells[n].begin(); it != mo->belonging_cells[n].end(); ++it)
{
mo->sim_->envMap_.popObstacleInCells(o, *it);
}
for (std::list<Dart>::iterator it = mo->neighbor_cells[n].begin(); it != mo->neighbor_cells[n].end(); ++it)
for (std::vector<Dart>::iterator it = mo->neighbor_cells[n].begin(); it != mo->neighbor_cells[n].end(); ++it)
{
mo->sim_->envMap_.popObstNeighborInCells(o, *it);
}
......@@ -398,14 +364,15 @@ void MovingObstacle::register_oneRingAdd(Obstacle * o, Dart d, int n)
} while(dd != d);
}
void register_add(Obstacle* o, int n, const std::list<Dart>& memo_cross)
void register_add(Obstacle* o, int n, const std::vector<Dart>& memo_cross)
{
assert(!memo_cross.empty());
MovingObstacle * mo = o->mo;
mo->belonging_cells[n].clear();
mo->belonging_cells[n] = memo_cross;
for (std::list<Dart>::iterator it = mo->belonging_cells[n].begin(); it != mo->belonging_cells[n].end(); ++it)
for (std::vector<Dart>::iterator it = mo->belonging_cells[n].begin(); it != mo->belonging_cells[n].end(); ++it)
{
// CGoGNout <<"obstacle"<< o->p1 << "new cell : "<< *it << CGoGNendl;
mo->sim_->envMap_.pushObstacleInCells(o, *it);
......@@ -413,7 +380,7 @@ void register_add(Obstacle* o, int n, const std::list<Dart>& memo_cross)
mo->sim_->envMap_.addObstAsNeighbor(o, mo->belonging_cells[n], &(mo->neighbor_cells[n]));
for (std::list<Dart>::iterator it = mo->neighbor_cells[n].begin(); it != mo->neighbor_cells[n].end(); ++it)
for (std::vector<Dart>::iterator it = mo->neighbor_cells[n].begin(); it != mo->neighbor_cells[n].end(); ++it)
{
// CGoGNout <<"obstacle"<< o->p1 << "new cell : "<< *it << CGoGNendl;
mo->sim_->envMap_.pushObstNeighborInCells(o, *it);
......@@ -421,30 +388,30 @@ void register_add(Obstacle* o, int n, const std::list<Dart>& memo_cross)
}
}
std::list<Dart> MovingObstacle::getMemoCross(const Algo::MovingObjects::ParticleCell2D<PFP>* p1, const VEC3& dest)
std::vector<Dart> MovingObstacle::getMemoCross(const VEC3& pos, const VEC3& dest, Dart * d1)
{
Dart d = p1->d;
const VEC3& start = p1->getPosition();
CGoGN::Algo::MovingObjects::ParticleCell2DMemo<PFP> part(sim_->envMap_.map, d, start, sim_->envMap_.position);
part.move(dest);
return part.memo_cross;
registering_part->get_memo(pos);
*d1=registering_part->d;
// CGoGNout<<"d1 : "<< *d1<<"|| d2 : "<< *d2<<"|| start : "<< pos<<"|| stop : "<< dest<<CGoGNendl;
return (registering_part->get_memo(dest));
}
void MovingObstacle::register_update(Obstacle* o, Dart d, int n)
void MovingObstacle::register_update(Obstacle* o, int n)// maj de l'enregistrement
{
CGoGN::Algo::MovingObjects::ParticleCell2D<PFP>* p1 = this->parts_[n];
CGoGN::Algo::MovingObjects::ParticleCell2D<PFP>* p2 = this->parts_[(n+1)%nbVertices];
VEC3 p1 = vertices[n];
VEC3 p2 = vertices[(n+1)%nbVertices];
std::list<Dart> memo;
Dart d1=NIL;
Dart d2=NIL;
std::vector<Dart> memo;
// bool modif=false;
// if(p1->crossCell != CGoGN::Algo::MovingObjects::NO_CROSS
// || p2->crossCell != CGoGN::Algo::MovingObjects::NO_CROSS)
// {
memo = getMemoCross(p1,p2->getPosition());
memo = getMemoCross(p1,p2,&d1);
d2=registering_part->d;
// memo.sort();
// modif=true;
// }
......@@ -460,9 +427,9 @@ void MovingObstacle::register_update(Obstacle* o, Dart d, int n)
{
register_pop(o, n);
if(sim_->envMap_.map.sameFace(p1->d,p2->d))
if(sim_->envMap_.map.sameFace(d1,d2))
{
register_oneRingAdd(o , p1->d , n);
register_oneRingAdd(o , d1 , n);
}
else
{
......@@ -471,64 +438,68 @@ void MovingObstacle::register_update(Obstacle* o, Dart d, int n)
}
}
void update_registration(Obstacle * o)
void update_registration(Obstacle * o)// réenregistre l'obstacle en question
{
MovingObstacle * mo = o->mo;
if (mo != NULL)
{
int i = o->index;
int n = o->index;
VEC3 p1 = mo->vertices[n];
VEC3 p2 = mo->vertices[(n+1)%(mo->nbVertices)];
std::list<Dart> memo = mo->getMemoCross(mo->parts_[i] , mo->parts_[(i+1)%mo->nbVertices]->getPosition());
register_add(o, i, memo);
Dart d1=NIL;
Dart d2=NIL;
std::vector<Dart> memo;
memo = mo->getMemoCross(p1,p2,&d1);
d2=mo->registering_part->d;
if(mo->sim_->envMap_.map.sameFace(d1,d2))
{
mo->register_oneRingAdd(o , d1 , n);
}
else
{
register_add(o, n, memo);
}
// mo->general_belonging.clear();
// for (unsigned int j = 0; j < mo->nbVertices; j++)
// {
// for (std::list<Dart>::iterator it = mo->belonging_cells[j].begin(); it != mo->belonging_cells[j].end(); ++it)
// {
// mo->general_belonging.push_back(*it);
// }
// }
}
}
void resetObstInFace(Obstacle* o)
void resetPartSubdiv(Obstacle* o)
{
MovingObstacle * mo = o->mo;
int ind = o->index;
if (mo != NULL)
{
VEC3 pos = o->p1;
mo->parts_[ind]->ParticleBase<PFP>::move(Algo::Geometry::faceCentroid<PFP>(mo->sim_->envMap_.map, mo->parts_[ind]->d,
mo->sim_->envMap_.position));
mo->parts_[ind]->setState(FACE);
mo->parts_[ind]->move(pos);
VEC3 pos =mo->registering_part->getPosition();
mo->registering_part->ParticleBase<PFP>::move(Algo::Geometry::faceCentroid<PFP>(mo->sim_->envMap_.map, mo->registering_part->d, mo->sim_->envMap_.position)) ;
mo->registering_part->setState(FACE) ;
mo->registering_part->get_memo(pos) ;
}
}
void resetObstPartInFace(Obstacle* o, Dart d1)
{
MovingObstacle * mo = o->mo;
int ind = o->index;
if (mo != NULL) {
VEC3 pos1 = o->p1;
VEC3 pos1 = mo->registering_part->getPosition();
if (Algo::Geometry::isPointInConvexFace2D < PFP
> (mo->sim_->envMap_.map, d1, mo->sim_->envMap_.position, pos1, true)) {
mo->parts_[ind]->d = d1;
mo->registering_part->d = d1;
}
}
}
void resetPart(MovingObstacle * mo,int index, Dart d1)
void resetPart(MovingObstacle * mo, Dart d1)
{
int i = index;
if (mo->parts_[i]->d == mo->sim_->envMap_.map.phi1(d1))
mo->parts_[i]->d = d1;
if (mo->registering_part->d == mo->sim_->envMap_.map.phi1(d1))
mo->registering_part->d = d1;
}
......
......@@ -35,7 +35,7 @@ void Simulator::init(unsigned int config, int minSize, float dimension, bool ena
setupCircleScenario(100) ;
break ;
case 1 :
setupCorridorScenario(500, 25) ;
setupCorridorScenario(500, 40) ;
break ;
case 2 :
setupScenario(1000) ;
......
......@@ -218,13 +218,22 @@ void SocialAgents::cb_redraw()
for (std::vector<MovingObstacle*>::iterator it = sim.movingObstacles_.begin() ; it != sim.movingObstacles_.end() ; ++it)
{
// MovingObstacle* mo = *it ;
// VEC3 pos = (*it)->finalGoal;
// glColor3f(1.0f, 0.8f, 0.0f);
//affiche les sommets des obstacles
// for (unsigned int i =0; i< (*it)->nbVertices;i++)
// {
// VEC3 pos = (*it)->obstacles_[i]->p1;
// glColor3f(1.0f, 0.8f, 0.0f);
// glBegin(GL_POLYGON);
// for(unsigned int i = 0; i < 5; ++i)
// glVertex3f(pos[0] + (cosT[i] * 1.5f), pos[1] + (sinT[i] * 1.5f), pos[2]+0.01f);
// glEnd();
// pos = (*it)->obstacles_[i]->p2;
// glColor3f(1.0f, 0.0f, 0.8f);
// glBegin(GL_POLYGON);
// for(unsigned int i = 0; i < 5; ++i)
// glVertex3f(pos[0] + (cosT[i] * 1.5f), pos[1] + (sinT[i] * 1.5f), pos[2]+0.01f);
// glEnd();
// }
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) ;
glColor3f(1.0f, 1.0f, 1.0f) ;
glLineWidth(1.0f) ;
......@@ -232,7 +241,7 @@ void SocialAgents::cb_redraw()
for (unsigned int i = 0 ; i < ((*it)->nbVertices) ; ++i)
{
const VEC3& p = (*it)->parts_[i]->getPosition() ;