Commit 4c9e4a57 authored by pitiot's avatar pitiot

merge

parents 3f8518a5 0a2ddaee
......@@ -78,7 +78,7 @@ void generateCity(EnvMap& envMap, unsigned int nbBuildings)
if (!envMap.buildingMark.isMarked(d) && (rand() % 12 == 0)
&& notDiagonalAdjacentToAnObstacle<PFP>(envMap.map, d, envMap.buildingMark))
{
generateBuilding<PFP>(envMap, d, (1 + (rand() % 3)) * 50.0f, rand() % 4) ;
generateBuilding<PFP>(envMap, d, (1 + (rand() % 3)) * 50.0f, rand() % 4) ;
--nbBuilding ;
}
}
......@@ -375,7 +375,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)], NULL, 0);
position[map.phi1(next)], NIL, NIL, NULL, 0);
#ifdef SPATIAL_HASHING
VEC3 ov = o->p2 - o->p1 ;
......
......@@ -23,6 +23,9 @@
#include "Utils/vbo.h"
#endif
#include "Utils/drawer.h"
using namespace std;
PFP::VEC3 rotate (PFP::VEC3 pos1, PFP::VEC3 center, float angle);
float get_angle (PFP::VEC3 v1, PFP::VEC3 v2);
......@@ -36,7 +39,7 @@ public:
MovingObstacle(Simulator* sim, int index, std::vector<PFP::VEC3> pos, std::vector<VEC3> goals, bool rigid, bool spin,int curGoal=0, Dart d=NIL, ArticulatedObstacle * art=NULL, int indParent=-1);
void initGL();
void draw();
void draw(bool showPath=false);
void addGeneralCell ( Dart d);
bool removeGeneralCell (Dart d);
bool test_opposition(VEC3 o, VEC3 p1, VEC3 p2);
......@@ -50,7 +53,9 @@ public:
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();
void initForces();
void updateForces();
void applyForces();
PFP::REAL computeMVC(PFP::VEC3 p, Dart vertex);
void computePointMVC(PFP::VEC3 point, std::vector<PFP::REAL>& coordinates);
......@@ -85,6 +90,8 @@ public:
Utils::ShaderSimpleColor* m_shader;
#endif
Utils::Drawer* m_ds;
//vector de détails pour la deformation
// std::vector<PFP::VEC3> verticesDeformation;
......@@ -105,6 +112,11 @@ public:
std::vector<std::pair<Dart, int> > general_belonging;
VEC3 front;
// voisinage
std::vector<std::pair<float, Obstacle*> > obstacleNeighbors_ ;
std::vector<std::pair<float, Obstacle*> > movingObstacleNeighbors_;
VEC3 finalGoal;
float angle;
// Dart finalDart;
......@@ -138,8 +150,6 @@ public:
int index_parent;
float gravity_dist; /// distance entre le centre du MO et son sommet le plus éloigné
VertexAttribute<NoMathIONameAttribute<std::vector<PFP::REAL> > > mvc_;
std::vector<std::pair<float, Obstacle*> > obstacleNeighbors_ ;
std::vector<std::pair<float, Obstacle*> > movingObstacleNeighbors_;
};
#endif
......@@ -6,9 +6,9 @@
class Obstacle
{
public:
Obstacle(const VEC3 point1, const VEC3 point2, const VEC3 prevPoint, const VEC3 nextPoint,
Obstacle(const VEC3 point1, const VEC3 point2, const VEC3 prevPoint, const VEC3 nextPoint, Dart d_1, Dart d_2,
MovingObstacle * moving1=NULL, unsigned int ind=0) :
p1(point1), p2(point2), prevP(prevPoint), nextP(nextPoint),
d1(d_1), d2(d_2), p1(point1), p2(point2), prevP(prevPoint), nextP(nextPoint),
mo(moving1), index(ind)
{
// p1[2] = 0 ;
......@@ -17,6 +17,8 @@ public:
// nextP[2] = 0 ;
}
Dart d1;
Dart d2;
VEC3 p1 ;
VEC3 p2 ;
VEC3 prevP ;
......
......@@ -107,8 +107,8 @@ public:
void addAgent(const VEC3& start,const VEC3& goals, Dart d);
#ifndef SPATIAL_HASHING
void addPathToObstacles();
void addPathToObstacle(MovingObstacle * mo, Dart dStart, Dart dGoal);
void addPathToObstacles(CellMarker<FACE>& markForbid, bool goalCenterCell);
void addPathToObstacle(MovingObstacle * mo, Dart dStart, Dart dGoal, CellMarker<FACE>& markForbid, bool goalCenterCell);
void addPathToCorner() ;
void addPathsToAgents() ;
void addPathsToAgents_height() ;
......
......@@ -613,7 +613,7 @@ void EnvMap::registerWallInFaces()
Dart next = map.phi1(dd2) ;
Dart previous = map.phi_1(dd2) ;
Obstacle* o = new Obstacle(position[next], position[dd2], position[previous],
position[map.phi1(next)], NULL, 0) ;
position[map.phi1(next)], next, dd2, NULL, 0) ;
obstvect[dd2].push_back(o) ;
}
dd = map.phi1(dd) ;
......@@ -660,6 +660,7 @@ void EnvMap::registerObstaclesInFaces()
Dart previous = map.phi_1(dd2) ;
Obstacle* o = new Obstacle(position[dd2], position[next],
position[previous], position[map.phi1(next)],
next, dd2,
NULL, 0) ;
obstvect[d].push_back(o) ;
}
......@@ -711,7 +712,7 @@ void EnvMap::addNeighborObstacles(PFP::OBSTACLES& obst, Dart d, bool edgeNeighbo
Dart next = map.phi1(dd2) ;
Dart previous = map.phi_1(dd2) ;
Obstacle* o = new Obstacle(position[dd2], position[next], position[previous],
position[map.phi1(next)], NULL, 0) ;
position[map.phi1(next)], next, dd2, NULL, 0) ;
obst.push_back(o) ;
// }
}
......@@ -1362,7 +1363,7 @@ void EnvMap::resetAgentInFace(Agent* agent)
{
VEC3 pos = agent->part_.getPosition() ;
agent->part_.ParticleBase<PFP>::move(Algo::Surface::Geometry::faceCentroid<PFP>(map, agent->part_.d, position)) ;
agent->part_.CGoGN::Algo::MovingObjects::ParticleBase<PFP>::move(Algo::Surface::Geometry::faceCentroid<PFP>(map, agent->part_.d, position)) ;
agent->part_.setState(FACE) ;
agent->part_.move(pos) ;
}
......
......@@ -3,6 +3,7 @@
#include "agent.h"
#include "simulator.h"
#include "moving_mesh.h"
#include "Utils/colorMaps.h"
#include "Algo/Modelisation/triangulation.h"
......@@ -272,7 +273,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
Obstacle* o = new Obstacle(parts_[i]->getPosition(),
parts_[(i + 1) % nbVertices]->getPosition(),
parts_[(i - 1 + nbVertices) % nbVertices]->getPosition(),
parts_[(i + 2) % nbVertices]->getPosition(), this, i);
parts_[(i + 2) % nbVertices]->getPosition(), i, (i+1)% nbVertices, this, i);
obstacles_[i] = o;
// CGoGNout<<" obstacle :"<< i << " num : "<< o<<CGoGNendl;
sim_->envMap_.pushObstacleInCells(o);
......@@ -301,27 +302,54 @@ void MovingObstacle::initGL()
// registerShader(m_shader);
#endif
m_ds = new Utils::Drawer();
}
void MovingObstacle::draw()
void MovingObstacle::draw(bool showPath)
{
#ifdef EXPORTING_BOXES
// m_render->initPrimitives<PFP>(map, Algo::Render::GL2::LINES,false) ;
// m_render->initPrimitives<PFP>(map, Algo::Render::GL2::TRIANGLES,false) ;
m_positionVBO->updateData(position);
// m_shader->setColor(Geom::Vec4f(movingObstacleNeighbors_.size()==0 ? 1.0f : 0,0.,0.,0.));
m_shader->setColor(Geom::Vec4f(this->index==279,0.,0.,0.0));
VEC3 col = Utils::color_map_BCGYR(float(index)/float(sim_->movingObstacles_.size()));
if(movingObstacleNeighbors_.size()==0)
// if(obstacleNeighbors_.size()==0)
m_shader->setColor(Geom::Vec4f(col[0],col[1],col[2],0));
else
m_shader->setColor(Geom::Vec4f(0.5,0.5,0.5,0));
m_render->draw(m_shader, Algo::Render::GL2::TRIANGLES);
m_shader->setColor(Geom::Vec4f(0.,0.,0.,0.));
m_render->draw(m_shader, Algo::Render::GL2::LINES);
#endif
if(showPath)
{
m_ds->newList(GL_COMPILE_AND_EXECUTE);
m_ds->begin(GL_LINE_STRIP);
VEC3 col = Utils::color_map_BCGYR(float(index)/float(sim_->movingObstacles_.size()));
m_ds->color3f(col[0],col[1],col[2]);
for(std::vector<VEC3>::iterator it = goals_.begin() ; it != goals_.end() ; ++it)
{
m_ds->vertex(*it);
}
m_ds->end();
m_ds->endList();
}
}
VEC3 MovingObstacle::getDilatedPosition(unsigned int ind)
{
Dart d(ind); //WARNING : works only for one face created at start !
return position[d]+deformation[d];
// return position[d];
// return position[d]+deformation[d];
return position[d];
}
VEC3 MovingObstacle::getPosition(unsigned int ind)
......@@ -592,9 +620,6 @@ void MovingObstacle::updateObstacleNeighbors() // obstacles voisins , distance p
// if (distSq > maxDistMovingObst)
// maxDistMovingObst = distSq ;
movingObstacleNeighbors_.push_back(std::make_pair(distSq, *it)) ;
}
}
}
......@@ -602,7 +627,159 @@ void MovingObstacle::updateObstacleNeighbors() // obstacles voisins , distance p
}
}
void MovingObstacle::update()
//-------------------------------------------------------------
int matrixInverse(VEC3 v1, VEC3 v2, VEC3 v3, VEC3 *inv1, VEC3 *inv2, VEC3 *inv3)
{
int res = 0;
float determinant = v1[0]*v2[1]*v3[2] + v2[0]*v3[1]*v1[2] + v3[0]*v1[1]*v2[2] - v3[0]*v2[1]*v1[2] - v2[0]*v1[1]*v3[2] - v1[0]*v3[1]*v2[2];
if(determinant==0.0)
res=1;
else
{
float un_sur = 1.0 / determinant;
*inv1 = VEC3( v2[1]*v3[2]-v3[1]*v2[2], v2[0]*v3[2]-v3[0]*v2[2], v2[0]*v3[1]-v3[0]*v2[1] );
*inv2 = VEC3( v1[1]*v3[2]-v3[1]*v1[2], v1[0]*v3[2]-v3[0]*v1[2], v1[0]*v3[1]-v3[0]*v1[1] );
*inv3 = VEC3( v1[1]*v2[2]-v2[1]*v1[2], v1[0]*v2[2]-v2[0]*v1[2], v1[0]*v2[1]-v2[0]*v1[1] );
res=0;
*inv1 = *inv1 * un_sur;
*inv2 = *inv2 * un_sur;
*inv3 = *inv3 * un_sur;
}
return res;
}
//-------------------------------------------------------------
float distToLine(VEC3 M, VEC3 P, VEC3 u)
{
u.normalize();
VEC3 MP = P - M;
return(MP*(u^(MP^u)));
}
//-------------------------------------------------------------
// Première stratégie : appliquer à p1 et à p2 une force
// colinéaire à f, mais d'intensité différente. Dans ce cas,
// il est nécessaire de calculer la somme des moments et de
// l'annuler. *f1 = f*d2/(d1+d2) et *f2 = f*d1/(d1+d2).
void getResponse1(VEC3 f, VEC3 p, VEC3 p1, VEC3 p2, VEC3 *f1, VEC3 *f2)
{
float d1 = distToLine(p1,p,f);
float d2 = distToLine(p2,p,f);
*f1 = f*(-d2/(d1+d2));
*f2 = f*(-d1/(d1+d2));
}
//-------------------------------------------------------------
// Deuxième stratégie, les forces appliquées à p1 et p2
// doivent etre colinaires respectivement à pp1 et pp2.
// Donc la somme des moments est automatiquement nulle.
// Pour calculer les intensites, il faut décomposer f
// dans la base (pp1,pp2), ce qui donnera l'intensite de
// chaque force. Problème : on peut générer des forces
// d'étirement importantes.
void getResponse2(VEC3 f, VEC3 p, VEC3 p1, VEC3 p2, VEC3 *f1, VEC3 *f2)
{
float d1 = (p1-p).norm();
float d2 = (p2-p).norm();
float d12 = (p2-p1).norm();
VEC3 ortho = (p1-p) ^ (p2-p);
if(ortho.norm()==0.0)
{
if(d12==0) // comprend le cas où d1==0 et d2==0
{
*f2 = (-0.5)*f;
*f1 = (-0.5)*f;
}
else if(d1==0)
{
*f2 = VEC3(0,0,0);
*f1 = -f;
// meilleure idee : projeter f sur p1p2 -> f2 et f1 <- f-f2
}
else if(d2==0)
{
*f1 = VEC3(0,0,0);
*f2 = -f;
// meilleure idee : projeter f sur p1p2 -> f1 et f2 <- f-f1
}
else // trois points distincts, mais alignés
{
// A suivre
}
}
// int res = matrixInverse(p1-p,p2-p,ortho, VEC3 *inv1, VEC3 *inv2, VEC3 *inv3);
// inv1, inv2 et inv3 sont les composantes de la matrice inverse. L'image de
// p1-p et p2-p par cette matrice donne la valeur des forces f1 et f2.
}
//-------------------------------------------------------------
void MovingObstacle::initForces()
{
Dart dd = groundFace;
if(!rigid_)
for (unsigned int i = 0; i < nbVertices; ++i)
{
//initialisation of forces
forces[dd] = VEC3(0.0);
map.next(dd);
}
}
//-------------------------------------------------------------
VEC3 computeForce(VEC3 p, VEC3 p1, VEC3 p2, float obst_radius_infl, float obst_power, float obst_stiffness)
{
double force_value=0.0;
double longueur2 = (p1-p2).norm2();
double rest_sum_of_dists = 2 * sqrt(obst_radius_infl*obst_radius_infl + longueur2/4);
double d1 = (p-p1).norm();
double d2 = (p-p2).norm();
double sum_of_dists = d1+d2;
if(sum_of_dists < rest_sum_of_dists)
{
double collision_softening_factor = pow(1-sum_of_dists/rest_sum_of_dists,obst_power);
force_value = obst_stiffness*collision_softening_factor*(rest_sum_of_dists - sum_of_dists);
VEC3 v_obst = p2 - p1;
VEC3 normal = VEC3(v_obst[1],-v_obst[0],0);
// Ajouter une composante tangentielle
normal += v_obst * ((d1-d2)/sum_of_dists);
// normal += v_obst * ((d1-d2)/(5*sum_of_dists));
// Le facteur 5 est là seulement pour diminuer l'influence de la composante tangentielle
normal.normalize();
// force_value *= 10;
/*
VEC3 force_vector1, force_vector2;
getResponse1(force_vector,p,p1,p2,&force_vector1,&force_vector2);
Dart d1 = obst->d1;
Dart d2 = obst->d2;
obst->mo->forces[d1] += force_vector1;
obst->mo->forces[d2] += force_vector2;
*/
return(force_value * normal);
}
else
return(VEC3(0));
}
//-------------------------------------------------------------
void MovingObstacle::updateForces()
{
assert(sim_->envMap_.map.getCurrentLevel() == sim_->envMap_.map.getMaxLevel()) ;
......@@ -635,30 +812,39 @@ void MovingObstacle::update()
else
rotor = abs_angle*angle ;
// masse ressort pour la limace
if(!rigid_)
{
Dart d = groundFace;
map.next(d);
// map.next(d);
Dart dd =d;
for (unsigned int i = 1; i < nbVertices; ++i)
for (unsigned int i = 0; i < nbVertices; ++i)
{
//initialisation of forces with viscosity
forces[dd] = -0.2f*velocity[dd];
forces[dd] += -0.2f*velocity[dd];
// forces[dd] = VEC3(0.0);
map.next(dd);
}
CellMarkerStore<EDGE> cm(map);
CellMarkerStore<VERTEX> cmV(map);
DartMarkerStore dm(map);
for (unsigned int i = 1; i < nbVertices; ++i)
// ARASH : On parcourt les sommets de la grande face
for (unsigned int i = 0; i < nbVertices; ++i)
{
Dart dd = d;
// ARASH : On parcourt les sous-faces triangulaire de la grande face
do {
if(!cm.isMarked(dd))
{
cm.mark(dd);
VEC3 p1Next = position[map.phi1(dd)]+(velocity[map.phi1(dd)] * sim_->timeStep_);
VEC3 p2Next = position[dd]+(velocity[dd] * sim_->timeStep_);
// p1Next et p2Next sont la position des extremites de l'arete.
VEC3 v1 = (p1Next-p2Next);
//stretch spring : /!\ max rigidity relative to the timestep used (unstable otherwise)
......@@ -668,7 +854,7 @@ void MovingObstacle::update()
float stretch = rigidity*(edgeLength[dd]-v1.norm());
if(norm>0.0f)
{
VEC3 f = stretch*(v1/norm);
VEC3 f = 1.5*stretch*(v1/norm);
//apply force symmetrically
forces[dd] -= f;
......@@ -679,6 +865,7 @@ void MovingObstacle::update()
dd = map.phi1(dd);
} while(dd!=d);
// ARASH : les ressorts angulaires
do {
if(!dm.isMarked(dd))
{
......@@ -713,14 +900,62 @@ void MovingObstacle::update()
dd = map.phi1(dd);
} while(dd!=d);
//-------------------------------------------------------------------------
// ARASH : A présent on calcule les interactions avec les autres obstacles.
do {
if(!cmV.isMarked(dd))
{
cmV.mark(dd);
VEC3 norm;
double obst_stiffness = 5.0; // agent-obstacle interaction stiffness
int obst_power = 2 ; // the power to which elevate the agent-obstacle distance
double obst_radius_infl;
if(sim_->config==0)
obst_radius_infl = 100.; // scenario 0
else
obst_radius_infl = 30.; // scenario 1 et 3
VEC3 p = position[dd]+(velocity[dd] * sim_->timeStep_);
// Evitement d'obstacles mobiles
for(std::vector<std::pair<float, Obstacle*> >::iterator it = movingObstacleNeighbors_.begin() ;
it != movingObstacleNeighbors_.end() ; ++it)
{
Obstacle * obst = it->second;
VEC3 p1=obst->p1 ;
VEC3 p2=obst->p2 ;
forces[dd] += computeForce(p,p1,p2,obst_radius_infl,obst_power,obst_stiffness);
}
// Evitement d'obstacles fixes
for(std::vector<std::pair<float, Obstacle*> >::iterator it = obstacleNeighbors_.begin() ;
it != obstacleNeighbors_.end() ; ++it)
{
Obstacle * obst = it->second;
VEC3 p1=obst->p1 ;
VEC3 p2=obst->p2 ;
forces[dd] += computeForce(p,p1,p2,obst_radius_infl,obst_power,10*obst_stiffness);
}
}
dd = map.phi1(dd);
} while(dd!=d);
map.next(d);
}
//guiding vertex = first vertex (set the displacement)
forces[groundFace] = VEC3(0);
// forces[groundFace] = VEC3(0);
velocity[groundFace] = velocity_;
//apply force to each vertex
/*
d = groundFace;
for (unsigned int i = 0; i < nbVertices; ++i)
{
......@@ -730,6 +965,7 @@ void MovingObstacle::update()
bary += position[d];
map.next(d);
}
*/
}
else
{
......@@ -750,7 +986,8 @@ void MovingObstacle::update()
// position[map.phi<211>(d)] += (velocity_ * sim_->timeStep_);
bary += position[d];
parts_[i]->move(getDilatedPosition(i));
map.next(d);
}
......@@ -779,10 +1016,40 @@ void MovingObstacle::update()
// if(!rigid_)
// center = position[groundFace];
}
//-------------------------------------------------------------------------
// MAJ des obstacles
void MovingObstacle::applyForces()
{
PFP::VEC3 bary(0);
if(!rigid_)
{
Dart d = groundFace;
for (unsigned int i = 0; i < nbVertices; ++i)
{
velocity[d] += forces[d] * sim_->timeStep_;
position[d] += (velocity[d] * sim_->timeStep_);
position[map.phi<211>(d)] += (velocity[d] * sim_->timeStep_);
bary += position[d];
map.next(d);
}
center = bary / nbVertices;
}
// MAJ des obstacles
for (unsigned int i = 0; i < nbVertices; ++i)
{
#ifdef TWO_AND_HALF_DIM
std::cout << " dist supp " << (getDilatedPosition(i)-parts_[i]->getPosition()).norm() << std::endl;
#endif
parts_[i]->move(getDilatedPosition(i));
#ifdef TWO_AND_HALF_DIM
std::cout << " dist " << parts_[i]->getDistance() << std::endl;
position[d] = parts_[i]->getPosition();
#endif
// CGoGNout << "avant une etape : Obstacle "<< i << CGoGNendl;
Obstacle* o = obstacles_[i];
o->p1 = getDilatedPosition(i);
......@@ -841,9 +1108,9 @@ void MovingObstacle::update()
}
}
}
//-------------------------------------------------------------------------
std::vector<Dart> MovingObstacle::getMemoCross(const VEC3& pos, const VEC3& dest, Dart& d1, Dart& d2)
{
......@@ -1001,7 +1268,7 @@ void MovingObstacle::computePrefVelocity() //calcul du vecteur optimal pour atte
{
goalVector = (get_center(parent,index_parent-1) -center);
float goalDist2 = goalVector.norm2() ;
if (goalDist2 > maxSpeed_)
if (goalDist2 > 1000.0f*maxSpeed_)
{
goalVector.normalize() ;
goalVector *= maxSpeed_;
......
......@@ -68,7 +68,7 @@ void Simulator::init( float dimension, unsigned int nbAgent, unsigned int nbObst
envMap_.init(config, 1000.0f, 1000.0f, minSize, 100.0f) ; //grosses cases
setupScenario(nbAgent, false) ;
addMovingObstacles(nbObst);
addPathToObstacles();
addPathToObstacles(envMap_.buildingMark, true);
//// setupCityScenario(-1.0f * (12 * (70.0f / 2.0f) - 10),
//// -1.0f * (12 * (70.0f / 2.0f) - 10), 20, 20);
break ;
......@@ -80,7 +80,7 @@ void Simulator::init( float dimension, unsigned int nbAgent, unsigned int nbObst
setupScenario(nbAgent, true) ;
// SelectorCellNotMarked<PFP::MAP> scnm(envMap_.pedWayMark);
addMovingObstacles(nbObst);
// addPathToObstacles();
// addPathToObstacles(envMap_.pedWayMark, false);
addPathsToAgents();
break;
case 6:
......@@ -88,7 +88,7 @@ void Simulator::init( float dimension, unsigned int nbAgent, unsigned int nbObst
envMap_.init(config,200.0,200.0, minSize, 400.0f);
setupPlanetScenario(nbAgent,nbObst);
addMovingObstacles(nbObst);
addPathToObstacles();
addPathToObstacles(envMap_.buildingMark, true);
#else
std::cout << "Agents not in 2.5D mode" << std::endl;
#endif
......@@ -139,19 +139,31 @@ void Simulator::doStep()
clock_gettime(CLOCK_MONOTONIC, &begTime) ;
movingObstacles_[i]->computePrefVelocity() ;
movingObstacles_[i]->computeNewVelocity() ;
movingObstacles_[i]->initForces();
clock_gettime(CLOCK_MONOTONIC, &endTime) ;
time_behave+= timespec_delta(begTime,endTime).tv_nsec;
clock_gettime(CLOCK_MONOTONIC, &begTime) ;
}
clock_gettime(CLOCK_MONOTONIC, &begTime) ;
for (unsigned int i = 0 ; i < movingObstacles_.size() ; ++i)
{
movingObstacles_[i]->updateAgentNeighbors();
movingObstacles_[i]->updateObstacleNeighbors();
#ifndef SPATIAL_HASHING
envMap_.map.setCurrentLevel(envMap_.map.getMaxLevel()) ;
#endif
movingObstacles_[i]->update() ;
movingObstacles_[i]->updateForces() ;
}
clock_gettime(CLOCK_MONOTONIC, &endTime) ;
time_obstacle+= timespec_delta(begTime,endTime).tv_nsec;
for (unsigned int i = 0 ; i < movingObstacles_.size() ; ++i)
{
clock_gettime(CLOCK_MONOTONIC, &begTime) ;
movingObstacles_[i]->applyForces();
clock_gettime(CLOCK_MONOTONIC, &endTime) ;
time_obstacle+= timespec_delta(begTime,endTime).tv_nsec;
// commente par Arash
movingObstacles_[i]->updateMesh() ;
movingObstacles_[i]->updateMesh() ;
}
......@@ -768,7 +780,7 @@ void Simulator::addMovingObstacles(unsigned int nb)
}