Commit 6e030631 authored by pitiot's avatar pitiot

pop

parent 31b1668a
0 2892
0 13.2112 -343.6 594.385 10.9265 -307.115 501.306 0.0322209 0.930812 0.364074
1637 13.2112 -343.6 594.385 10.9265 -307.115 501.306 0.0322209 0.930812 0.364074
2263 -225.649 -65.4916 186.836 -153.811 -25.9154 129.625 0.511978 0.255997 0.819966
2892 154.528 244.386 80.6884 119.103 153.875 57.1753 0.0753229 -0.278238 0.957554
925 268.919 -599.764 174.022 229.193 -513.318 143.218 -0.154631 0.267809 0.950982
1420 114.119 -361.09 564.72 97.6865 -312.66 478.787 -0.25495 0.820722 0.511289
3115 -119.914 -198.458 186.027 -85.6747 -137.812 114.265 0.346014 0.628714 0.696415
4784 -179.491 -194.446 135.444 -125.036 -132.211 79.2166 0.368223 0.424929 0.826951
7798 -179.204 -102.848 442.481 -148.784 -85.0303 348.901 0.727103 0.591244 0.34893
12828 -125.14 -65.2268 467.511 -106.094 -55.2945 369.845 0.762254 0.611961 0.210886
......@@ -34,7 +34,7 @@ class ArticulatedObstacle;
//#define EXPORTING3
#define TWO_AND_HALF_DIM
//#define TWO_AND_HALF_DIM
#ifdef EXPORTING3
......
......@@ -763,7 +763,7 @@ void Agent::computeNewVelocity()
VEC3 normFace = VEC3 (0,0,1);
#endif
double collision_softening_factor;
float ag_ambient_damping = 10.0;
float ag_ambient_damping = 1000.0;
// double mass_var = 0.95;
// double average_mass = 1.0;
......
......@@ -168,6 +168,14 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
speed_detection_factor(100)
{
double stiff_agent=500;
double radius_agent=30;
double stiff_obst=0.01;
double radius_obst=12;
double long_radius_agent=40;
double long_radius_obst=10;
for (unsigned int i = 0; i < nbVertices; ++i)
{
......@@ -386,7 +394,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
{
Obstacle* o = new Obstacle(parts_[i]->getPosition(),
parts_[(i + 1) % nbVertices]->getPosition(),
this, i,1000,0.01,100,12);
this, i,stiff_agent,stiff_obst,radius_agent,radius_obst);
obstacles_.push_back(o);
/////definition du troisieme point
if (rigid_) o->p3=parts_[(i + 2) % nbVertices]->getPosition();
......@@ -400,7 +408,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
{
Obstacle* o = new Obstacle(parts_[nbVertices]->getPosition(),
parts_[nbVertices+1]->getPosition(),
this, nbVertices,1000,100,500,20);
this, nbVertices,stiff_agent,stiff_obst,long_radius_agent,long_radius_obst);
obstacles_.push_back(o);
......@@ -511,6 +519,7 @@ void MovingObstacle::draw(bool showPath)
{
m_ds->newList(GL_COMPILE_AND_EXECUTE);
m_ds->begin(GL_LINE_STRIP);
VEC3 col = Utils::color_map_BCGYR(float(index)/float(sim_->movingObstacles_.size()));
......@@ -526,7 +535,8 @@ void MovingObstacle::draw(bool showPath)
m_ds->end();
m_ds->endList();
}
}
}
VEC3 MovingObstacle::getDilatedPosition(unsigned int ind)
......@@ -1619,6 +1629,11 @@ void MovingObstacle::computePrefVelocity() //calcul du vecteur optimal pour atte
if (goalDist2 < (rigid_ ? 5 : 1.4)*(gravity_dist*gravity_dist) )
{
curGoal_ = (curGoal_ + 1) % goals_.size() ;
velocity_factor/=1.3 ;
goalVector = goals_[curGoal_] - center ;
// goalVector = goals_[curGoal_] - position[groundFace] ;
goalDist2 = goalVector.norm2() ;
......
......@@ -497,6 +497,7 @@ void Simulator::setupCrowdedScenario(unsigned int nbAgents , unsigned int nbObst
start = center;
float mapSize=(envMap_.geometry.max()[1]-envMap_.geometry.min()[1]);
start[1]-= mapSize/4;
start[0]-=10.0f;
std::vector<VEC3> goals;
VEC3 goal ;
......@@ -513,11 +514,11 @@ if(snake==1)
positions[0]=vPos;
goal=center;
goals.push_back(goal);
goal=center+VEC3(mapSize/4,mapSize/4,0);
goal=center+VEC3(mapSize/6,mapSize/6,0);
goals.push_back(goal);
goal=center;
goals.push_back(goal);
goal=center+VEC3(-mapSize/4,mapSize/4,0);
goal=center+VEC3(-mapSize/6,mapSize/6,0);
goals.push_back(goal);
goal=center;
goals.push_back(goal);
......
......@@ -2170,21 +2170,21 @@ int main(int argc, char** argv)
glewInit();
// sa.cam_output_file.open("cams/cam.out",std::ofstream::out);
// char camfile[100];
// sprintf(camfile,"cams/cam.scn%d.spline",config);
//
// sa.readCameraInputFile("cams/toto");
// if(sa.cif_exists)
// {
// unsigned int i;
//
// for(i=0;i<sa.cif_begin;i++)
// {
// sa.nbIterations = sa.cif_begin;
sa.cam_output_file.open("cams/cam.out",std::ofstream::out);
char camfile[100];
sprintf(camfile,"cams/cam.scn%d.spline",config);
sa.readCameraInputFile(camfile);
if(sa.cif_exists)
{
unsigned int i;
for(i=0;i<sa.cif_begin;i++)
{
sa.nbIterations = sa.cif_begin;
sa.simulator.doStep();
// }
// }
}
}
sa.show() ;
// if (argc > 1)
......
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