aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-02 00:51:58 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-02 00:51:58 +0100
commit2a0f0f2fcde7ee267e1cfb01938bfd6a8f6e5095 (patch)
treef7370ea0e27e7d34e4464459abfa3ba084bfc79a
parent837dc3e832b44e7ce74b212c239c99acf3fcf9a2 (diff)
parent0275479b6a8c8cb7664ee840cd8428ddd7ab3073 (diff)
downloadRobotique-Projet-2a0f0f2fcde7ee267e1cfb01938bfd6a8f6e5095.tar.gz
Robotique-Projet-2a0f0f2fcde7ee267e1cfb01938bfd6a8f6e5095.zip
Merge branch 'master' of https://github.com/Alexis211/Robotique
-rw-r--r--problem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/problem.cpp b/problem.cpp
index 1437729..e51aa95 100644
--- a/problem.cpp
+++ b/problem.cpp
@@ -28,6 +28,8 @@ bool hilare_a_mvt::intersects(const obstacle &o) const {
hilare_a_param *p = from.param;
vec pos_init = from.pos();
vec pos_init_trolley = from.pos_trolley();
+ if (from.intersects(o)) return true;
+ if (to.intersects(o)) return true;
if(is_arc){
double r_min =
min((pos_init - center).norm()-(p->r_c_car),
@@ -61,8 +63,7 @@ bool hilare_a_mvt::intersects(const obstacle &o) const {
theta2 = canon_angle(theta1,theta2);
angular_sector sector = angular_sector(circarc(circle(center,r_min), theta1, theta2), circarc(circle(center,r_max), theta1, theta2));
if (sector.dist(o.c.c)<=o.c.r)return true;
- if (from.intersects(o)) return true;
- if (to.intersects(o)) return true;
+
return false;
}