Module KX_Light

Source Code for Module KX_Light

 1  # $Id: KX_Light.py 2638 2004-06-07 11:01:31Z kester $ 
 2  # Documentation for Light game objects. 
 3  from KX_GameObject import * 
 4   
5 -class KX_Light(KX_GameObject):
6 """ 7 A Light object. 8 9 Example: 10 11 # Turn on a red alert light. 12 import GameLogic 13 14 co = GameLogic.getCurrentController() 15 light = co.getOwner() 16 17 light.energy = 1.0 18 light.colour = [1.0, 0.0, 0.0] 19 20 @group Constants: NORMAL, SPOT, SUN 21 @ivar SPOT: A spot light source. See attribute 'type' 22 @ivar SUN: A point light source with no attenuation. See attribute 'type' 23 @ivar NORMAL: A point light source. See attribute 'type' 24 25 @ivar type: The type of light - must be SPOT, SUN or NORMAL 26 @ivar layer: The layer mask that this light affects object on. 27 @type layer: bitfield 28 @ivar energy: The brightness of this light. 29 @type energy: float 30 @ivar distance: The maximum distance this light can illuminate. (SPOT and NORMAL lights only) 31 @type distance: float 32 @ivar colour: The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0] 33 @type colour: list [r, g, b] 34 @ivar color: Synonym for colour. 35 @ivar lin_attenuation: The linear component of this light's attenuation. (SPOT and NORMAL lights only) 36 @type lin_attenuation: float 37 @ivar quad_attenuation: The quadratic component of this light's attenuation (SPOT and NORMAL lights only) 38 @type quad_attenuation: float 39 @ivar spotsize: The cone angle of the spot light, in degrees. (float) (SPOT lights only) 40 0.0 <= spotsize <= 180.0. Spotsize = 360.0 is also accepted. 41 @ivar spotblend: Specifies the intensity distribution of the spot light. (float) (SPOT lights only) 42 Higher values result in a more focused light source. 43 0.0 <= spotblend <= 1.0. 44 45 """
46