Commit 3dcf2166 authored by pitiot's avatar pitiot
Browse files

3D focntionne

parent cba9f847
......@@ -24,8 +24,8 @@ inline float det2D(const VEC3& vector1, const VEC3& vector2)
inline float distSqPointLineSegment(VEC3 a1, VEC3 b1, const VEC3& c1)
{
a1[2] = 0 ;
b1[2] = 0 ;
// a1[2] = 0 ;
// b1[2] = 0 ;
VEC3 a1b1 = b1 - a1 ;
VEC3 a1c1 = c1 - a1 ;
......
......@@ -356,13 +356,14 @@ void Agent::updateObstacleNeighbors()
if ((obstacleNeighbors_.size() < maxMovingObstacles_|| distSq < maxDistObst)
&& distSq < rangeSq_)
{
if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
// if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
{
if (distSq > maxDistObst)
maxDistObst = distSq ;
obstacleNeighbors_.push_back(std::make_pair(distSq, *it)) ;
}
}
......@@ -381,7 +382,7 @@ void Agent::updateObstacleNeighbors()
if (distSq > maxDistMovingObst)
maxDistMovingObst = distSq ;
movingObstacleNeighbors_.push_back(std::make_pair(distSq, *it)) ;
// CGoGNout<<" agent "<<this->agentNo<< " detected a MO near"<<CGoGNendl;
}
}
......@@ -397,7 +398,7 @@ void Agent::updateObstacleNeighbors()
if ((obstacleNeighbors_.size() < maxNeighbors_ || distSq < maxDistObst)
&&distSq < rangeSq_)
{
if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
// if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
{
if (distSq > maxDistObst) maxDistObst = distSq ;
......@@ -418,7 +419,7 @@ void Agent::updateObstacleNeighbors()
if (distSq > maxDistMovingObst) maxDistMovingObst = distSq ;
movingObstacleNeighbors_.push_back(std::make_pair(distSq, *it)) ;
// CGoGNout<<" agent "<<this->agentNo<< " detected a MO neighbor"<<CGoGNendl;
}
}
......
......@@ -246,7 +246,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
//extrude face to build a cage
// compute edgeLength for mass-spring
hight=10.0f;
Algo::Surface::Modelisation::extrudeFace<PFP>(map, position, groundFace, -hight) ;
Algo::Surface::Modelisation::extrudeFace<PFP>(map, position, groundFace, hight) ;
// Dart dT = map.phi1(map.phi1(map.phi2(Dart(0))));
// std::cout << __FUNCTION__ << " val " << dT << std::endl;
// position[dT]= VEC3(0);
......@@ -877,7 +877,7 @@ void MovingObstacle::updateForces()
//stretch spring : /!\ max rigidity relative to the timestep used (unstable otherwise)
float norm = v1.norm();
float rigidity = 50.0f;
float rigidity = 100.0f;
float stretch = rigidity*(edgeLength[e]-norm);
if(norm>0.0f)
......
......@@ -880,6 +880,7 @@ void Simulator::addMovingObstacle(Dart d, unsigned int obstType)
// mm = new MovingMesh(envMap_, d, "./meshRessources/simpleCyl.obj");
movingMeshes_.push_back(mm);
vPos = mm->computeProjectedPointSet(maxHeight, d);
std::reverse(vPos.begin(),vPos.end());
#ifndef TWO_AND_HALF_DIM
//scale projected pointset
VEC3 bary(0);
......
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