Commit 83977d03 authored by Arash HABIBI's avatar Arash HABIBI
Browse files

comment

parent c46f1aac
......@@ -132,8 +132,6 @@ public:
int index_parent;
float gravity_dist; /// distance entre le centre du MO et son sommet le plus éloigné
VertexAttribute<NoMathIONameAttribute<std::vector<PFP::REAL> > > mvc_;
std::vector<std::pair<float, Obstacle*> > obstacleNeighbors_ ;
std::vector<std::pair<float, Obstacle*> > movingObstacleNeighbors_;
};
#endif
......@@ -1413,7 +1413,7 @@ void EnvMap::resetAgentInFace(Agent* agent)
{
VEC3 pos = agent->part_.getPosition() ;
agent->part_.ParticleBase<PFP>::move(Algo::Surface::Geometry::faceCentroid<PFP>(map, agent->part_.d, position)) ;
agent->part_.CGoGN::Algo::MovingObjects::ParticleBase<PFP>::move(Algo::Surface::Geometry::faceCentroid<PFP>(map, agent->part_.d, position)) ;
agent->part_.setState(FACE) ;
agent->part_.move(pos) ;
}
......
......@@ -673,6 +673,17 @@ void MovingObstacle::update()
{
cm.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_radius_infl;
if(sim_->config==0)
obst_radius_infl = 100.; // scenario 0
else
obst_radius_infl = 40.; // scenario 1 et 3
float force_value;
VEC3 p = position[dd]+(velocity[dd] * sim_->timeStep_);
for(std::vector<std::pair<float, Obstacle*> >::iterator it = movingObstacleNeighbors_.begin() ;
......@@ -689,7 +700,7 @@ void MovingObstacle::update()
double sum_of_dists = d1+d2;
if(sum_of_dists < rest_sum_of_dists)
{
collision_softening_factor = pow(1-sum_of_dists/rest_sum_of_dists,obst_power);
double collision_softening_factor = pow(1-sum_of_dists/rest_sum_of_dists,obst_power);
force_value = obst_stiffness*collision_softening_factor*(rest_sum_of_dists - sum_of_dists);
VEC3 v_obst = p2 - p1;
VEC3 normal = VEC3(v_obst[1],-v_obst[0],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