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 c20f9b48 authored by pitiot's avatar pitiot
Browse files

merging

parent 88f271e5
......@@ -15,7 +15,7 @@ bool notDiagonalAdjacentToAnObstacle(typename PFP::MAP& map, Dart d, CellMarker<
template <typename PFP> Algo::Surface::Modelisation::Polyhedron<PFP> generateGrid(EnvMap& envMap) ;
template <typename PFP> void generateCity(EnvMap& envMap, unsigned int nbBuildings) ;
template <typename PFP> void generateCity(EnvMap& envMap, unsigned int nbBuildings, float minArea, float maxHeight = 10.0f) ;
template <typename PFP>
Algo::Surface::Modelisation::Polyhedron<PFP> generateTrianGrid(EnvMap& envMap,
......@@ -46,6 +46,9 @@ template <typename PFP>
void generatePathToUpperStair(typename PFP::MAP& map, typename PFP::TVEC3& position, Dart dLower,
Dart dUpper) ;
template <typename PFP>
void importObj(EnvMap& envMap,std::string filename) ;
/*******************************************************************************/
//template <typename PFP>
......
......@@ -8,6 +8,17 @@ namespace CGoGN
namespace CityGenerator
{
template <typename PFP>
void importObj(EnvMap& envMap,std::string filename)
{
std::vector<std::string> attrNames ;
if(!Algo::Surface::Import::importMesh<PFP2>(envMap.map, filename.c_str(), attrNames))
{
CGoGNerr << "could not import " << filename << CGoGNendl ;
return;
}
envMap.position = envMap.map.getAttribute<VEC3, VERTEX>(attrNames[0]) ;
}
template <typename PFP>
bool notAdjacentToAnObstacle(typename PFP::MAP& map, Dart d, CellMarker<FACE>& buildingMark)
......@@ -65,7 +76,7 @@ Algo::Surface::Modelisation::Polyhedron<PFP> generateGrid(EnvMap& envMap)
}
template <typename PFP>
void generateCity(EnvMap& envMap, unsigned int nbBuildings)
void generateCity(EnvMap& envMap, unsigned int nbBuildings, float minArea, float maxHeight)
{
unsigned int nbBuilding = nbBuildings ;
std::cout << " - Generate City : " << nbBuilding << " buildings" << std::endl ;
......@@ -76,12 +87,12 @@ void generateCity(EnvMap& envMap, unsigned int nbBuildings)
for (Dart d = envMap.map.begin(); d != dEnd && nbBuilding > 0; envMap.map.next(d))
{
if (!envMap.buildingMark.isMarked(d) && (rand() % 12 == 0)
&& notDiagonalAdjacentToAnObstacle<PFP>(envMap.map, d, envMap.buildingMark))
&& notDiagonalAdjacentToAnObstacle<PFP>(envMap.map, d, envMap.buildingMark) && (Algo::Surface::Geometry::convexFaceArea<PFP>(envMap.map, d, envMap.position)>minArea))
{
#ifndef TWO_AND_HALF_DIM
generateBuilding<PFP>(envMap, d, (1 + (rand() % 3)) * 50.0f, rand() % 4) ;
generateBuilding<PFP>(envMap, d, (1 + (rand() % 3)) * maxHeight, rand() % 4) ;
#else
generateBuilding<PFP>(envMap, d, (1 + (rand() % 3)) * 40.0f, rand() % 3) ;
generateBuilding<PFP>(envMap, d, (1 + (rand() % 3)) * maxHeight, rand() % 3) ;
#endif
--nbBuilding ;
......
......@@ -32,7 +32,7 @@ class ArticulatedObstacle;
#include "pfp.h"
//#define EXPORTING3
#define EXPORTING3
#define TWO_AND_HALF_DIM
#ifdef EXPORTING3
......
......@@ -18,7 +18,7 @@
using namespace std;
#define EXPORTING2
//#define EXPORTING2
float get_angle3D(VEC3 v1, VEC3 v2);
......
......@@ -100,7 +100,7 @@ public:
void setupPlanetScenario(unsigned int nbAgents, unsigned int nbObstacles);
void addMovingObstacles(unsigned int nb, unsigned int type);
void addMovingObstacles(unsigned int nb, unsigned int type, float areaMin = 1400);
void addMovingObstacle(Dart d, unsigned int obstType=0);
void addAgent(const VEC3& start,const VEC3& goals);
......
......@@ -24,6 +24,7 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <sys/time.h>
#include "Utils/Qt/qtQGLV.h"
......@@ -169,6 +170,18 @@ public:
int m_renderStyle;
//////
// ARASH : camera input file
std::ifstream cam_input_file;
bool cif_exists;
unsigned int cif_begin, cif_end;
VEC3 *cif_lookfrom;
VEC3 *cif_lookat;
VEC3 *cif_upvector;
void readCameraInputFile(char *filename);
std::ofstream cam_output_file;
Geom::BoundingBox<PFP::VEC3> bb ;
Utils::QT::uiDockInterface dock ;
......
......@@ -745,7 +745,11 @@ static int moAppend(MovingObstacle **moving_obstacles, int nb_mos, int max, Movi
void Agent::computeNewVelocity()
{
// The objective is to compute the sum of forces exerted on the agent.
#ifdef TWO_AND_HALF_DIM
VEC3 normFace = Algo::Surface::Geometry::faceNormal<PFP>(sim_->envMap_.map, part_.d, sim_->envMap_.position);
#else
VEC3 normFace = VEC3 (0,0,1);
#endif
double collision_softening_factor;
float ag_ambient_damping = 10.0;
......@@ -813,6 +817,7 @@ void Agent::computeNewVelocity()
Obstacle * obst = it->second;
if(obst->mo!=NULL)
{
VEC3 p1=obst->p1 ;
VEC3 p2=obst->p2 ;
double longueur2 = (p1-p2).norm2();
......@@ -910,13 +915,13 @@ void Agent::computeNewVelocity()
//----- forces dues à la répulsion des autres agents -------
double ag_stiffness = 200.0; // agent-agent interaction stiffness
double ag_stiffness = 400.0; // agent-agent interaction stiffness
double ag_damping = 1.0; // agent-agent interaction damping
// double ag_power = 1; // the power to which elevate the agent-agent distance
rand = 2.0*drand48()-1.0; // compris entre -1 et 1
double radius_var = 0.5;
double ag_phys_radius_coef = 4.0*(1 + rand*radius_var); // valeurs uniformement réparties entre min et max
double ag_phys_radius_coef = 2.0*(1 + rand*radius_var); // valeurs uniformement réparties entre min et max
unsigned int nbA = 0 ;
......
......@@ -78,7 +78,7 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
case 0 :
// CityGenerator::generateGrid<PFP>(*this) ;
CityGenerator::generateGrid<PFP>(*this) ;
CityGenerator::generateCity<PFP>(*this,0) ;
CityGenerator::generateCity<PFP>(*this,0,500.0f) ;
break ;
case 1 :
CityGenerator::generateGrid<PFP>(*this) ;
......@@ -91,11 +91,11 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
break ;
case 3 :
CityGenerator::generateGrid<PFP>(*this) ;
CityGenerator::generateCity<PFP>(*this,10) ;
CityGenerator::generateCity<PFP>(*this,10,500.0f) ;
break ;
case 4 :
CityGenerator::generatePlanet<PFP>(*this) ;
CityGenerator::generateCity<PFP>(*this,10) ;
CityGenerator::generateCity<PFP>(*this,10,500.0f) ;
break ;
case 5 :
{
......@@ -200,7 +200,30 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
break;
case 6:
CityGenerator::generatePlanet<PFP>(*this);
CityGenerator::generateCity<PFP>(*this,200) ;
CityGenerator::generateCity<PFP>(*this,200, 1000.0f) ;
break;
case 7 :
// CityGenerator::importObj<PFP>(*this, "./meshRessources/simpleSlugSmoothTest.obj");
// CityGenerator::importObj<PFP>(*this, "./meshRessources/knot3Centered.obj");
CityGenerator::importObj<PFP>(*this, "./meshRessources/testTaches.obj");
scale(150.0f);
CityGenerator::generateCity<PFP>(*this,200, 150.0f, 10.0f) ;
break;
case 8 :
// CityGenerator::importObj<PFP>(*this, "./meshRessources/simpleSlugSmoothTest.obj");
CityGenerator::importObj<PFP>(*this, "./meshRessources/knot3Centered.obj");
scale(150.0f);
CityGenerator::generateCity<PFP>(*this,200, 150.0f,5.0f) ;
break;
case 9 :
CityGenerator::importObj<PFP>(*this, "./meshRessources/simpleSlugSmoothTest.obj");
scale(150.0f);
CityGenerator::generateCity<PFP>(*this,200, 150.0f,30.0f) ;
break;
}
......@@ -238,7 +261,7 @@ void EnvMap::initGL()
std::vector<std::string> filenames;
std::vector<std::string> texturenames;
std::string dir("./meshRessources/cityTex/");
std::string dir("./meshRessources/PlaneteRessource/");
DIR *dp;
struct dirent *dirp;
if((dp = opendir(dir.c_str())) == NULL)
......@@ -291,11 +314,11 @@ void EnvMap::initGL()
position_nmap.push_back(position_Export);
TraversorV<PFP2::MAP> tV(*nmap);
for(Dart d = tV.begin() ; d != tV.end() ; d = tV.next())
{
position_Export[d] *= 100.0f;
position_Export[d] += VEC3(2000,0,0);
}
// for(Dart d = tV.begin() ; d != tV.end() ; d = tV.next())
//// {
//// position_Export[d] *= 100.0f;
//// position_Export[d] += VEC3(2000,0,0);
//// }
Geom::BoundingBox<PFP::VEC3> bbTest2 = Algo::Geometry::computeBoundingBox<PFP>(*nmap, position_Export) ;
......
......@@ -230,7 +230,7 @@ std::vector<VEC3> MovingMesh::computeProjectedPointSet(float maxHeight, Dart d)
std::vector<bool> active;
active.assign(points.size(), true);
simplifyCurve(points, active, 0, points.size()-1, 0.3f);
simplifyCurve(points, active, 0, points.size()-1, 0.5f);
std::vector<VEC3> res;
VEC3 center =Algo::Surface::Geometry::faceCentroid<PFP>(motherMap, d, motherPosition);
......@@ -238,12 +238,14 @@ std::vector<VEC3> MovingMesh::computeProjectedPointSet(float maxHeight, Dart d)
VEC3 normale = Algo::Surface::Geometry::faceNormal<PFP>(motherMap, d, motherPosition);
Geom::Matrix44f rot ;
rot.identity() ;
Geom::translate(0.0f,0.0f,0.2f,rot);
float angle = Geom::angle(normale, VEC3 (0,0,1) ) ;
CGoGNout<<"angle : "<<angle<<CGoGNendl;
// CGoGNout<<"angle : "<<angle<<CGoGNendl;
VEC3 axis = VEC3(0,0,1) ^ normale ;
// Geom::translate(center[0],center[1],center[2],rot);
Geom::rotate(axis, angle, rot) ;
for(Dart dd = tv.begin() ; dd != tv.end() ; dd = tv.next())
{
......@@ -252,6 +254,16 @@ std::vector<VEC3> MovingMesh::computeProjectedPointSet(float maxHeight, Dart d)
}
translate(center);
rot.identity() ;
Geom::scale(1.5f,1.5f,1.0f,rot);
angle = Geom::angle(normale, VEC3 (0,0,1) ) ;
CGoGNout<<"angle : "<<angle<<CGoGNendl;
axis = VEC3(0,0,1) ^ normale ;
// Geom::translate(center[0],center[1],center[2],rot);
Geom::rotate(axis, angle, rot) ;
for(unsigned int i = 0; i < points.size() ; ++i)
{
points[i] =Geom::transform(points[i],rot);
......
......@@ -201,16 +201,34 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
// width = (pos[1]-pos[2]).norm();
// sum_dist_foci_rest = 2*(length + width*(sqrt(2)-0.5));
// if (spinning && parent==NULL) //départ face à la cible en cas d'obstacles pouvant effectuer des rotations
// {
if ( parent==NULL) //départ face à la cible en cas d'obstacles pouvant effectuer des rotations
{
// VEC3 axeZ=VEC3 (0,0,1);
//#ifdef TWO_AND_HALF_DIM
//
// VEC3 normale = Algo::Surface::Geometry::faceNormal<PFP>(sim->envMap_.map, parts_[nbVertices]->d, sim->envMap_.position);
//#else
// VEC3 normale =axeZ;
//#endif
// Geom::Matrix44f rot ;
// rot.identity() ;
// angle = Geom::angle(goals_[curGoal_] - center,front - center);
// Geom::rotate(axeZ,angle,rot);
//
// float angle1 = Geom::angle(normale, VEC3 (0,0,1) ) ;
// // CGoGNout<<"angle : "<<angle<<CGoGNendl;
// VEC3 axis = VEC3(0,0,1) ^ normale ;
//
// // Geom::translate(center[0],center[1],center[2],rot);
// Geom::rotate(axis, angle1, rot) ;
//
//
// angle = get_angle(goals_[curGoal_] - center,front - center);
//// std::cout<<" angle : "<< angle;
//
// for (unsigned int i = 0; i < nbVertices; ++i)
// {
//// std::cout<<" || pos[i] avant : "<< pos [i];
// pos[i]+=rotate(pos[i], center, angle);
// Geom::transform(pos[i],rot);
//// std::cout<<" || pos[i] APRES : "<< pos [i]<<std::endl;
//
// parts_[i]->move(pos[i]);
......@@ -219,7 +237,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
// }
// angle=0;
// front=(pos[0] + pos[1]) / 2;
// }
}
groundFace = map.newFace(nbVertices);
......@@ -245,7 +263,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
//extrude face to build a cage
// compute edgeLength for mass-spring
hight=10.0f;
hight=rigid_ ? -10.0f : 10.0f;
Algo::Surface::Modelisation::extrudeFace<PFP>(map, position, groundFace, hight) ;
// Dart dT = map.phi1(map.phi1(map.phi2(Dart(0))));
// std::cout << __FUNCTION__ << " val " << dT << std::endl;
......@@ -280,16 +298,18 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
edgeLength[d] = VEC3(position[map.phi1(d)]-position[d]).norm();
}
DartMarker treated(map);
for(Dart d = map.begin() ; d != map.end() ; map.next(d))
Dart centerDart =map.phi<11>(groundFace);
d = centerDart;
do
{
if(!map.isBoundaryMarked2(d) && !treated.isMarked(d))
{
treated.mark(d);
vertexAngle[d] = Algo::Surface::Geometry::angle<PFP>(map,map.phi_1(d),map.phi2(map.phi1(d)),position);
}
Dart e = map.phi1(d);
vertexAngle[e] = Algo::Surface::Geometry::angle<PFP>(map,d,map.phi2(map.phi_1(d)),position);
vertexAngle[d] = Algo::Surface::Geometry::angle<PFP>(map,map.phi_1(d),map.phi2(e),position);
vertexAngle[map.phi_1(d)]= Algo::Surface::Geometry::angle<PFP>(map,e,map.phi2(d),position);
d=map.phi<21>(d);
}
while(d!=centerDart);
map.enableQuickTraversal<VERTEX>();
dDir=dInside;
......@@ -343,13 +363,13 @@ void MovingObstacle::draw(bool showPath)
m_positionVBO->updateData(position);
// m_shader->setColor(Geom::Vec4f(movingObstacleNeighbors_.size()==0 ? 1.0f : 0,0.,0.,0.));
VEC3 col = Utils::color_map_BCGYR(float(index)/float(sim_->movingObstacles_.size()));
// VEC3 col = Utils::color_map_BCGYR(float(index)/float(sim_->movingObstacles_.size()));
// if(movingObstacleNeighbors_.size()==0)
if(index==12)
// if(obstacleNeighbors_.size()==0)
m_shader->setColor(Geom::Vec4f(col[0],col[1],col[2],0));
else
// if(index==12)
// // if(obstacleNeighbors_.size()==0)
// m_shader->setColor(Geom::Vec4f(col[0],col[1],col[2],0));
// else
m_shader->setColor(Geom::Vec4f(0.5,0.5,0.5,0));
m_render->draw(m_shader, Algo::Render::GL2::TRIANGLES);
......@@ -874,7 +894,7 @@ void MovingObstacle::updateForces()
//initialisation of forces with viscosity
forces[e] += -0.9f*velocity[e];
// forces[dd] = VEC3(0.0);
VEC3 p1Next = position[map.phi1(e)]+(velocity[map.phi1(e)] * sim_->timeStep_);
VEC3 p1Next = position[map.phi1(e)]+(velocity[map.phi1(e)] * sim_->timeStep_); // ressorts sur le bord
VEC3 p2Next = position[e]+(velocity[e] * sim_->timeStep_);
// p1Next et p2Next sont la position des extremites de l'arete.
VEC3 v1 = (p1Next-p2Next);
......@@ -883,37 +903,105 @@ void MovingObstacle::updateForces()
float norm = v1.norm();
float rigidity = 50.0f;
float stretch = rigidity*(edgeLength[e]-norm);
float stretch = 4*rigidity*(edgeLength[e]-norm);
float angularStretch = 0, angularStretch2 = 0;
float restAngle = vertexAngle[e];
if(restAngle!=0.0f)
{
float angularRig = 2*rigidity;
float curAngle = Algo::Surface::Geometry::angle<PFP>(map, d,map.phi2(map.phi_1(d)),position);
VEC3 v = Algo::Surface::Geometry::vectorOutOfDart<PFP>(map, d, position);
VEC3 v2 = Algo::Surface::Geometry::vectorOutOfDart<PFP>(map, map.phi2(map.phi_1(d)), position);
VEC3 v3 = v ^ v2;
VEC3 vPl = Algo::Surface::Geometry::faceNormal<PFP>(map, d, position);
if(v3 * vPl < 0.0f)
curAngle *= -1.0f;
angularStretch = angularRig*(restAngle-curAngle);
}
if(norm>0.0f)
{
VEC3 f = stretch*(v1/norm);
VEC3 f = (stretch+angularStretch)*(v1/norm);
//apply force symmetrically
forces[e] -= f;
forces[map.phi1(e)] += f;
}
p1Next = position[map.phi1(d)]+(velocity[map.phi1(d)] * sim_->timeStep_);
p1Next = position[e]+(velocity[e] * sim_->timeStep_); /// ressorts vers le centre de la face
p2Next = position[d]+(velocity[d] * sim_->timeStep_);
// p1Next et p2Next sont la position des extremites de l'arete.
v1 = (p1Next-p2Next);
//stretch spring : /!\ max rigidity relative to the timestep used (unstable otherwise)
norm = v1.norm();
restAngle = vertexAngle[d];
if(restAngle!=0.0f)
{
float angularRig = 2*rigidity;
float curAngle = Algo::Surface::Geometry::angle<PFP>(map, map.phi_1(d),map.phi2(map.phi1(d)),position);
VEC3 v = Algo::Surface::Geometry::vectorOutOfDart<PFP>(map, map.phi_1(d), position);
VEC3 v2 = Algo::Surface::Geometry::vectorOutOfDart<PFP>(map, map.phi2(map.phi1(d)), position);
VEC3 v3 = v ^ v2;
VEC3 vPl = Algo::Surface::Geometry::faceNormal<PFP>(map, d, position);
if(v3 * vPl < 0.0f)
curAngle *= -1.0f;
stretch = rigidity*(edgeLength[d]-norm);
angularStretch = angularRig*(restAngle-curAngle);
}
stretch = 4*rigidity*(edgeLength[d]-norm);
if(norm>0.0f)
{
VEC3 f = stretch*(v1/norm);
VEC3 f = (stretch+angularStretch)*(v1/norm);
//apply force symmetrically
forces[d] -= f;
forces[map.phi1(d)] += f;
forces[e] += f;
}
p1Next = position[d]+(velocity[d] * sim_->timeStep_); // ressorts sur le bord
p2Next = position[map.phi1(e)]+(velocity[map.phi1(e)] * sim_->timeStep_);
// p1Next et p2Next sont la position des extremites de l'arete.
v1 = (p1Next-p2Next);
norm = v1.norm();
restAngle = vertexAngle[map.phi_1(d)];
if(restAngle!=0.0f)
{
float angularRig = 2*rigidity;
float curAngle = Algo::Surface::Geometry::angle<PFP>(map, e,map.phi2(d),position);
VEC3 v = Algo::Surface::Geometry::vectorOutOfDart<PFP>(map, e, position);
VEC3 v2 = Algo::Surface::Geometry::vectorOutOfDart<PFP>(map, map.phi2(d), position);
VEC3 v3 = v ^ v2;
VEC3 vPl = Algo::Surface::Geometry::faceNormal<PFP>(map, d, position);
if(v3 * vPl < 0.0f)
curAngle *= -1.0f;
angularStretch2 = angularRig*(restAngle-curAngle);
}
if(norm>0.0f)
{
VEC3 f = (angularStretch2)*(v1/norm);
//apply force symmetrically
forces[map.phi1(e)] -= f;
forces[d] += f;
}
d=map.phi<21>(d);
}
......@@ -926,14 +1014,14 @@ void MovingObstacle::updateForces()
int obst_power = 2 ; // the power to which elevate the agent-obstacle distance
double obst_radius_infl;
if(sim_->config==0)
obst_radius_infl = 100.; // scenario 0
else
obst_radius_infl = 10.; // scenario 1 et 3
float fixed_obst_factor = 5.0f;
PFP::VEC3 normFace = CGoGN::Algo::Surface::Geometry::faceNormal<PFP>(sim_->envMap_.map, parts_[nbVertices]->d, sim_->envMap_.position);
do {
for (unsigned int i = 0; i < nbVertices; ++i)
{
PFP::VEC3 normFace = CGoGN::Algo::Surface::Geometry::faceNormal<PFP>(sim_->envMap_.map, parts_[i]->d, sim_->envMap_.position);
Dart dd = map.phi1(d);
VEC3 p = position[dd]+(velocity[dd] * sim_->timeStep_);
......@@ -958,11 +1046,11 @@ void MovingObstacle::updateForces()
VEC3 p1=obst->p2 ;
VEC3 p2=obst->p1 ;
forces[dd] += computeForce(p,p1,p2,obst_radius_infl,obst_power,1*obst_stiffness,normFace);
forces[dd] += computeForce(p,p1,p2,fixed_obst_factor*obst_radius_infl,fixed_obst_factor*obst_power,fixed_obst_factor*obst_stiffness,normFace);
}
d = map.phi<21>(d);
} while(d!=centerDart);
}
......@@ -1134,11 +1222,11 @@ void MovingObstacle::updateRegistration()
}
else
{
for (unsigned int i = 0; i < nbVertices+1; ++i)
for (unsigned int i = 0; i < nbVertices; ++i)
{
parts_[i]->move(getDilatedPosition(i));
VEC3 pos = getDilatedPosition(i);
parts_[i]->move(pos);
#ifdef TWO_AND_HALF_DIM
......@@ -1343,7 +1431,7 @@ void MovingObstacle::computePrefVelocity() //calcul du vecteur optimal pour atte
float goalDist2 = goalVector.norm2() ;
if (goalDist2 < (gravity_dist*gravity_dist) )
if (goalDist2 < (rigid_ ? 5 : 1.4)*(gravity_dist*gravity_dist) )
{
curGoal_ = (curGoal_ + 1) % goals_.size() ;
goalVector = goals_[curGoal_] - center ;
......@@ -1502,6 +1590,8 @@ PFP::REAL MovingObstacle::computeMVC(PFP::VEC3 p, Dart vertex)
}
while(it != vertex);
return (1.0f / r) * sumU;
}
......@@ -1535,6 +1625,7 @@ void MovingObstacle::attachMesh(MovingMesh* mm)
TraversorV<PFP2::MAP> t(mm_->map);
for(Dart it = t.begin(); it != t.end(); it = t.next())
computePointMVC(mm->position[it], mvc_[it]);
updateMesh();
}
void MovingObstacle::attachAgent(Agent* ag)
......
......@@ -16,7 +16,11 @@ timespec timespec_delta(const timespec& t1, const timespec& t2) {
}
Simulator::Simulator(unsigned int config, unsigned int minS, unsigned int nbAgent, unsigned int nbObst, bool resolution) :
timeStep_(0.02f),
#ifdef TWO_AND_HALF_DIM
timeStep_(0.01f),
#else
timeStep_(0.25f),
#endif
// timeStep_(0.2f),
globalTime_(0.0f),
nbSteps_(0),
......@@ -83,17 +87,37 @@ void Simulator::init( float dimension, unsigned int nbAgent, unsigned int nbObst
// addPathToObstacles(envMap_.pedWayMark, false);
addPathsToAgents();
break;
case 6:
#ifdef TWO_AND_HALF_DIM
case 6:
envMap_.init(config,200.0,200.0, minSize, 400.0f);
setupPlanetScenario(nbAgent,nbObst);
addMovingObstacles(nbObst, 1);
addPathToObstacles(envMap_.buildingMark, true);
addPathsToAgents();
break;
case 7 : envMap_.init(config,200.0,200.0, minSize, 400.0f);
setupPlanetScenario(nbAgent,nbObst);
addMovingObstacles(nbObst, 1 , 100 );
addPathToObstacles(envMap_.buildingMark, true);
addPathsToAgents();