Module KX_Light :: Class KX_Light
[frames | no frames]

Class KX_Light

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]
Method Summary
    Inherited from KX_GameObject
  applyImpulse(point, impulse)
Applies an impulse to the game object.
  disableRigidBody()
Disables rigid body physics for this object.
  enableRigidBody()
Enables rigid body physics for this object.
float getDistanceTo(other)
Returns the distance to another object or point.
list [vx, vy, vz] getLinearVelocity()
Gets the game object's linear velocity.
float getMass()
Gets the game object's mass.
KX_MeshProxy getMesh(mesh)
Gets the mesh object for this object.
3x3 rotation matrix getOrientation()
Gets the game object's orientation.
KX_GameObject getParent()
Gets this object's parent.
  getPhysicsId()
Returns the user data object associated with this game object's physics controller.
list [x, y, z] getPosition()
Gets the game object's position.
list [fx, fy, fz] getReactionForce()
Gets the game object's reaction force.
list [vx, vy, vz] getVelocity(point)
Gets the game object's velocity at the specified point.
  restoreDynamics()
Resumes physics for this object.
  setOrientation(orn)
Sets the game object's orientation.
  setPosition(pos)
Sets the game object's position.
  setVisible(visible)
Sets the game object's visible flag.
  suspendDynamics()
Suspends physics for this object.

Instance Variable Summary
  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
    Constants
  NORMAL: A point light source.
  SPOT: A spot light source.
  SUN: A point light source with no attenuation.
    Inherited from KX_GameObject
float mass: The object's mass (provided the object has a physics controller).
string. name: The object's name.
3x3 Matrix [[float]] orientation: The object's orientation.
KX_GameObject parent: The object's parent object.
list [x, y, z] position: The object's position.
list [sx, sy, sz] scaling: The object's scaling factor.
boolean visible: visibility flag.

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'

color

Synonym for colour.

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

energy

The brightness of this light.
Type:
float

layer

The layer mask that this light affects object on.
Type:
bitfield

lin_attenuation

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

quad_attenuation

The quadratic 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.

type

The type of light - must be SPOT, SUN or NORMAL

Generated by Epydoc 2.1 on Thu Feb 1 00:12:33 2007 http://epydoc.sf.net