From: Simon Cross Date: Sun, 4 Sep 2016 21:19:24 +0000 (+0200) Subject: Keep number of vertices low during ray tracing. X-Git-Tag: tabakrolletjie-v1.0.0~242 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=90e51593dd298284cc9a599cb475e0f1127e4564;p=tabakrolletjie.git Keep number of vertices low during ray tracing. --- 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()