Commit 4f427d7d authored by pitiot's avatar pitiot
Browse files

plus de pos not in map

parent 69013450
......@@ -58,6 +58,7 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
minCellSize = minSize ;
maxCellSize = maxSize ;
std::cout << " - Geometry : " << geometry ;
std::cout << " - Geometry size : " << geometry.size(0)<<" x "<<geometry.size(1) ;
std::cout << " - Cell size between : " << minSize << " and " << maxSize << std::endl ;
#ifdef SPATIAL_HASHING
std::cout << " - Table de hachage : " << agentGridSize(0) << " x " << agentGridSize(1) << std::endl ;
......@@ -264,18 +265,19 @@ void EnvMap::subdivideToProperLevel()
Dart EnvMap::getBelongingCell(const PFP::VEC3& pos)
{
// assert(map.getCurrentLevel() == map.getMaxLevel()) ;
CellMarkerStore<FACE> m(map) ;
for (Dart d = map.begin(); d != map.end(); map.next(d))
{
if (!m.isMarked(d))
{
m.mark(d) ;
if (!map.isBoundaryFace(d) && !buildingMark.isMarked(d)
if (!buildingMark.isMarked(d)
&& Algo::Geometry::isPointInConvexFace2D<PFP>(map, d, position, pos, true)) return d ;
}
}
// std::cout << "ERROR : pos not in map for getBelongingCell" << std::endl ;
std::cout << "ERROR : pos not in map for getBelongingCell" << std::endl ;
return map.begin() ;
}
#endif
......
......@@ -14,7 +14,7 @@ Simulator::Simulator(int minSize) :
nb_dead(0)
{
multires=true;
detect_agent_collision=true;
detect_agent_collision=false;
srand(10) ;
nbStepsPerUnit_ = 1 / timeStep_ ;
init(1, minSize, 2.0f) ;
......@@ -35,6 +35,7 @@ if (multires)
}
else
{
envMap_.init(config, 1600.0f, 960.0f, minSize, 20.0f) ; //cases fines
}
switch (config)
......
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