aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Fabre-Monplaisir <jean-isaac-fm@live.fr>2015-02-02 01:51:17 +0100
committerJean Fabre-Monplaisir <jean-isaac-fm@live.fr>2015-02-02 01:51:17 +0100
commit3824e47b6b6274b614cfd63098f506ccd356b25a (patch)
tree35d9d689a87c86677f4367031bcadd72ef5aacf1
parent582e13dcafe9a33c8d04b469bb7efafc0f6b7687 (diff)
downloadRobotique-Projet-3824e47b6b6274b614cfd63098f506ccd356b25a.tar.gz
Robotique-Projet-3824e47b6b6274b614cfd63098f506ccd356b25a.zip
line collisions
-rw-r--r--problem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/problem.cpp b/problem.cpp
index a4c6aca..985ff26 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;
}