Module KX_Light :: Class KX_Light

Class KX_Light

source code

KX_GameObject.KX_GameObject --+
                              |
                             KX_Light

A Light object.

Example:

# Turn on a red alert light. import GameLogic

co = GameLogic.getCurrentController() light = co.getOwner()

light.energy = 1.0 light.colour = [1.0, 0.0, 0.0]

Instance Methods

Inherited from KX_GameObject.KX_GameObject: applyImpulse, disableRigidBody, enableRigidBody, getDistanceTo, getLinearVelocity, getMass, getMesh, getOrientation, getParent, getPhysicsId, getPosition, getReactionForce, getVelocity, rayCastTo, removeParent, restoreDynamics, setOrientation, setParent, setPosition, setVisible, suspendDynamics

Instance Variables
  color
Synonym for colour.
list [r, g, b] colour
The colour of this light.
float distance
The maximum distance this light can illuminate.
float energy
The brightness of this light.
bitfield layer
The layer mask that this light affects object on.
float lin_attenuation
The linear component of this light's attenuation.
float quad_attenuation
The quadratic component of this light's attenuation (SPOT and NORMAL lights only)
  spotblend
Specifies the intensity distribution of the spot light.
  spotsize
The cone angle of the spot light, in degrees.
  type
The type of light - must be SPOT, SUN or NORMAL

Inherited from KX_GameObject.KX_GameObject: mass, name, orientation, parent, position, scaling, visible

    Constants
  NORMAL
A point light source.
  SPOT
A spot light source.
  SUN
A point light source with no attenuation.
Instance Variable Details

NORMAL

A point light source. See attribute 'type'

SPOT

A spot light source. See attribute 'type'

SUN

A point light source with no attenuation. See attribute 'type'

colour

The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0]
Type:
list [r, g, b]

distance

The maximum distance this light can illuminate. (SPOT and NORMAL lights only)
Type:
float

lin_attenuation

The linear component of this light's attenuation. (SPOT and NORMAL lights only)
Type:
float

spotblend

Specifies the intensity distribution of the spot light. (float) (SPOT lights only) Higher values result in a more focused light source. 0.0 <= spotblend <= 1.0.

spotsize

The cone angle of the spot light, in degrees. (float) (SPOT lights only) 0.0 <= spotsize <= 180.0. Spotsize = 360.0 is also accepted.