From 3824e47b6b6274b614cfd63098f506ccd356b25a Mon Sep 17 00:00:00 2001 From: Jean Fabre-Monplaisir Date: Mon, 2 Feb 2015 01:51:17 +0100 Subject: line collisions --- problem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'problem.cpp') 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; } -- cgit v1.2.3