Commit 60a61619 authored by pitiot's avatar pitiot
Browse files

3D focntionne pas avec building

parent 3dcf2166
......@@ -70,7 +70,7 @@ void generateCity(EnvMap& envMap, unsigned int nbBuildings)
unsigned int nbBuilding = nbBuildings ;
std::cout << " - Generate City : " << nbBuilding << " buildings" << std::endl ;
generateGrid<PFP>(envMap) ;
Dart dEnd = envMap.map.end() ;
for (Dart d = envMap.map.begin(); d != dEnd && nbBuilding > 0; envMap.map.next(d))
......@@ -78,7 +78,12 @@ void generateCity(EnvMap& envMap, unsigned int nbBuildings)
if (!envMap.buildingMark.isMarked(d) && (rand() % 12 == 0)
&& notDiagonalAdjacentToAnObstacle<PFP>(envMap.map, d, envMap.buildingMark))
{
#ifndef TWO_AND_HALF_DIM
generateBuilding<PFP>(envMap, d, (1 + (rand() % 3)) * 50.0f, rand() % 4) ;
#else
generateBuilding<PFP>(envMap, d, (1 + (rand() % 3)) * 10.0f, rand() % 3) ;
#endif
--nbBuilding ;
}
}
......@@ -374,8 +379,7 @@ Dart generateBuilding(EnvMap& envMap, Dart d, float height, unsigned int buildin
Dart next = map.phi1(dd) ;
Dart previous = map.phi_1(dd) ;
Obstacle* o = new Obstacle(position[dd], position[next], position[previous],
position[map.phi1(next)], NIL, NIL, NULL, 0);
Obstacle* o = new Obstacle(position[next], position[dd],position[map.phi1(next)] , position[previous] , NIL, NIL, NULL, 0);
#ifdef SPATIAL_HASHING
VEC3 ov = o->p2 - o->p1 ;
......
......@@ -77,6 +77,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) ;
break ;
case 1 :
......@@ -89,10 +90,12 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
// CityGenerator::generateMall<PFP>(map, position, obstacleMark, buildingMark, sideSize);
break ;
case 3 :
CityGenerator::generateGrid<PFP>(*this) ;
CityGenerator::generateCity<PFP>(*this,10) ;
break ;
case 4 :
CityGenerator::generatePlanet<PFP>(*this) ;
CityGenerator::generateCity<PFP>(*this,10) ;
break ;
case 5 :
{
......@@ -197,6 +200,7 @@ 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) ;
break;
}
......
......@@ -877,7 +877,7 @@ void MovingObstacle::updateForces()
//stretch spring : /!\ max rigidity relative to the timestep used (unstable otherwise)
float norm = v1.norm();
float rigidity = 100.0f;
float rigidity = 50.0f;
float stretch = rigidity*(edgeLength[e]-norm);
if(norm>0.0f)
......
......@@ -752,7 +752,7 @@ void Simulator::setupPlanetScenario(unsigned int nbAgents, unsigned int nbObstac
CellMarker<FACE> filled(envMap_.map);
unsigned int nbx =1;
unsigned int nby = 5;
unsigned int nby = 1;
unsigned int bMax = nbx * nby > 0 ? nbAgents / (nbx * nby) : nbAgents ;
......
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