Commit 05dc0550 authored by Thomas Jund's avatar Thomas Jund

ambient occl

parent 88e09374
......@@ -8,7 +8,7 @@
#include "spatialHashing.h"
//#define SECURED
// #define SECURED
//#define EXPORTING_AGENT
#define EXPORTING_OBJ
......
This diff is collapsed.
# Blender MTL File: 'limace.blend'
# Blender MTL File: 'None'
# Material Count: 1
newmtl _untitled.001
Ns 0
......@@ -7,6 +7,6 @@ Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
map_Kd LimBuilding.png
map_Kd torusBuilding.png
This diff is collapsed.
# Blender MTL File: 'limace.blend'
# Blender MTL File: 'None'
# Material Count: 1
newmtl _untitled
Ns 0
......@@ -7,6 +7,6 @@ Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
map_Kd LimSol.png
map_Kd torusSol.png
This diff is collapsed.
This diff is collapsed.
# Blender MTL File: 'None'
# Material Count: 1
newmtl _untitled
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
map_Kd LimSimple.png
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -217,15 +217,16 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
// CityGenerator::importObj<PFP>(*this, "./meshRessources/simpleSlugSmoothTest.obj");
CityGenerator::importObj<PFP>(*this, "./meshRessources/knot3Centered.obj");
CityGenerator::importObj<PFP>(*this, "./meshRessources/knot3CenteredSubSmooth.obj");
scale(150.0f);
CityGenerator::generateCity<PFP>(*this,500, 150.0f,5.0f) ;
CityGenerator::generateCity<PFP>(*this,1000, 150.0f,5.0f) ;
break;
case 9 :
CityGenerator::importObj<PFP>(*this, "./meshRessources/simpleSlugSmoothTest.obj");
// CityGenerator::importObj<PFP>(*this, "./meshRessources/LimSol.obj");
scale(150.0f);
CityGenerator::generateCity<PFP>(*this,200, 150.0f,15.0f) ;
// CityGenerator::generateCity<PFP>(*this,200, 150.0f,15.0f) ;
break;
}
......
......@@ -98,20 +98,20 @@ void Simulator::init( float dimension, unsigned int nbAgent, unsigned int nbObst
break;
case 7 : envMap_.init(config,200.0,200.0, minSize, 400.0f);
addMovingObstacles(nbObst, 1 , 300 , 5 );
setupPlanetScenario(nbAgent,nbObst, 2 , 2);
addMovingObstacles(nbObst, 1 , 300 , 10 );
setupPlanetScenario(nbAgent,nbObst, 2 , 1);
addPathToObstacles(envMap_.buildingMark, true);
addPathsToAgents();
break;
case 8 : envMap_.init(config,200.0,200.0, minSize, 400.0f);
addMovingObstacles(nbObst, 1 , 100 , 1);
addMovingObstacles(nbObst, 1 , 300 , 5);
setupPlanetScenario(nbAgent,nbObst,1,1);
addPathToObstacles(envMap_.buildingMark, true);
addPathsToAgents();
break;
case 9 : envMap_.init(config,200.0,200.0, minSize, 400.0f);
addMovingObstacles(nbObst, 1 , 400 , 1);
setupPlanetScenario(nbAgent,nbObst);
addMovingObstacles(nbObst, 1 , 400 , 6);
setupPlanetScenario(nbAgent,nbObst, 1, 1, 300);
addPathToObstacles(envMap_.buildingMark, true);
addPathsToAgents();
break;
......@@ -969,7 +969,7 @@ void Simulator::addPathToObstacles(CellMarker<FACE>& markForbid, bool goalCenter
(*it)->goals_.clear();
Dart dStart = (*it)->parts_[0]->d;
while(markForbid.isMarked(dStart))
{
if(!markForbid.isMarked(envMap_.map.phi2(dStart)))
......@@ -979,12 +979,12 @@ void Simulator::addPathToObstacles(CellMarker<FACE>& markForbid, bool goalCenter
}
Dart dStop = dStart;
for (unsigned int j = 0 ; envMap_.buildingMark.isMarked(dStop)
|| j < dartDistForPath + rand() * 20
|| envMap_.map.sameFace(dStop, dStart)
|| markForbid.isMarked(dStop)
|| !envMap_.map.sameVolume(dStop,dStart)
// || !envMap_.map.sameVolume(dStop,dStart)
; ++j)
{
envMap_.map.next(dStop) ;
......@@ -993,6 +993,8 @@ void Simulator::addPathToObstacles(CellMarker<FACE>& markForbid, bool goalCenter
}
addPathToObstacle(*it, dStart, dStop, markForbid, goalCenterCell);
std::cout << "path computed for obstacle " << (*it)->index << std::endl;
}
}
......@@ -1103,7 +1105,7 @@ void Simulator::addPathsToAgents()
|| j < dartDistForPath + rand() * 20
|| envMap_.map.sameFace(dStop, dStart)
|| envMap_.obstacleMark.isMarked(dStop)
|| !envMap_.map.sameVolume(dStop,dStart)
// || !envMap_.map.sameVolume(dStop,dStart)
; ++j)
{
envMap_.map.next(dStop) ;
......@@ -1143,7 +1145,7 @@ void Simulator::addPathsToAgents()
|| envMap_.map.sameFace(dStop, dStop2)
|| envMap_.map.sameFace(dStop2, dStart)
|| envMap_.obstacleMark.isMarked(dStop)
|| !envMap_.map.sameVolume(dStop,dStart)
// || !envMap_.map.sameVolume(dStop,dStart)
; ++j)
{
envMap_.map.next(dStop2) ;
......
......@@ -1041,8 +1041,9 @@ void SocialAgents::animate()
// if (CityGenerator::animateCity<PFP>(&simulator.envMap_)) simulator.addPathToCorner() ;
// simulator.addPathsToAgents() ;
//
// std::cout << "t : " << simulator.globalTime_ << std::endl ;
//
std::cout << "t : " << nbIterations << std::endl ;
//
//
// timeval startTime ;
// gettimeofday(&startTime, NULL) ;
......
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