From 90e51593dd298284cc9a599cb475e0f1127e4564 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sun, 4 Sep 2016 23:19:24 +0200 Subject: [PATCH] Keep number of vertices low during ray tracing. --- tabakrolletjie/lights.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tabakrolletjie/lights.py b/tabakrolletjie/lights.py index ece9c4e..ecb6ced 100644 --- a/tabakrolletjie/lights.py +++ b/tabakrolletjie/lights.py @@ -50,6 +50,8 @@ def calculate_ray_polys(space, body, position): new_poly = pymunk.Poly(body, vertices[:-1]) vertices = [position, vertices[-1]] ray_polys.append(new_poly) + else: + vertices = trial_poly.get_vertices() + [point] if len(vertices) > 2: ray_polys.append(pymunk.Poly(body, vertices)) end_time = time.time() -- 2.34.1