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

angles signé pour le mass-spring

parent 0fcc8b63
......@@ -258,7 +258,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
if(!map.isBoundaryMarked2(d) && !treated.isMarked(d))
{
treated.mark(d);
vertexAngle[d] = Algo::Surface::Geometry::angle<PFP>(map,map.phi_1(d),map.phi1(d),position);
vertexAngle[d] = Algo::Surface::Geometry::angle<PFP>(map,map.phi_1(d),map.phi2(map.phi1(d)),position);
}
}
......@@ -822,7 +822,7 @@ void MovingObstacle::updateForces()
for (unsigned int i = 0; i < nbVertices; ++i)
{
//initialisation of forces with viscosity
forces[dd] += -0.2f*velocity[dd];
forces[dd] += -0.9f*velocity[dd];
// forces[dd] = VEC3(0.0);
map.next(dd);
}
......@@ -848,7 +848,7 @@ void MovingObstacle::updateForces()
//stretch spring : /!\ max rigidity relative to the timestep used (unstable otherwise)
float norm = v1.norm();
float rigidity = 70.0f;
float rigidity = 30.0f;
float stretch = rigidity*(edgeLength[dd]-v1.norm());
if(norm>0.0f)
......@@ -882,7 +882,16 @@ void MovingObstacle::updateForces()
{
float angularRig = 70.0f;
float curAngle = Algo::Surface::Geometry::angle<PFP>(map, map.phi_1(dd),map.phi1(dd),position);
float curAngle = Algo::Surface::Geometry::angle<PFP>(map, map.phi_1(dd),map.phi2(map.phi1(dd)),position);
VEC3 v1 = Algo::Surface::Geometry::vectorOutOfDart<PFP>(map, map.phi_1(dd), position);
VEC3 v2 = Algo::Surface::Geometry::vectorOutOfDart<PFP>(map, map.phi2(map.phi1(dd)), position);
VEC3 v3 = v1 ^ v2;
VEC3 vPl = Algo::Surface::Geometry::faceNormal<PFP>(map, dd, position);
if(v3 * vPl < 0.0f)
curAngle *= -1.0f;
float angularStretch = angularRig*(restAngle-curAngle);
......
......@@ -3,7 +3,7 @@
Simulator::Simulator(unsigned int config, unsigned int minS, unsigned int nbAgent, unsigned int nbObst, bool resolution) :
timeStep_(0.05f),
timeStep_(0.025f),
// timeStep_(0.2f),
globalTime_(0.0f),
nbSteps_(0),
......
......@@ -1861,6 +1861,7 @@ int main(int argc, char** argv)
SocialAgents sa(config, minSize, nbAgent, nbObst,multires, iterations) ;
sa.setGeometry(0, 0, 1800, 1200) ;
sa.initGUI() ;
glewInit();
sa.show() ;
// if (argc > 1)
// sa.timer->start() ;
......
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