From: Simon Cross Date: Sat, 10 Sep 2016 20:07:14 +0000 (+0200) Subject: Lights want bounding foxes too. X-Git-Tag: tabakrolletjie-v1.0.0~44 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=99d0707ad3485b73b81f259859f470e64ce14443;p=tabakrolletjie.git Lights want bounding foxes too. --- diff --git a/tabakrolletjie/lights.py b/tabakrolletjie/lights.py index 498c0b0..747ce92 100644 --- a/tabakrolletjie/lights.py +++ b/tabakrolletjie/lights.py @@ -146,7 +146,8 @@ class BaseLight(object): def __init__( self, colours, position, intensity=1.0, radius_limits=None, - direction=None, spread=None, on=True, start_colour=None): + direction=None, spread=None, on=True, start_colour=None, + bounding_radius=None): self.colour_cycle = colours self.colour_pos = 0 self.colour = colours[0] @@ -161,7 +162,8 @@ class BaseLight(object): self.body.light = self self.ray_manager = self.RAY_MANAGER( self.body, position, ray_filter=LIGHT_FILTER, - radius_limits=radius_limits, direction=direction, spread=spread) + radius_limits=radius_limits, direction=direction, spread=spread, + bounding_radius=bounding_radius) self.fitting = pymunk.Circle( self.body, self.FITTING_RADIUS, self.ray_manager.position) self.fitting.filter = FITTINGS_FILTER @@ -320,7 +322,8 @@ class PulsatingLamp(BaseLight): "intensity_range", self.DEFAULT_INTENSITY_RANGE) self.intensity_velocity = kw.pop( "intensity_velocity", self.DEFAULT_INTENSITY_VELOCITY) - super(PulsatingLamp, self).__init__(**kw) + super(PulsatingLamp, self).__init__( + bounding_radius=self.pulse_range[1], **kw) def serialize(self): result = super(PulsatingLamp, self).serialize()