Commit 0a8ade23 authored by pitiot's avatar pitiot

merge

parent 9138316e
......@@ -59,7 +59,7 @@
#define DRAW_REGISTRATION //montre l'enregistrement des obstacles mobiles
//#define AFFICHE_MESH
//#define EXPORTING
//#define ONERING
#define ONERING
//#define SHADOWSHELL
using namespace CGoGN ;
......
......@@ -516,11 +516,20 @@ void SocialAgents::updateVBOprimitives(int upType)
{
#ifdef ONERING
CellMarker<FACE> cmF(simulator.envMap_.map);
TraversorF<PFP::MAP> tF(simulator.envMap_.map);
for(Dart d = tF.begin() ; d != tF.end() ; d = tF.next())
for(unsigned int i = 0 ; i < simulator.movingObstacles_.size() ; ++i)
{
MovingObstacle * mo =simulator.movingObstacles_[i];
for (std::vector<std::pair<Dart, int> >::iterator it = mo->general_belonging.begin(); it != mo->general_belonging.end(); ++it)
{
if(simulator.envMap_.neighborObstvect[d].size() > 0 && !(simulator.envMap_.obstvect[d].size()>0))
cmF.mark(d);
if(!cmF.isMarked((*it).first))
{
cmF.mark((*it).first);
}
}
}
MapBrowserSelector mbs1(simulator.envMap_.map,SelectorCellMarked<FACE>(cmF));
......@@ -532,12 +541,21 @@ void SocialAgents::updateVBOprimitives(int upType)
simulator.envMap_.map.setBrowser(NULL);
CellMarker<FACE> cmF2(simulator.envMap_.map);
TraversorF<PFP::MAP> tF2(simulator.envMap_.map);
for(Dart d = tF.begin() ; d != tF.end() ; d = tF.next())
for(unsigned int i = 0 ; i < simulator.movingObstacles_.size() ; ++i)
{
if(simulator.envMap_.obstvect[d].size() > 0)
MovingObstacle * mo =simulator.movingObstacles_[i];
int n =mo->nbParticles;
for (int i = 0; i< n-1;i++)
{
cmF2.mark(d);
for (std::vector<Dart>::iterator it = mo->neighbor_cells[i].begin(); it != mo->neighbor_cells[i].end(); ++it)
{
if(!cmF.isMarked(*it)&& !cmF2.isMarked(*it))
{
cmF2.mark(*it);
}
}
}
}
......@@ -1072,12 +1090,12 @@ void SocialAgents::cb_redraw()
//--------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
qglviewer::Vec lookfrom, lookat, upvector;
qglviewer::Camera* cam = getQGLWidget()->camera();
cerr << "---------------------------------------------" << endl;
cerr << cam->position()[0] << " " << cam->position()[1] << " " << cam->position()[2] << endl;
cerr << cam->viewDirection()[0] << " " << cam->viewDirection()[1] << " " << cam->viewDirection()[2] << endl;
cerr << cam->upVector()[0] << " " << cam->upVector()[1] << " " << cam->upVector()[2] << endl;
// qglviewer::Vec lookfrom, lookat, upvector;
// qglviewer::Camera* cam = getQGLWidget()->camera();
// cerr << "---------------------------------------------" << endl;
// cerr << cam->position()[0] << " " << cam->position()[1] << " " << cam->position()[2] << endl;
// cerr << cam->viewDirection()[0] << " " << cam->viewDirection()[1] << " " << cam->viewDirection()[2] << endl;
// cerr << cam->upVector()[0] << " " << cam->upVector()[1] << " " << cam->upVector()[2] << endl;
}
void SocialAgents::drawCell(Dart d, float width, float r, float g, float b)
......
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