Commit 46ac6285 authored by pitiot's avatar pitiot

tri

parent fe0c285b
......@@ -16,6 +16,11 @@ float MovingObstacle::timeHorizonObst_ = 10.0f;
unsigned int MovingObstacle::maxNeighbors_ = 20;
float MovingObstacle::detectionFixedObst = 50;
/*addGeneralCell
* adds cell d to general belonging, if it's already present, increases the number of instance of the cell
*/
void MovingObstacle::addGeneralCell ( Dart d)
{
bool added = false;
......@@ -37,7 +42,9 @@ void MovingObstacle::addGeneralCell ( Dart d)
general_belonging.push_back(std::make_pair(d,1));
}
}
/*removeGeneralCell
* removes cell d to general belonging decreases the number of instance of the cell, if the number is 0 the celle is removed
*/
bool MovingObstacle::removeGeneralCell (Dart d)
{
std::vector< std::pair<Dart,int> >::iterator it =general_belonging.begin();
......@@ -58,6 +65,10 @@ bool MovingObstacle::removeGeneralCell (Dart d)
return false;
}
/*
* is_inside
* tests if the point p is inside the obstacle (normal test, works only for CONVEX obstacles)
*/
bool MovingObstacle::is_inside(VEC3 p)
......@@ -76,12 +87,16 @@ bool MovingObstacle::is_inside(VEC3 p)
vec2 = VEC3(p -p1);
if (vec*vec2 < 0)
return false;
}
return true;
}
/*
* get_angle
* pareil que Geom::getAngle ?
*/
float get_angle(VEC3 v1, VEC3 v2) //renvoie l'angle entre [- pi ; Pi] du v2 à v1
{
float flo = 0.0f;
......@@ -109,7 +124,13 @@ float get_angle(VEC3 v1, VEC3 v2) //renvoie l'angle entre [- pi ; Pi] du v2 à v
return flo;
}
VEC3 rotate2D(VEC3 pos1, VEC3 center, float angle) // renvoie le déplacement necessaire depuis pos1 pour effectuer la rotation centrée en center d'angle angle
/*
* rotate2D
* // renvoie le déplacement necessaire depuis pos1 pour effectuer la rotation centrée en center d'angle angle
* (moins compliqué que d'utiliser des matrices et la Geom::rotate ?)
*/
VEC3 rotate2D(VEC3 pos1, VEC3 center, float angle)
{
VEC3 pos2;
PFP::REAL x = pos1[0] - center[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