From: Simon Cross Date: Thu, 8 Sep 2016 22:23:55 +0000 (+0200) Subject: Fix check for segment query result. X-Git-Tag: tabakrolletjie-v1.0.0~173 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=62f4888ea9c939c31c0e9d22f90e0b665e44fb5a;p=tabakrolletjie.git Fix check for segment query result. --- diff --git a/tabakrolletjie/rays.py b/tabakrolletjie/rays.py index cac7c3b..f4c5ed1 100644 --- a/tabakrolletjie/rays.py +++ b/tabakrolletjie/rays.py @@ -135,19 +135,19 @@ class RayPoly(object): return trial # no limits start_info = trial.segment_query( - self.position + 0.1 * start, self.position + 1250 * start, 1) + self.position + 0.1 * start, self.position + 1250 * start, 0) end_info = trial.segment_query( - self.position + 0.1 * end, self.position + 1250 * end, 1) + self.position + 0.1 * end, self.position + 1250 * end, 0) vertices = self.vertices[:] - if start_info: - vertices.append(start_info.point) - if end_info: - vertices.append(end_info.point) vertices = [ v for v in vertices if self._between((v - self.position).angle, start.angle, end.angle) ] + if start_info.shape is not None: + vertices.append(start_info.point) + if end_info.shape is not None: + vertices.append(end_info.point) vertices.append(self.position) poly = pymunk.Poly(None, vertices)