Commit ada40ede authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

bla bli blu

parent ae1ce285
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
project(SocialAgents)
add_definitions(-DSPATIAL_HASHING)
#add_definitions(-DSPATIAL_HASHING)
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/../../CGoGN CACHE STRING "CGoGN root dir")
include(${CGoGN_ROOT_DIR}/apps_cmake.txt)
......
......@@ -27,12 +27,6 @@ template <typename PFP>
bool animateCity(EnvMap* envMap);
#endif
//template <typename PFP>
//Dart generateBuilding(typename PFP::MAP& map, typename PFP::TVEC3& position, Dart d, float height, unsigned int buildingType, CellMarker& obstacleMark, CellMarker& buildingMark);
//template <typename PFP>
//void generateCity(typename PFP::MAP& map, typename PFP::TVEC3& position, CellMarker& obstacleMark, CellMarker& buildingMark, float sideSize, unsigned int nbSquares);
template <typename PFP>
Dart generateBuilding(EnvMap* envMap, Dart d, float height, unsigned int buildingType);
......
......@@ -107,7 +107,6 @@ public :
PFP::TAB_AGENTVECT agentvect;
PFP::TAB_AGENTVECT neighborAgentvect;
PFP::TAB_OBSTACLEVECT obstvect;
#endif
......
......@@ -50,7 +50,7 @@ std::vector<Dart> pathFindAStar(typename PFP::MAP& map,const typename PFP::TVEC3
Dart toDev;
do
{
//get all vertex-adjacent cells
//get all vertex-adjacent cells
toDev = (vToDev.begin())->second;
vToDev.erase(vToDev.begin());
......
......@@ -61,7 +61,7 @@ bool agentSort(const std::pair<float, Agent*>& a1, const std::pair<float, Agent*
return a1.first < a2.first;
}
bool obstacleSort(const std::pair<float, Dart>& o1, const std::pair<float, Dart>& o2)
bool obstacleSort(const std::pair<float, Obstacle*>& o1, const std::pair<float, Obstacle*>& o2)
{
return o1.first < o2.first;
}
......
......@@ -27,12 +27,12 @@ EnvMap::EnvMap() :
#else
,
origin(70 * 24 / 2.0, 70 * 24 / 2.0, 0.0),
a_cell_size_x(Agent::neighborDist_),
a_cell_size_y(Agent::neighborDist_),
a_cell_size_x(Agent::neighborDist_ + 1),
a_cell_size_y(Agent::neighborDist_ + 1),
a_cell_nb_x(70 * 24 / a_cell_size_x),
a_cell_nb_y(70 * 24 / a_cell_size_y),
o_cell_size_x(Agent::range_),
o_cell_size_y(Agent::range_),
o_cell_size_x(Agent::range_ + 1),
o_cell_size_y(Agent::range_ + 1),
o_cell_nb_x(70 * 24 / o_cell_size_x),
o_cell_nb_y(70 * 24 / o_cell_size_y),
ht_agents(1024),
......
......@@ -7,7 +7,7 @@ Simulator::Simulator() :
{
srand(10);
nbStepsPerUnit_ = 1 / timeStep_;
init(2, 2.0f);
init(0, 2.0f);
}
Simulator::~Simulator()
......
......@@ -100,26 +100,26 @@ void SocialAgents::cb_redraw()
glVertex3f(0.0f, 0.0f, 1.0f);
glEnd();
//#ifdef SPATIAL_HASHING
// glPointSize(1.0f) ;
// glBegin(GL_POINTS) ;
// VEC3 p = sim.envMap_.origin ;
// p *= -1.0f ;
// p[1] -= 15.0f ;
// for(unsigned int i = 0; i < sim.envMap_.ht_agents.size(); ++i)
// {
// HashTable2D<std::vector<Agent*> >::cell_type& c = sim.envMap_.ht_agents.cell(i) ;
// unsigned int nbelem = c.size() ;
// for(unsigned int k = 0; k < nbelem; ++k)
// {
// VEC3 pp = p ;
// pp[0] += ( float(i) / float(sim.envMap_.ht_agents.size()) ) * 70 * 24 ;
// pp[1] += k ;
// glVertex3fv(pp.data()) ;
// }
// }
// glEnd() ;
//#endif
#ifdef SPATIAL_HASHING
glPointSize(1.0f) ;
glBegin(GL_POINTS) ;
VEC3 p = sim.envMap_.origin ;
p *= -1.0f ;
p[1] -= 15.0f ;
for(unsigned int i = 0; i < sim.envMap_.ht_agents.size(); ++i)
{
HashTable2D<std::vector<Agent*> >::cell_type& c = sim.envMap_.ht_agents.cell(i) ;
unsigned int nbelem = c.size() ;
for(unsigned int k = 0; k < nbelem; ++k)
{
VEC3 pp = p ;
pp[0] += ( float(i) / float(sim.envMap_.ht_agents.size()) ) * 70 * 24 ;
pp[1] += k ;
glVertex3fv(pp.data()) ;
}
}
glEnd() ;
#endif
if(drawAgents)
{
......
Supports Markdown
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