Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit ecddc723 authored by pitiot's avatar pitiot
Browse files

maj scenar 3 et 6

parent 406d546c
......@@ -25,7 +25,7 @@ constrainedV(map)
position = map.getAttribute<VEC3, VERTEX>(attrNames[0]) ;
float area = Algo::Surface::Geometry::convexFaceArea<PFP>(envMap.map, d, envMap.position);
scaleValue = std::max(area/1400.0f,10.0f);
scaleValue = std::max(area/1400.0f,5.0f);
std::cout << "scaleVal " << scaleValue << std::endl;
// scale(scaleValue/1.8f);
......
......@@ -1384,8 +1384,10 @@ void MovingObstacle::computePrefVelocity() //calcul du vecteur optimal pour atte
}
void MovingObstacle::computeNewVelocity() //comportement des obstacles en tenant compte de l'environnement.
{
#ifndef TWO_AND_HALF_DIM
if (spinning)
{
VEC3 forward = front-center;
float goalDist2 = forward.norm2() ;
float objective = prefVelocity_.norm2();
......@@ -1405,6 +1407,9 @@ void MovingObstacle::computeNewVelocity() //comportement des obstacles en tenan
{
newVelocity_=prefVelocity_;
}
#else
newVelocity_=prefVelocity_;
#endif
}
......
......@@ -87,7 +87,7 @@ void Simulator::init( float dimension, unsigned int nbAgent, unsigned int nbObst
#ifdef TWO_AND_HALF_DIM
envMap_.init(config,200.0,200.0, minSize, 400.0f);
setupPlanetScenario(nbAgent,nbObst);
addMovingObstacles(nbObst, 0);
addMovingObstacles(nbObst, 1);
addPathToObstacles(envMap_.buildingMark, true);
#else
std::cout << "Agents not in 2.5D mode" << std::endl;
......@@ -663,11 +663,26 @@ void Simulator::setupScenario(unsigned int nbMaxAgent, bool pedWay)
* Add agents, specifying their start position, and store their goal on the
* opposite side of the environment.
*/
Dart d = envMap_.map.begin();
CellMarker<FACE> to_fill(envMap_.map);
int nb_cells=0;
while (d!= envMap_.map.end())
{
if(!to_fill.isMarked(d))
{
to_fill.mark(d);
nb_cells ++;
}
envMap_.map.next(d);
}
TraversorF<PFP::MAP> tF(envMap_.map);
Dart d = tF.begin() ;
d = tF.begin() ;
unsigned int nbx = 1 ;
unsigned int nby = 1 ;
unsigned int nbx = (nbMaxAgent / (nb_cells))/5;
unsigned int nby = 5;
unsigned int bMax = nbx * nby > 0 ? nbMaxAgent / (nbx * nby) : nbMaxAgent ;
......@@ -716,10 +731,23 @@ void Simulator::setupPlanetScenario(unsigned int nbAgents, unsigned int nbObstac
* opposite side of the environment.
*/
Dart d = envMap_.map.begin();
CellMarker<FACE> to_fill(envMap_.map);
int nb_cells=0;
while (d!= envMap_.map.end())
{
if(!to_fill.isMarked(d))
{
to_fill.mark(d);
nb_cells ++;
}
envMap_.map.next(d);
}
d=envMap_.map.begin();
CellMarker<FACE> filled(envMap_.map);
unsigned int nbx = 1;
unsigned int nby = 1;
unsigned int nbx = (nbAgents / (nb_cells))/5;
unsigned int nby = 5;
unsigned int bMax = nbAgents / (nbx*nby);
......@@ -849,7 +877,7 @@ void Simulator::addMovingObstacle(Dart d, unsigned int obstType)
bary += *it;
bary /= vPos.size();
float scale = 1.2f;
float scale =0.5f;
for(std::vector<VEC3>::iterator it = vPos.begin() ; it != vPos.end() ; ++it)
*it = *it*scale - bary*(scale-1.0f);
}
......
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