Commit 35d362bc authored by Thomas Jund's avatar Thomas Jund
Browse files

correction updateMovingObstacle

parent 17b80ebc
......@@ -229,7 +229,7 @@ void Agent::updateObstacleNeighbors()
if ((movingObstacleNeighbors_.size() < maxMovingObstacles_ || distSq < maxDistMovingObst)
&& distSq < rangeSq_)
{
// if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::LEFT)
if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
{
if (distSq > maxDistMovingObst)
......@@ -267,7 +267,7 @@ void Agent::updateObstacleNeighbors()
if ((movingObstacleNeighbors_.size() < maxNeighbors_ || distSq < maxDistMovingObst)
&&distSq < rangeSq_)
{
// if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::LEFT)
if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
{
if (distSq > maxDistMovingObst) maxDistMovingObst = distSq ;
......@@ -601,7 +601,7 @@ void Agent::computeNewVelocity()
int obst_power = 2 ; // the power to which elevate the agent-obstacle distance
Obstacle* obst ;
#define ARASH
//#define ARASH
#ifdef ARASH
nb_mos = 0;
for(std::vector<std::pair<float, Obstacle*> >::iterator it = movingObstacleNeighbors_.begin() ;
......
......@@ -98,8 +98,8 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
// std::string filename = "./svg/simpleCross.svg" ;
Algo::Surface::Import::importSVG<PFP>(map, filename, position, obstacleMark, buildingMark) ;
// std::string filename2 = "./svg/mapBuild.svg" ;
// Algo::Surface::Import::importSVG<PFP>(mapScenary, filename2, positionScenary, obstacleMarkS, buildingMarkS) ;
std::string filename2 = "./svg/mapBuild.svg" ;
Algo::Surface::Import::importSVG<PFP>(mapScenary, filename2, positionScenary, obstacleMarkS, buildingMarkS) ;
Geom::BoundingBox<PFP::VEC3> bb1, bb2 ;
bb1 = Algo::Geometry::computeBoundingBox<PFP>(map, position) ;
......
......@@ -506,7 +506,7 @@ void MovingObstacle::update()
//stretch spring : /!\ max rigidity relative to the timestep used (unstable otherwise)
float norm = v1.norm();
float rigidity = 40.0f;
float rigidity = 50.0f;
float stretch = rigidity*(edgeLength[dd]-v1.norm());
VEC3 f = stretch*(v1/norm);
......@@ -534,7 +534,7 @@ void MovingObstacle::update()
float restAngle = vertexAngle[dd];
if(restAngle!=0.0f)
{
float angularRig = 40.0f;
float angularRig = 50.0f;
float curAngle = Algo::Surface::Geometry::angle<PFP>(map, map.phi_1(dd),map.phi1(dd),position);
float angularStretch = angularRig*(restAngle-curAngle);
......@@ -744,7 +744,7 @@ void MovingObstacle::computePrefVelocity() //calcul du vecteur optimal pour atte
float goalDist2 = goalVector.norm2() ;
if (goalDist2 < 5.0f)
if (goalDist2 < 500.0f)
{
curGoal_ = (curGoal_ + 1) % goals_.size() ;
goalVector = goals_[curGoal_] - center ;
......
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