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 3ef26306 authored by Jund Thomas's avatar Jund Thomas
Browse files

micro modif

parent 616b25d7
......@@ -21,7 +21,7 @@ public:
bool is_inside (VEC3 p);
void computePrefVelocity();
std::list<Dart> getMemoCross(const Algo::MovingObjects::ParticleCell2D<PFP>* p1, const Algo::MovingObjects::ParticleCell2D<PFP>* p2);
std::list<Dart> getMemoCross(const Algo::MovingObjects::ParticleCell2D<PFP>* p1, const VEC3& dest);
void update();
......
......@@ -221,7 +221,7 @@ void MovingObstacle::computePrefVelocity()
void MovingObstacle::update()
{
// general_belonging.clear();
PFP::VEC3 sum = 0;
PFP::VEC3 bary = 0;
Dart d;
velocity_[0] = prefVelocity_[0] * velocity_factor;
......@@ -252,17 +252,14 @@ void MovingObstacle::update()
target += rotate(parts_[i]->getPosition(), center, rotor);
}
// CGoGNout << "avant déplacement particule : "<< i << CGoGNendl;
// CGoGNout << "particule : "<< parts_[i]->state << CGoGNendl;
parts_[i]->move(target);
// CGoGNout << "apres déplacement particule : "<< i << CGoGNendl;
sum += target;
bary += target;
}
make_half_turn -= rotor * nbVertices;
if (make_half_turn == 0)
center = sum / nbVertices;
center = bary / nbVertices;
// MAJ des obstacles
for (unsigned int i = 0; i < nbVertices; ++i)
......@@ -400,14 +397,13 @@ void register_add(Obstacle* o, int n, const std::list<Dart>& memo_cross)
}
}
std::list<Dart> MovingObstacle::getMemoCross(const Algo::MovingObjects::ParticleCell2D<PFP>* p1,const Algo::MovingObjects::ParticleCell2D<PFP>* p2)
std::list<Dart> MovingObstacle::getMemoCross(const Algo::MovingObjects::ParticleCell2D<PFP>* p1, const VEC3& dest)
{
Dart d = p1->d;
const VEC3& start = p1->getPosition();
const VEC3& stop = p2->getPosition();
CGoGN::Algo::MovingObjects::ParticleCell2DMemo<PFP> part(envMap_->map, d, start, envMap_->position);
part.move(stop);
part.move(dest);
return part.memo_cross;
}
......@@ -424,13 +420,13 @@ void MovingObstacle::register_update(Obstacle* o, Dart d, int n)
if(p1->crossCell != CGoGN::Algo::MovingObjects::NO_CROSS
|| p2->crossCell != CGoGN::Algo::MovingObjects::NO_CROSS)
{
memo = getMemoCross(p1,p2);
memo = getMemoCross(p1,p2->getPosition());
memo.sort();
modif=true;
}
else if(!envMap_->map.sameFace(p1->d,p2->d))
{
memo = getMemoCross(p1,p2);
memo = getMemoCross(p1,p2->getPosition());
memo.sort();
if(belonging_cells[n] != memo)
modif=true;
......@@ -458,7 +454,7 @@ void update_registration(Obstacle * o)
{
int i = o->index;
std::list<Dart> memo = mo->getMemoCross(mo->parts_[i] , mo->parts_[(i+1)%mo->nbVertices]);
std::list<Dart> memo = mo->getMemoCross(mo->parts_[i] , mo->parts_[(i+1)%mo->nbVertices]->getPosition());
register_add(o, i, memo);
// mo->general_belonging.clear();
......
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