Commit 1bc93ad5 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

mise a jour UI

Conflicts:
	src/env_map.cpp
	src/simulator.cpp
parents 211fc6e6 f0adcdd9
......@@ -555,6 +555,7 @@ void installGuardRail(typename PFP::MAP& map,typename PFP::TVEC3& position, Cell
obstacleMark.mark(dIn);
buildingMark.mark(dIn);
buildingMark.mark(dExt);
buildingMark.mark(dIn);
railVert.mark(map.phi_1(dIn));
railVert.mark(map.phi1(dExt));
// obstacleMark.mark(map.phi_1(dIn));
......
......@@ -27,7 +27,7 @@ public:
void doStep();
void setupScenario();
void setupScenario(unsigned int nbMaxAgent);
void addPathsToAgents();
bool importAgents(std::string filename);
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>188</width>
<height>472</height>
<width>208</width>
<height>457</height>
</rect>
</property>
<property name="windowTitle">
......@@ -16,9 +16,78 @@
<widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="pushButton">
<widget class="QCheckBox" name="check_timer">
<property name="text">
<string>PushButton</string>
<string>Animate</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>2</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawEnvLines">
<property name="text">
<string>draw env lines</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawEnvFaces">
<property name="text">
<string>draw env faces</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawEnvTopo">
<property name="text">
<string>draw env topo</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawObstacles">
<property name="text">
<string>draw obstacles</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawAgents">
<property name="text">
<string>draw agents</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawAgentsPredictionTri">
<property name="text">
<string>draw agents prediction tri</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawAgentsNeighborDist">
<property name="text">
<string>draw agents neighbor dist</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="check_drawAgentsObstacleDist">
<property name="text">
<string>draw agents obstacle dist</string>
</property>
</widget>
</item>
......
......@@ -76,8 +76,25 @@ public:
int visu;
int nbGenerated;
float explode;
bool drawEnvLines ;
bool drawEnvFaces ;
bool drawEnvTopo ;
bool drawObstacles ;
bool drawAgents ;
bool drawAgentsNeighborDist ;
bool drawAgentsObstacleDist ;
bool drawAgentsPredictionTri ;
public slots:
void animate() ;
void slot_timer(bool b) { b ? timer->start() : timer->stop() ; }
void slot_drawEnvLines(bool b) { drawEnvLines = b ; updateGL() ; }
void slot_drawEnvFaces(bool b) { drawEnvFaces = b ; updateGL() ; }
void slot_drawEnvTopo(bool b) { drawEnvTopo = b ; updateGL() ; }
void slot_drawObstacles(bool b) { drawObstacles = b ; updateGL() ; }
void slot_drawAgents(bool b) { drawAgents = b ; updateGL() ; }
void slot_drawAgentsPredictionTri(bool b) { drawAgentsPredictionTri = b ; updateGL() ; }
void slot_drawAgentsNeighborDist(bool b) { drawAgentsNeighborDist = b ; updateGL() ; }
void slot_drawAgentsObstacleDist(bool b) { drawAgentsObstacleDist = b ; updateGL() ; }
} ;
......@@ -42,7 +42,7 @@ Dart EnvMap::getBelongingCell(const PFP::VEC3& pos)
void EnvMap::init()
{
float sideSize = 70.0f;
unsigned int nbSquares = 25;
unsigned int nbSquares = 20;
CityGenerator::generateCity<PFP>(map, position, obstacleMark, buildingMark, sideSize, nbSquares);
// CityGenerator::generateMall<PFP>(map, position, obstacleMark, buildingMark, sideSize);
// CityGenerator::simplifyFreeSpace<PFP>(map, position, obstacleMark, buildingMark);
......@@ -104,7 +104,6 @@ void EnvMap::registerObstaclesInFaces()
{
if(m.isMarked(d) && !buildingMark.isMarked(d)) {
m.unmark(d);
std::cout << "obstvect size " << obstvect[d].size() << std::endl;
}
}
}
......
#include "simulator.h"
Simulator::Simulator() : globalTime_(0.0f), timeStep_(0.5f)
Simulator::Simulator() : globalTime_(0.0f), timeStep_(0.1f)
{
srand(10);
envMap_.init();
std::cout << "setup scenario" << std::endl;
// importAgents("myAgents.pos");
setupScenario();
setupScenario(15000);
// addPathsToAgents();
for(unsigned int i = 0; i < agents_.size(); ++i)
{
......@@ -68,7 +68,7 @@ void Simulator::doStep()
}
}
void Simulator::setupScenario()
void Simulator::setupScenario(unsigned int nbMaxAgent)
{
/*
* Add agents, specifying their start position, and store their goals on the
......@@ -77,7 +77,12 @@ void Simulator::setupScenario()
Dart d = envMap_.map.begin();
DartMarkerStore filled(envMap_.map);
for (unsigned int i = 0; i < 2000 && d != envMap_.map.end(); ++i)
unsigned int nbx = 3;
unsigned int nby = 3;
unsigned int bMax = nbMaxAgent / (nbx*nby);
for (unsigned int i = 0; i < bMax && d != envMap_.map.end(); ++i)
{
bool found = false;
VEC3 pos;
......@@ -97,8 +102,6 @@ void Simulator::setupScenario()
if(found)
{
unsigned int nbx = 3;
unsigned int nby = 3;
float ecart = 3.0f;
VEC3 posinit = VEC3(pos[0] - (float(nbx)/2.0f * ecart), pos[1] - (float(nby)/2.0f * ecart), pos[2]);
for(unsigned int curx = 0; curx < nbx; ++curx)
......@@ -124,31 +127,33 @@ void Simulator::setupScenario()
void Simulator::addPathsToAgents()
{
unsigned int dartDistForPath=50;
//city
// unsigned int dartDistForPath=50;
unsigned int dartDistForPath=4;
for(unsigned int i = 0; i < agents_.size(); ++i)
{
agents_[i]->goals_.clear();
Dart dStart = agents_[i]->part_.d;
Dart dStop = dStart;
for(unsigned int j = 0; envMap_.buildingMark.isMarked(dStop) || j < dartDistForPath; ++j)
for(unsigned int j = 0; envMap_.buildingMark.isMarked(dStop) || j < dartDistForPath+rand()*20; ++j)
{
envMap_.map.next(dStop);
if(dStop == envMap_.map.end())
dStop = envMap_.map.begin();
envMap_.map.next(dStop);
}
std::vector<Dart> path = CGoGN::PathFinder::pathFindAStar<PFP>(envMap_.map, envMap_.position, dStart, dStop, envMap_.buildingMark);
for(std::vector<Dart>::iterator it = path.begin(); it!=path.end();++it)
for(std::vector<Dart>::iterator it = path.begin(); it != path.end(); ++it)
agents_[i]->goals_.push_back(Algo::Geometry::faceCentroid<PFP>(envMap_.map, *it, envMap_.position));
Dart dStop2 = dStop;
for(unsigned int j = 0; envMap_.buildingMark.isMarked(dStop2) || j < dartDistForPath; ++j)
for(unsigned int j = 0; envMap_.buildingMark.isMarked(dStop2) || j < dartDistForPath+rand()*20; ++j)
{
envMap_.map.next(dStop2);
if(dStop2 == envMap_.map.end())
dStop2 = envMap_.map.begin();
envMap_.map.next(dStop2);
}
path = CGoGN::PathFinder::pathFindAStar<PFP>(envMap_.map, envMap_.position, dStop, dStop2, envMap_.buildingMark);
......
......@@ -25,21 +25,24 @@
#include "viewer.h"
#include <string>
SocialAgents::SocialAgents()
SocialAgents::SocialAgents() :
drawEnvLines(true),
drawEnvFaces(false),
drawEnvTopo(false),
drawAgents(true),
drawAgentsNeighborDist(false),
drawAgentsObstacleDist(false),
drawAgentsPredictionTri(false)
{
explode = 0.9f;
render_anim = false;
nbGenerated = 0;
displayFps = false;
displayFps = true;
nextUpdate = clock() + 1 * CLOCKS_PER_SEC;
fps = 0;
glEnable( GL_POINT_SMOOTH );
visu = 0;
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(animate()));
}
......@@ -47,6 +50,19 @@ SocialAgents::SocialAgents()
void SocialAgents::initGUI()
{
setDock(&dock) ;
dock.check_drawEnvLines->setChecked(true) ;
dock.check_drawAgents->setChecked(true) ;
setCallBack( dock.check_timer, SIGNAL(toggled(bool)), SLOT(slot_timer(bool)) ) ;
setCallBack( dock.check_drawEnvLines, SIGNAL(toggled(bool)), SLOT(slot_drawEnvLines(bool)) ) ;
setCallBack( dock.check_drawEnvFaces, SIGNAL(toggled(bool)), SLOT(slot_drawEnvFaces(bool)) ) ;
setCallBack( dock.check_drawEnvTopo, SIGNAL(toggled(bool)), SLOT(slot_drawEnvTopo(bool)) ) ;
setCallBack( dock.check_drawObstacles, SIGNAL(toggled(bool)), SLOT(slot_drawObstacles(bool)) ) ;
setCallBack( dock.check_drawAgents, SIGNAL(toggled(bool)), SLOT(slot_drawAgents(bool)) ) ;
setCallBack( dock.check_drawAgentsPredictionTri, SIGNAL(toggled(bool)), SLOT(slot_drawAgentsPredictionTri(bool)) ) ;
setCallBack( dock.check_drawAgentsNeighborDist, SIGNAL(toggled(bool)), SLOT(slot_drawAgentsNeighborDist(bool)) ) ;
setCallBack( dock.check_drawAgentsObstacleDist, SIGNAL(toggled(bool)), SLOT(slot_drawAgentsObstacleDist(bool)) ) ;
}
void SocialAgents::cb_initGL()
......@@ -79,75 +95,107 @@ void SocialAgents::cb_redraw()
glVertex3f(0.,0.,1.);
glEnd();
for(std::vector<Agent*>::iterator it = sim.agents_.begin(); it != sim.agents_.end(); ++ it)
{
renderAgent(sim.envMap_,*it);
if(drawAgents)
{
for(std::vector<Agent*>::iterator it = sim.agents_.begin(); it != sim.agents_.end(); ++ it)
{
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
renderAgent(sim.envMap_, *it, drawAgentsNeighborDist, drawAgentsObstacleDist);
// for(std::vector<std::pair<float, Dart> >::iterator obst = (*it)->obstacleNeighbors_.begin();
// obst != (*it)->obstacleNeighbors_.end() && obst->first < (*it)->rangeSq_;
// ++obst)
// {
// glColor3f(0.0f, 1.0f, 1.0f);
// glLineWidth(10.0f);
// renderDart(sim.envMap_, obst->second);
// }
// for(std::vector<std::pair<float, Dart> >::iterator obst = (*it)->obstacleNeighbors_.begin();
// obst != (*it)->obstacleNeighbors_.end() && obst->first < (*it)->rangeSq_;
// ++obst)
// {
// glColor3f(0.0f, 1.0f, 1.0f);
// glLineWidth(10.0f);
// renderDart(sim.envMap_, obst->second);
// }
}
}
if(visu == 1)
if(drawAgentsPredictionTri)
{
for(std::vector<Agent*>::iterator it = sim.agents_.begin(); it != sim.agents_.end(); ++ it)
{
// draw prediction triangle
glColor3f((*it)->part_.state / 3.0f, (*it)->part_.state % 2, 0.0f);
glLineWidth(5.0f);
renderPredictionTriangle(sim.envMap_, (*it)->part_.d, (*it)->part_.m_position);
glColor3f((*it)->part_.state / 3.0f, (*it)->part_.state % 2, 0.0f);
glLineWidth(5.0f);
renderPredictionTriangle(sim.envMap_, (*it)->part_.d, (*it)->part_.m_position);
}
}
//draw the environment
if(visu == 0)
if(drawEnvLines)
{
// glEnable(GL_LIGHTING);
// glColor3f(1.0f ,1.0f ,1.0f);
// glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
// Algo::Render::GL1::renderTriQuadPoly<PFP>(sim.envMap_.map, Algo::Render::GL1::FLAT, 1.0, sim.envMap_.position, sim.envMap_.normal);
// glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glDisable(GL_LIGHTING);
glColor3f(0.0f, 0.0f, 0.0f);
glColor3f(1.0f, 1.0f, 1.0f);
glLineWidth(1.0f);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
Algo::Render::GL1::renderTriQuadPoly<PFP>(sim.envMap_.map, Algo::Render::GL1::LINE, 1.0, sim.envMap_.position, sim.envMap_.normal);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
}
else if(visu == 1)
if(drawEnvFaces)
{
glDisable(GL_LIGHTING);
glEnable(GL_LIGHTING);
glColor3f(1.0f, 1.0f, 1.0f);
glLineWidth(1.0f);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glEnable(GL_POLYGON_OFFSET_FILL) ;
glPolygonOffset(1.0f, 1.0f) ;
Algo::Render::GL1::renderTriQuadPoly<PFP>(sim.envMap_.map, Algo::Render::GL1::LINE, 1.0, sim.envMap_.position, sim.envMap_.normal);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
}
else if(visu == 2)
if(drawEnvTopo)
{
glDisable(GL_LIGHTING);
glLineWidth(1.0f);
Algo::Render::GL1::renderTopoMD2<PFP>(sim.envMap_.map, sim.envMap_.position, true, true, 0.9f, 0.9f);
}
else if(visu == 3)
{}
glColor3f(1.0f, 0.0f, 0.0f);
glLineWidth(5.0f);
CellMarker dmo(sim.envMap_.map, EDGE_CELL);
for(Dart d = sim.envMap_.map.begin(); d != sim.envMap_.map.end(); sim.envMap_.map.next(d))
if(drawObstacles)
{
if(!dmo.isMarked(d))
glColor3f(1.0f, 0.0f, 0.0f);
glLineWidth(5.0f);
CellMarker dmo(sim.envMap_.map, EDGE_CELL);
for(Dart d = sim.envMap_.map.begin(); d != sim.envMap_.map.end(); sim.envMap_.map.next(d))
{
dmo.mark(d);
if(sim.envMap_.obstacleMark.isMarked(d))
renderDart(sim.envMap_, d);
if(!dmo.isMarked(d))
{
dmo.mark(d);
if(sim.envMap_.obstacleMark.isMarked(d))
renderDart(sim.envMap_, d);
}
}
}
// glPushMatrix();
// glBegin(GL_LINES);
// unsigned int iter = 100;
// for(int i=0;i<700;i=i+iter)
// {
// VEC3 camPos(-800,-800,10);
// camPos = camPos + VEC3(-10-0.3*i,400.0f*log(1.0f+i/700.0f),30+0.3*i);
// glVertex3fv(&camPos[0]);
// camPos = VEC3(-800,-800,10);
// camPos = camPos + VEC3(-10-0.3*(i+iter),400.0f*log(1.0f+(i+iter)/700.0f),30+0.3*(i+iter));
// glVertex3fv(&camPos[0]);
// }
// glEnd();
// glPopMatrix();
//
// glPushMatrix();
// glBegin(GL_LINES);
// for(int i=0;i<700;i=i+iter)
// {
// VEC3 camLook(0,0,0);
// camLook = camLook + VEC3(-10-0.1*i,400.0f*log(1.0f+i/700.0f),30+0.1*i);
// glVertex3fv(&camLook[0]);
// camLook = VEC3(0,0,0);
// camLook = camLook + VEC3(-10-0.1*(i+iter),400.0f*log(1.0f+(i+iter)/700.0f),30+0.1*(i+iter));
// glVertex3fv(&camLook[0]);
// }
// glEnd();
// glPopMatrix();
// glColor3f(0.0f, 1.0f, 0.0f);
// glLineWidth(5.0f);
// CellMarker dmb(sim.envMap_.map, FACE_CELL);
......@@ -205,20 +253,32 @@ void SocialAgents::animate()
sim.doStep();
if(sim.globalTime_<300+sim.timeStep_ && sim.globalTime_>=300) {
CGoGNout << " breakpoint for exporting pov" << CGoGNendl;
timer->stop();
}
if(render_anim)
{
std::ostringstream oss;
std::ostringstream tmpNb;
tmpNb << std::setfill('0') << std::setw(4) << nbGenerated;
nbGenerated++;
oss << "./planSerre/exportSceneOle" << tmpNb.str() << ".pov";
oss << "./planMall/mallScene" << tmpNb.str() << ".pov";
std::string chaine = oss.str();
VEC3 agPos = sim.agents_[0]->meanPos_;
agPos[2] = agPos[1];
agPos[1] = 0.0f;
VEC3 camPos(agPos);
camPos = camPos+VEC3(-10-0.05*nbGenerated,10+0.05*nbGenerated,log(1.0f+nbGenerated/700.0f));
VEC3 camLook(agPos);
// VEC3 agPos = sim.agents_[0]->meanPos_;
// agPos[2] = agPos[1];
// agPos[1] = 0.0f;
// VEC3 camPos(agPos);
// VEC3 camLook(agPos);
// camPos = camPos+VEC3(-10-0.05*nbGenerated,30+0.05*nbGenerated,log(1.0f+nbGenerated/700.0f));
VEC3 camPos(-800,10,-800);
camPos = camPos + VEC3(-10-0.3*nbGenerated,30+0.3*nbGenerated,400.0f*log(1.0f+nbGenerated/700.0f));
VEC3 camLook(0,0,0);
camLook = camLook + VEC3(-10-0.1*nbGenerated,30+0.1*nbGenerated,400.0f*log(1.0f+nbGenerated/700.0f));
exportScenePov(sim.envMap_.map,sim.envMap_.position,chaine,camPos,camLook,VEC3(0.0f,0,0),0,0,0);
// exportScenePov(sim.envMap_.map,sim.envMap_.position,chaine,VEC3(43,762,65),VEC3(0,762,0),VEC3(1.0f,0,0),0,0,0);
......@@ -236,7 +296,7 @@ void SocialAgents::animate()
bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std::string& filename, PFP::VEC3 cameraPos, PFP::VEC3 cameraLook, PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good)
{
static const bool draft=true;
static const bool draft=false;
static const bool highlightAgent=false;
static const bool wireDisplay=false;
......@@ -268,9 +328,14 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
}
//define the camera position
out << "#include \"sombrero2_highres_POV_geom.inc\"" << std::endl;
out << "#include \"sombrero2_lowres_POV_geom.inc\"" << std::endl;
out << "#include \"sombrero3_highres_POV_geom.inc\"" << std::endl;
if(draft)
out << "#include \"sombrero2_lowres_POV_geom.inc\"" << std::endl;
else {
out << "#include \"Sheriff_animated_POV_geom.inc\"" << std::endl;
out << "#include \"Cowbow_animated_POV_geom.inc\"" << std::endl;
out << "#include \"sombrero2_highres_POV_geom.inc\"" << std::endl;
out << "#include \"sombrero3_highres_POV_geom.inc\"" << std::endl;
}
out << "#include \"transforms.inc\"" << std::endl;
......@@ -318,21 +383,29 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
int typeOfAgent=0;
if(draft) {
typeOfAgent=2;
out << "object {" << " sheriff_lowres_ " << std::endl;
out << "object {" << " sombrero2_lowres_ " << std::endl;
out << "scale 0.0638297872" << std::endl;
}
else {
if(i==highlightAgentNo) {
if(i==0) {
typeOfAgent=3;
out << "object {" << " Sheriff_animated_ " << std::endl;
out << "scale 0.165745856" << std::endl;
}
else if(i%7==0) {
typeOfAgent=2;
out << "object {" << " sombrero2_highres_ " << std::endl;
out << "object {" << " Cowbow_animated_ " << std::endl;
out << "scale 0.170454545" << std::endl;
}
if(i%3!=0) {
else if(i%7<5) {
typeOfAgent=1;
out << "object {" << " sombrero2_highres_ " << std::endl;
out << "object {" << " sombrero2_lowres_ " << std::endl;
out << "scale 0.127659574" << std::endl;
}
else {
typeOfAgent=0;
out << "object {" << " sombrero3_highres_ " << std::endl;
out << "scale 0.132743363" << std::endl;
}
}
......@@ -349,12 +422,12 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
//57,2957795 : conversion from radian to degree
float myRot = acos(-dir[1])*57.2957795f;
out << "scale 0.0638297872" << std::endl;
out << "rotate <0,0," << sign*myRot << ">"<< std::endl;
// out << "translate <" << posR[0] << "," << posR[1] << "," << posR[2]+1+typeOfAgent*4*0.0638297872 << "> " << std::endl;
out << "translate <" << posR[0] << "," << posR[1] << "," << posR[2] << "> " << std::endl;
out << "rotate <0,0," << sign*myRot << ">"<< std::endl;
out << "rotate <" << angleX-90 << "," << angleY << "," << angleZ << "> " << std::endl;
// out << "translate <" << posR[0] << "," << posR[1] << "," << posR[2]+1+typeOfAgent*4*0.0638297872 << "> " << std::endl;
out << "translate <" << posR[0] << "," << posR[2] << "," << posR[1] << "> " << std::endl;
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl;
out << "}" << std::endl;
......@@ -391,15 +464,15 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
if(wireDisplay) {
Algo::ExportPov::exportMeshWire<PFP>(out,map,position,"myMeshWire",good);
out << "object {myMeshWire" << std::endl;
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl;
out << "rotate <" << angleX << "," << angleY << "," << angleZ << "> " << std::endl;
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl;
out << "texture{ pigment{ color rgb<0,0,0>} } }" << std::endl;
}
out << "object {myMesh" << std::endl;
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl;
out << "rotate <" << angleX << "," << angleY << "," << angleZ << "> " << std::endl;
out << "texture{ pigment{ color rgb 0.8} finish { ambient rgb 0.3 brilliance 0.5 } } }" << std::endl;
out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl;
out << "texture{ pigment{ color rgb 0.7} finish { ambient rgb 0.3 brilliance 0.5 } } }" << std::endl;
}
// out << "texture{ pigment{ color rgb<1.0,1.0,1>} finish { ambient rgb 0.05 brilliance 0.5 } } }" << std::endl;
......@@ -413,14 +486,6 @@ void SocialAgents::cb_keyPress(int keycode)
{
switch (keycode)
{
case 'a': {
sim.envMap_.map.check();
if(!timer->isActive())
timer->start();
else
timer->stop();
break;
}
case 'c': {
sim.envMap_.map.check();
break;
......@@ -437,6 +502,10 @@ void SocialAgents::cb_keyPress(int keycode)
displayFps = !displayFps;
break;
}
case 'p': {
std::cout << sim.globalTime_ << std::endl;
break;
}
case 'r' : {
exportScenePov(sim.envMap_.map,sim.envMap_.position,"planSerre/exportSceneOle0000.pov",VEC3(10,3,10),VEC3(0,0,0),VEC3(1.0f,0,0),0,0,0);
// exportScenePov(sim.envMap_.map,sim.envMap_.position,"exportScene0002.pov",VEC3(43,762,1565),VEC3(0,762,0),VEC3(1.0f,0,0),0,0,0);
......@@ -447,15 +516,6 @@ void SocialAgents::cb_keyPress(int keycode)
animate();
break;
}
case 'v': {
++visu;
visu = visu % 4;
break;
}
case 'x': {
explode *= 0.9f;
break;
}