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

ajout info brin dans obst

parent 7f81911e
......@@ -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 ;
......
......@@ -33,7 +33,7 @@ class ArticulatedObstacle;
#include "pfp.h"
//#define EXPORTING3
#define TWO_AND_HALF_DIM
//#define TWO_AND_HALF_DIM
#ifdef EXPORTING3
#include "Utils/Shaders/shaderPhongTexture.h"
......
......@@ -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 ;
......
......@@ -206,7 +206,7 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
#ifndef SPATIAL_HASHING
map.init() ;
// registerObstaclesInFaces();
registerObstaclesInFaces();
// TODO Check registerWallInFaces();
// registerWallInFaces() ;
// subdivideAllToMaxLevel();
......@@ -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) ;
// }
}
......
......@@ -272,7 +272,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);
......@@ -750,7 +750,16 @@ void MovingObstacle::update()
// position[map.phi<211>(d)] += (velocity_ * sim_->timeStep_);
bary += position[d];
#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
map.next(d);
}
......
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