Commit 435ef2ea authored by pitiot's avatar pitiot

version a jour avec pb Dart==NIL

parent 14a82956
......@@ -9,13 +9,25 @@ ELSE (WIN32)
ENDIF (WIN32)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
../include
${CGoGN_ROOT_DIR}/include
${COMMON_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
file(
GLOB
shaders_srcD
../include/*.frag
../include/*.vert
../include/*.geom
)
add_custom_target(shader_targetD ${CGoGN_ROOT_DIR}/ThirdParty/bin/shader_to_h ${shaders_srcD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_srcD} )
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -p")
QT4_WRAP_UI( socialAgents_ui ../include/socialAgents.ui )
......@@ -30,8 +42,11 @@ add_executable( socialAgentsD
../src/moving_mesh.cpp
../src/gl2ps.c
../src/ShapeMatching/rigidXfComputation.cpp
../src/shaderCustom.cpp
${socialAgents_moc}
${socialAgents_ui}
)
add_dependencies(socialAgentsD shader_targetD )
target_link_libraries( socialAgentsD ${CGoGN_LIBS_D} ${COMMON_LIBS} )
......@@ -9,13 +9,25 @@ ELSE (WIN32)
ENDIF (WIN32)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
../include
${CGoGN_ROOT_DIR}/include
${COMMON_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
file(
GLOB
shaders_src
../include/*.frag
../include/*.vert
../include/*.geom
)
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/shader_to_h ${shaders_src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src} )
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
QT4_WRAP_UI( socialAgents_ui ../include/socialAgents.ui )
......@@ -30,8 +42,11 @@ add_executable( socialAgents
../src/moving_mesh.cpp
../src/gl2ps.c
../src/ShapeMatching/rigidXfComputation.cpp
../src/shaderCustom.cpp
${socialAgents_moc}
${socialAgents_ui}
)
add_dependencies(socialAgents shader_target )
target_link_libraries( socialAgents ${CGoGN_LIBS_R} ${COMMON_LIBS} )
......@@ -54,9 +54,9 @@ public:
VEC3 pos ;
#else
#ifdef SECURED
CGoGN::Algo::MovingObjects::ParticleCell2DSecured<PFP> part_ ;
CGoGN::Algo::Surface::MovingObjects::ParticleCell2DSecured<PFP> part_ ;
#else
CGoGN::Algo::MovingObjects::ParticleCell2D<PFP> part_ ;
CGoGN::Algo::Surface::MovingObjects::ParticleCell2D<PFP> part_ ;
#endif
#endif
......@@ -85,6 +85,8 @@ public:
static unsigned int cptAgent ;
VEC3 forces;
float color1;
float color2;
float color3;
......
......@@ -13,15 +13,13 @@ namespace CityGenerator
template <typename PFP>
bool notDiagonalAdjacentToAnObstacle(typename PFP::MAP& map, Dart d, CellMarker<FACE>& buildingMark) ;
template <typename PFP> Algo::Modelisation::Polyhedron<PFP> generateGrid(EnvMap& envMap) ;
template <typename PFP> Algo::Surface::Modelisation::Polyhedron<PFP> generateGrid(EnvMap& envMap) ;
template <typename PFP> void generateCity(EnvMap& envMap, unsigned int nbBuildings) ;
template <typename PFP>
Algo::Modelisation::Polyhedron<PFP> generateTrianGrid(typename PFP::MAP& map,
typename PFP::TVEC3& position,
unsigned int cX, unsigned int cY,
float sideLength, CellMarker<EDGE>& obstacleMark,
Algo::Surface::Modelisation::Polyhedron<PFP> generateTrianGrid(EnvMap& envMap,
CellMarker<EDGE>& obstacleMark,
CellMarker<FACE>& buildingMark) ;
template <typename PFP>
......
This diff is collapsed.
......@@ -188,7 +188,6 @@ void displayMO(Obstacle * o);
* INLINE FUNCTIONS *
**************************************/
template <typename T>
inline void addElementToVector(std::vector<T>& a, T ag)
{
......@@ -267,7 +266,6 @@ inline void EnvMap::pushAgentInCells(Agent* agent, Dart d)
} while (dd != d) ;
}
inline void EnvMap::popAgentInCells(Agent* agent, Dart d)
{
assert(map.getCurrentLevel() == map.getMaxLevel()) ;
......@@ -331,13 +329,9 @@ inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::vector<Dart>& b
beg = *it;
first = NIL;
d=beg;
// CGoGNout<<"beg : " << beg;
do
{
do {
dd=map.alpha1(map.alpha1(d));
// CGoGNout<<"dd : " << dd;
do
{
do {
if (!memo_mark.isMarked(dd))
{
first = dd;
......@@ -348,11 +342,9 @@ inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::vector<Dart>& b
d=map.phi1(d);
} while(first==NIL && d!=beg);
// CGoGNout<<CGoGNendl;
++it;
}while(first==NIL && it!=belonging_cells.end());
// assert(!buildingMark.isMarked(d)) ;
assert(first!=NIL) ;
// CGoGNout<<"first : "<<first<<CGoGNendl;
d=first;
......@@ -365,7 +357,6 @@ inline void EnvMap::addObstAsNeighbor (Obstacle * o, const std::vector<Dart>& b
}
find_next(o,&d, memo_mark);
// CGoGNout<<"d : "<<d<<CGoGNendl;
}while(!map.sameFace(d,first));
}
......
......@@ -5,59 +5,68 @@
#include "agent.h"
#include "Utils/colorMaps.h"
#include "Algo/Render/GL1/map_glRender.h"
inline void renderDart(EnvMap& m, Dart d)
{
PFP::VEC3 p1 = m.position[d] ;
PFP::VEC3 p2 = m.position[m.map.phi1(d)] ;
// PFP::VEC3 p1 = m.position[d] ;
// PFP::VEC3 p2 = m.position[m.map.phi1(d)] ;
std::cout << __FILE__ << " " << __LINE__ << " to update" << std::endl;
glBegin(GL_LINES) ;
glVertex3f(p1[0], p1[1], p1[2]) ;
glVertex3f(p2[0], p2[1], p2[2]) ;
glEnd() ;
// glBegin(GL_LINES) ;
// glVertex3f(p1[0], p1[1], p1[2]) ;
// glVertex3f(p2[0], p2[1], p2[2]) ;
// glEnd() ;
}
inline void renderFace(EnvMap& m, Dart d)
{
Dart dd = d ;
do
{
renderDart(m, dd) ;
dd = m.map.phi1(dd) ;
} while (dd != d) ;
std::cout << __FILE__ << " " << __LINE__ << " to update" << std::endl;
// Dart dd = d ;
// do
// {
// renderDart(m, dd) ;
// dd = m.map.phi1(dd) ;
// } while (dd != d) ;
}
inline void renderPredictionTriangle(EnvMap& m, Dart d, PFP::VEC3 p)
{
Geom::Plane3D<float> pl = Algo::Geometry::facePlane<PFP>(m.map, d, m.position) ;
Geom::Plane3D<float> pl = Algo::Surface::Geometry::facePlane<PFP>(m.map, d, m.position) ;
p[2] -= 1000 ;
Geom::intersectionPlaneRay(pl, p, VEC3(0, 0, -1), p) ;
VEC3 pos1(m.position[d]) ;
VEC3 pos2(m.position[m.map.phi1(d)]) ;
pos2[2] += 2 ;
glBegin(GL_LINE_LOOP) ;
glVertex3fv(&p[0]) ;
glVertex3fv(&pos1[0]) ;
glVertex3fv(&pos2[0]) ;
glEnd() ;
// glBegin(GL_LINE_LOOP) ;
// glVertex3fv(&p[0]) ;
// glVertex3fv(&pos1[0]) ;
// glVertex3fv(&pos2[0]) ;
// glEnd() ;
std::cout << __FILE__ << " " << __LINE__ << " to update" << std::endl;
}
inline void renderObstacle(EnvMap& m, MovingObstacle * obst, bool showBelonging=false, bool renderPath = false, bool showVertices=false)
{
glBegin(GL_POLYGON) ;
for (unsigned int i = 0 ; i < (obst->nbVertices) ; ++i)
{
const VEC3& p = obst->getPosition(i) ;
glVertex3fv(p.data()) ;
}
glEnd() ;
std::cout << __FILE__ << " " << __LINE__ << " to update" << std::endl;
// glPolygonMode(GL_FRONT_AND_BACK, GL_LINE) ;
// glColor3f(1.0,1.0,1.0);
// glBegin(GL_POLYGON) ;
// for (unsigned int i = 0 ; i < (obst->nbVertices) ; ++i)
// {
// const VEC3& p = obst->getPosition(i) ;
// glVertex3fv(p.data()) ;
// }
// glEnd() ;
// glColor3f(0,1,0);
// Algo::Render::GL1::renderTriQuadPoly<PFP>(obst->map, Algo::Render::GL1::LINE,
// 1.0, obst->position,
......@@ -65,36 +74,26 @@ inline void renderObstacle(EnvMap& m, MovingObstacle * obst, bool showBelonging=
if(showVertices)
{
glPointSize(3.0f) ;
glColor3f(0.0,0.0,1.0);
glBegin(GL_POINTS) ;
for (unsigned int i = 0 ; i < (obst->nbVertices) ; ++i)
{
const VEC3& p = obst->getPosition(i) ;
if (obst->obstacles_[i]==(Obstacle*)0xf09f80 || obst->obstacles_[(i-1)%(obst->nbVertices)]==(Obstacle *)0xf09f80 )
{
glPointSize(10.0f) ;
glColor3f(1.0,0.0,0.0);
}
else
{
glPointSize(3.0f) ;
glColor3f(0.0,0.0,1.0);
}
glVertex3fv(p.data()) ;
}
glEnd() ;
glPointSize(1.0f) ;
// glPointSize(3.0f) ;
// glColor3f(0.0,0.0,1.0);
// glBegin(GL_POINTS) ;
// for (unsigned int i = 0 ; i < (obst->nbVertices) ; ++i)
// {
// const VEC3& p = obst->getPosition(i) ;
// glVertex3fv(p.data()) ;
// }
// glEnd() ;
// glPointSize(1.0f) ;
}
glColor3f(1.0,0.0,1.0);
glBegin(GL_LINE_LOOP) ;
for (unsigned int i = 0 ; i < (obst->nbVertices) ; ++i)
{
const VEC3& p = obst->getDilatedPosition(i) ;
glVertex3fv(p.data()) ;
}
glEnd() ;
// glColor3f(1.0,0.0,1.0);
// glBegin(GL_LINE_LOOP) ;
// for (unsigned int i = 0 ; i < (obst->nbVertices) ; ++i)
// {
// const VEC3& p = obst->getDilatedPosition(i) ;
// glVertex3fv(p.data()) ;
// }
// glEnd() ;
// glColor3f(0.0,1.0,1.0);
// glBegin(GL_LINES) ;
......@@ -118,24 +117,24 @@ inline void renderObstacle(EnvMap& m, MovingObstacle * obst, bool showBelonging=
if (renderPath)
{
glLineWidth(3.0f) ;
glBegin(GL_LINE_STRIP) ;
for (std::vector<VEC3>::iterator it = ++(obst->goals_.begin()) ; it != obst->goals_.end() ;
++it)
{
// glVertex3f((*it)[0], (*it)[1], (*it)[2]) ;
glVertex3f((*it)[0], (*it)[1], obst->index) ;
}
glEnd() ;
glLineWidth(1.0f) ;
glBegin(GL_LINES) ;
VEC3 p = obst->getPosition(0) ;
glVertex3fv(p.data()) ;
p = obst->goals_[obst->curGoal_];
glVertex3fv(p.data()) ;
glEnd() ;
// glLineWidth(3.0f) ;
// glBegin(GL_LINE_STRIP) ;
// for (std::vector<VEC3>::iterator it = ++(obst->goals_.begin()) ; it != obst->goals_.end() ;
// ++it)
// {
//// glVertex3f((*it)[0], (*it)[1], (*it)[2]) ;
// glVertex3f((*it)[0], (*it)[1], obst->index) ;
//
// }
// glEnd() ;
// glLineWidth(1.0f) ;
//
// glBegin(GL_LINES) ;
// VEC3 p = obst->getPosition(0) ;
// glVertex3fv(p.data()) ;
// p = obst->goals_[obst->curGoal_];
// glVertex3fv(p.data()) ;
// glEnd() ;
}
}
......@@ -145,34 +144,62 @@ static const float sinT[5] = { 0, 0.951057, 0.587785, -0.587785, -0.951057 } ;
inline void renderAgent(EnvMap& m, Agent* agent, bool showNeighborDist = false,
bool showObstacleDist = false, bool renderPath = false, float c1=1.0f,float c2=0, float c3=0 )
{
#ifdef SPATIAL_HASHING
const VEC3& pos = agent->pos ;
#else
VEC3 pos = agent->part_.getPosition() ;
#endif
float radius = agent->radius_ ;
std::cout << __FILE__ << " " << __LINE__ << " to update" << std::endl;
//#ifdef SPATIAL_HASHING
// const VEC3& pos = agent->pos ;
//#else
// VEC3 pos = agent->part_.getPosition() ;
//#endif
// float radius = agent->radius_ ;
// Geom::Plane3D<float> pl = Algo::Geometry::facePlane<PFP>(m.map,agent->part_.d,m.position);
// pos[2] -= 1000;
// Geom::intersectionPlaneRay(pl,pos,VEC3(0,0,-1),pos);
glLineWidth(1.0f) ;
// VEC3 col = Utils::color_map_BCGYR(float(agent->agentNo)/float(agent->sim_->agents_.size()));
// glLineWidth(1.0f) ;
// glBegin(GL_LINES);
// glVertex3fv(pos.data());
// VEC3 f = pos + agent->forces/100.0;
// glVertex3fv(f.data());
// glEnd();
//
//
// glLineWidth(5.0f);
// VEC3 col;
// if(agent->movingObstacleNeighbors_.size()>0)
// {
// glBegin(GL_LINES);
// col = VEC3(1,0,0);
// for(unsigned int i = 0 ; i < agent->movingObstacleNeighbors_.size() ; ++i)
// {
// glVertex3fv(pos.data());
// VEC3 oP = (agent->movingObstacleNeighbors_[i].second->p1+agent->movingObstacleNeighbors_[i].second->p2)*0.5f;
// glVertex3fv(oP.data());
// }
// glEnd();
// }
// else if(agent->obstacleNeighbors_.size()>0)
// col = VEC3(1,1,0);
// else
// col = VEC3(0,1,0);
// glLineWidth(1.0f) ;
// glColor3fv(col.data());
glColor3f(c1,c2,c3) ;
glBegin(GL_POLYGON) ;
for(unsigned int i = 0 ; i < 5 ; ++i)
glVertex3f(pos[0] + (cosT[i] * radius), pos[1] + (sinT[i] * radius), pos[2]+0.01f) ;
glEnd() ;
// VEC3 posi = agent->finalGoal;
// glColor3f(0.0f, 0.0f, 1.0f);
// glBegin(GL_POLYGON);
// for(unsigned int i = 0; i < 5; ++i)
// glVertex3f(posi[0] + (cosT[i] * 1.5f), posi[1] + (sinT[i] * 1.5f), posi[2]-0.01f);
// glEnd();
VEC3 dir = agent->prefVelocity_ ;
dir.normalize() ;
//// glColor3f(c1,c2,c3) ;
// glBegin(GL_POLYGON) ;
// for(unsigned int i = 0 ; i < 5 ; ++i)
// glVertex3f(pos[0] + (cosT[i] * radius), pos[1] + (sinT[i] * radius), pos[2]+0.01f) ;
// glEnd() ;
// VEC3 dir = agent->prefVelocity_ ;
// dir.normalize() ;
//draw the speed vector
// VEC3 base(0,0,1);
......@@ -195,44 +222,50 @@ inline void renderAgent(EnvMap& m, Agent* agent, bool showNeighborDist = false,
//show goals
if (renderPath)
{
glLineWidth(3.0f) ;
glBegin(GL_LINE_STRIP) ;
for (std::vector<VEC3>::iterator it = (agent->goals_.begin()) ; it != agent->goals_.end() ;
++it)
{
glVertex3f((*it)[0], (*it)[1], agent->agentNo) ;
}
glVertex3f((*(agent->goals_.begin()))[0], (*(agent->goals_.begin()))[1], (*(agent->goals_.begin()))[2]) ;
glEnd() ;
glLineWidth(1.0f) ;
glPointSize(5.0f) ;
glBegin(GL_POINTS) ;
VEC3 g = agent->goals_[agent->curGoal_];
glVertex3fv(g.data()) ;
glEnd() ;
glPointSize(1.0f) ;
// glLineWidth(3.0f) ;
// glBegin(GL_LINE_STRIP) ;
// for (std::vector<VEC3>::iterator it = (agent->goals_.begin()) ; it != agent->goals_.end() ;
// ++it)
// {
// glVertex3f((*it)[0], (*it)[1], agent->agentNo) ;
// }
//
// glVertex3f((*(agent->goals_.begin()))[0], (*(agent->goals_.begin()))[1], (*(agent->goals_.begin()))[2]) ;
// glEnd() ;
// glLineWidth(1.0f) ;
//
// glPointSize(5.0f) ;
// glBegin(GL_POINTS) ;
// VEC3 g = agent->goals_[agent->curGoal_];
// glVertex3fv(g.data()) ;
// glEnd() ;
// glPointSize(1.0f) ;
//
// glBegin(GL_LINES);
// VEC3 p = agent->getPosition();
// glVertex3fv(p.data()) ;
// glVertex3fv(g.data()) ;
// glEnd();
}
if (showNeighborDist)
{
radius = agent->neighborDist_ ;
glColor3f(0.0f, 1.0f, 0.0f) ;
glBegin(GL_LINE_LOOP) ;
for (unsigned int i = 0 ; i < 5 ; ++i)
glVertex3f(pos[0] + (cosT[i] * radius), pos[1] + (sinT[i] * radius), pos[2] + 0.01f) ;
glEnd() ;
// radius = agent->neighborDist_ ;
// glColor3f(0.0f, 1.0f, 0.0f) ;
// glBegin(GL_LINE_LOOP) ;
// for (unsigned int i = 0 ; i < 5 ; ++i)
// glVertex3f(pos[0] + (cosT[i] * radius), pos[1] + (sinT[i] * radius), pos[2] + 0.01f) ;
// glEnd() ;
}
if (showObstacleDist)
{
radius = (agent->range_);
glColor3f(0.0f, 0.0f, 1.0f) ;
glBegin(GL_LINE_LOOP) ;
for (unsigned int i = 0 ; i < 5 ; ++i)
glVertex3f(pos[0] + (cosT[i] * radius), pos[1] + (sinT[i] * radius), pos[2] + 0.01f) ;
glEnd() ;
// radius = (agent->range_);
// glColor3f(0.0f, 0.0f, 1.0f) ;
// glBegin(GL_LINE_LOOP) ;
// for (unsigned int i = 0 ; i < 5 ; ++i)
// glVertex3f(pos[0] + (cosT[i] * radius), pos[1] + (sinT[i] * radius), pos[2] + 0.01f) ;
// glEnd() ;
}
}
......
......@@ -8,6 +8,11 @@
#include "Algo/Import/import.h"
#include "ShapeMatching/shapeMatchingQuadratic.h"
#include "Algo/Render/GL2/mapRender.h"
#include "Utils/vbo.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Qt/qtSimple.h"
using namespace std;
......@@ -39,6 +44,11 @@ public:
VertexAttribute<VEC3> position;
VertexAttribute<VEC3> normal;
Algo::Render::GL2::MapRender* m_render;
Utils::VBO* m_positionVBO;
Utils::VBO* m_normalVBO;
Utils::ShaderSimpleColor* m_simpleColorShader;
float scaleValue;
ShapeMatchingQuadratic<PFP> * smg;
......
......@@ -26,7 +26,7 @@ public:
bool is_inside (VEC3 p);
void computePrefVelocity();
void computeNewVelocity();
std::vector<Dart> getMemoCross(const VEC3& pos, const VEC3& dest, Dart& d1, Dart& d2);
std::vector<Dart> getMemoCross(const VEC3& pos, const VEC3& dest, Dart& d1,Dart& d2);
VEC3 getDilatedPosition(unsigned int ind); //vertex position with velocity dilatation
VEC3 getPosition(unsigned int ind); // vertex position
void update();
......@@ -36,14 +36,20 @@ public:
void attachMesh(MovingMesh* mm);
void updateMesh();
void attachAgent(Agent* ag);
unsigned int nbVertices;
CGoGN::Algo::MovingObjects::ParticleCell2D<PFP>* * parts_;
CGoGN::Algo::Surface::MovingObjects::ParticleCell2D<PFP>* * parts_;
PFP::MAP map;
VertexAttribute<VEC3> position;
VertexAttribute<VEC3> normal;
VertexAttribute<VEC3> deformation;
VertexAttribute<VEC3> velocity;
VertexAttribute<VEC3> forces;
EdgeAttribute<float> edgeLength;
DartAttribute<float> vertexAngle;
Dart groundFace;
......@@ -57,8 +63,6 @@ public:
// float rigidity;
VEC3 center;
int nb_agents_voisins;
int nb_register_cells;
int index;
int max_x_ind;
int min_x_ind;
......@@ -98,9 +102,10 @@ public:
bool rigid_;
bool spinning;
ArticulatedObstacle * parent;
int index_parent;
MovingMesh* mm_;
Agent* ag_;
int index_parent;
VertexAttribute<NoMathIONameAttribute<std::vector<PFP::REAL> > > mvc_;
};
......
......@@ -13,8 +13,8 @@ float pathCost(EnvMap& envMap, const typename PFP::TVEC3& position, Dart start,
{
typename PFP::MAP& map = envMap.map ;
return VEC3(
Algo::Geometry::faceCentroid<PFP>(map, goal, position)
- Algo::Geometry::faceCentroid<PFP>(map, start, position)).norm() ;
Algo::Surface::Geometry::faceCentroid<PFP>(map, goal, position)
- Algo::Surface::Geometry::faceCentroid<PFP>(map, start, position)).norm() ;
}
template <typename PFP>
......
......@@ -4,7 +4,7 @@
struct PFP : public PFP_STANDARD
{
// definition de la carte
typedef Algo::IHM::ImplicitHierarchicalMap MAP ;
typedef Algo::Surface::IHM::ImplicitHierarchicalMap MAP ;
// definition des listes d'agent
typedef std::vector<Agent*> AGENTS ;
......
......@@ -94,7 +94,7 @@ public:
void setupCorridorScenario(unsigned int nbAgents, unsigned int nbObstacles) ;
void setupSnakeCorridorScenario(unsigned int nbAgents, unsigned int nbSnakes, int snakeSize) ;
void setupCityScenario(int nbLines, int nbRank) ;
void setupScenario(unsigned int nbMaxAgent) ;
void setupScenario(unsigned int nbMaxAgent, bool path) ;
void addMovingObstacles(unsigned int nb);
void addMovingObstacle(Dart d, unsigned int obstType=0);
......
......@@ -39,8 +39,21 @@
#include "Algo/Export/exportPov.h"
#include "Utils/GLSLShader.h"
#include "Utils/colorMaps.h"
#include "Algo/Render/GL1/map_glRender.h"
#include "Algo/Render/GL1/topo_render.h"
#include "Algo/Render/GL2/mapRender.h"
#include "Algo/Render/GL2/topoRender.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderFlat.h"
#include "Utils/Shaders/shaderPhong.h"
#include "Utils/colorMaps.h"
#include "Utils/vbo.h"
#include "Utils/fbo.h"
#include "Utils/drawer.h"
#include "Utils/pointSprite.h"
#include "shaderCustom.h"
//#define EXPORTING
using namespace CGoGN ;
......@@ -55,7 +68,15 @@ public:
void initGUI() ;
void updateVBOprimitives(int upType);
void cb_initGL() ;
void initRendering();
void updateObstacleVBO();
void updateAgentPredTriVBO();
void updateObstaclePredTriVBO();
void moveCameraTo(VEC3 newPos);
void cb_redraw() ;
#ifndef SPATIAL_HASHING
......@@ -68,6 +89,66 @@ public:
void cb_keyPress(int keycode) ;
//RENDERING
Geom::Vec4f colDif ;
Geom::Vec4f colSpec ;
Geom::Vec4f colClear ;
Geom::Vec4f colNormal ;
//navigation map
Algo::Render::GL2::MapRender* m_render;
Algo::Render::GL2::MapRender* m_renderPedway;
Algo::Render::GL2::TopoRender* m_renderTopo;
Utils::VBO* m_positionVBO;
Utils::VBO* m_normalVBO;
Utils::VBO* m_colorVBO;
Utils::ShaderSimpleColor* m_simpleColorShader;
//building
Algo::Render::GL2::MapRender* m_render_scenary;
Utils::VBO* m_positionVBO_scenary;
Utils::VBO* m_normalVBO_scenary;
Utils::VBO* m_colorVBO_scenary;
#ifdef EXPORTING
ShaderCustom* m_flatShader_scenary;
#else
Utils::ShaderFlat* m_flatShader_scenary;
#endif
//agents
Utils::VBO* m_agentsVBO;
Utils::PointSprite* m_sprite;
//obstacles ground
std::vector<Algo::Render::GL2::MapRender*> m_obst_render;
std::vector<Utils::VBO*> m_obst_VBO;
std::vector<Utils::ShaderFlat*> m_obstShader;
//city ground
Utils::ShaderFlat* m_Ground_Shader;
Utils::VBO* m_Ground_VBO;
//prediction triangles
std::vector<Algo::Render::GL2::MapRender*> m_triObst_render;
std::vector<Utils::VBO*> m_triObst_VBO;
std::vector<Utils::ShaderSimpleColor*> m_triObst_Shader;
std::vector<Algo::Render::GL2::MapRender*> m_triAgent_render;
std::vector<Utils::VBO*> m_triAgent_VBO;
std::vector<Utils::ShaderSimpleColor*> m_triAgent_Shader;
static const unsigned int N_THETA = 64;
static const unsigned int N_PHI = 128;
static const float RADIUS = 3950.0f;
Utils::GLSLShader m_DeferedShader;
Utils::GLSLShader m_DeferedShader2;
enum renderMode {SIMPLE} ;
int m_renderStyle;
//////
Geom::BoundingBox<PFP::VEC3> bb ;
Utils::QT::uiDockInterface dock ;
QTimer* timer ;
......@@ -79,6 +160,8 @@ public:
unsigned int nbIterations ;
unsigned int maxIterations ;
unsigned int nbGeneratedPov;