Commit ebf53f8a authored by Arash HABIBI's avatar Arash HABIBI
Browse files

tourniquet

parent 69e96e91
......@@ -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"
......
......@@ -320,8 +320,8 @@ void MovingObstacle::draw()
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)
......@@ -644,10 +644,12 @@ void MovingObstacle::update()
{
//initialisation of forces with viscosity
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);
// ARASH : On parcourt les sommets de la grande face
for (unsigned int i = 1; i < nbVertices; ++i)
......@@ -655,6 +657,7 @@ void MovingObstacle::update()
Dart dd = d;
// ARASH : On parcourt les sous-faces triangulaire de la grande face
do {
if(!cm.isMarked(dd))
{
......@@ -671,7 +674,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;
......@@ -721,19 +724,19 @@ void MovingObstacle::update()
// ARASH : A présent on calcule les interactions avec les autres obstacles.
do {
if(!cm.isMarked(dd))
if(!cmV.isMarked(dd))
{
cm.mark(dd);
cmV.mark(dd);
VEC3 norm;
double obst_stiffness = 100.0; // agent-obstacle interaction stiffness
int obst_power = 1 ; // the power to which elevate the agent-obstacle distance
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 = 40.; // scenario 1 et 3
obst_radius_infl = 30.; // scenario 1 et 3
float force_value;
VEC3 p = position[dd]+(velocity[dd] * sim_->timeStep_);
......@@ -761,8 +764,8 @@ void MovingObstacle::update()
// Le facteur 5 est là seulement pour diminuer l'influence de la composante tangentielle
normal.normalize();
// forces[dd] -= force_value * normal;
forces[dd] += VEC3(100000000,0,0);
// force_value *= 10;
forces[dd] += force_value * normal;
// This force is not symmetrically applied
// We assume that a homologous vertex in the other obstacle
// is also intersecting the current obstacle
......
......@@ -733,7 +733,7 @@ void Simulator::addMovingObstacles(unsigned int nb)
}
if (found)
addMovingObstacle(dCell,0) ;
addMovingObstacle(dCell,1) ;
}
}
......
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