From 62f4888ea9c939c31c0e9d22f90e0b665e44fb5a Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Fri, 9 Sep 2016 00:23:55 +0200 Subject: [PATCH] Fix check for segment query result. --- tabakrolletjie/rays.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) -- 2.34.1