Module KX_LightObject :: Class KX_LightObject

Class KX_LightObject

KX_GameObject.KX_GameObject --+
                              |
                             KX_LightObject

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
 
alignAxisToVect(vect, axis)
Aligns any of the game object's axis along the given vector. (Inherited from KX_GameObject.KX_GameObject)
 
applyForce(force, local=0)
Sets the game object's force. (Inherited from KX_GameObject.KX_GameObject)
 
applyImpulse(point, impulse)
Applies an impulse to the game object. (Inherited from KX_GameObject.KX_GameObject)
 
applyMovement(movement, local=0)
Sets the game object's movement. (Inherited from KX_GameObject.KX_GameObject)
 
applyRotation(rotation, local=0)
Sets the game object's rotation. (Inherited from KX_GameObject.KX_GameObject)
 
applyTorque(torque, local=0)
Sets the game object's torque. (Inherited from KX_GameObject.KX_GameObject)
 
disableRigidBody()
Disables rigid body physics for this object. (Inherited from KX_GameObject.KX_GameObject)
 
enableRigidBody()
Enables rigid body physics for this object. (Inherited from KX_GameObject.KX_GameObject)
 
endObject()
Delete this object, can be used inpace of the EndObject Actuator. (Inherited from KX_GameObject.KX_GameObject)
list [vx, vy, vz]
getAngularVelocity(local=0)
Gets the game object's angular velocity. (Inherited from KX_GameObject.KX_GameObject)
3d vector.
getAxisVect(vect)
Returns the axis vector rotates by the objects worldspace orientation. (Inherited from KX_GameObject.KX_GameObject)
CListValue of KX_GameObject
getChildren()
Return a list of immediate children of this object. (Inherited from KX_GameObject.KX_GameObject)
CListValue of KX_GameObject
getChildrenRecursive()
Return a list of children of this object, including all their childrens children. (Inherited from KX_GameObject.KX_GameObject)
float
getDistanceTo(other)
Returns the distance to another object or point. (Inherited from KX_GameObject.KX_GameObject)
list [vx, vy, vz]
getLinearVelocity(local=0)
Gets the game object's linear velocity. (Inherited from KX_GameObject.KX_GameObject)
float
getMass()
Gets the game object's mass. (Inherited from KX_GameObject.KX_GameObject)
KX_MeshProxy
getMesh(mesh)
Gets the mesh object for this object. (Inherited from KX_GameObject.KX_GameObject)
3x3 rotation matrix
getOrientation()
Gets the game object's orientation. (Inherited from KX_GameObject.KX_GameObject)
KX_GameObject
getParent()
Gets this object's parent. (Inherited from KX_GameObject.KX_GameObject)
 
getPhysicsId()
Returns the user data object associated with this game object's physics controller. (Inherited from KX_GameObject.KX_GameObject)
list [x, y, z]
getPosition()
Gets the game object's position. (Inherited from KX_GameObject.KX_GameObject)
list
getPropertyNames()
Gets a list of all property names. (Inherited from KX_GameObject.KX_GameObject)
list [fx, fy, fz]
getReactionForce()
Gets the game object's reaction force. (Inherited from KX_GameObject.KX_GameObject)
int
getState()
Gets the game object's state bitmask. (Inherited from KX_GameObject.KX_GameObject)
3-tuple (float, 3-tuple (x,y,z), 3-tuple (x,y,z))
getVectTo(other)
Returns the vector and the distance to another object or point. (Inherited from KX_GameObject.KX_GameObject)
list [vx, vy, vz]
getVelocity(point)
Gets the game object's velocity at the specified point. (Inherited from KX_GameObject.KX_GameObject)
boolean
getVisible()
Gets the game object's visible flag. (Inherited from KX_GameObject.KX_GameObject)
3-tuple (KX_GameObject, 3-tuple (x,y,z), 3-tuple (nx,ny,nz)) or 4-tuple (KX_GameObject, 3-tuple (x,y,z), 3-tuple (nx,ny,nz), KX_PolyProxy)
rayCast(objto, objfrom, dist, prop, face, xray, poly)
Look from a point/object to another point/object and find first object hit within dist that matches prop. (Inherited from KX_GameObject.KX_GameObject)
KX_GameObject
rayCastTo(other, dist, prop)
Look towards another point/object and find first object hit within dist that matches prop. (Inherited from KX_GameObject.KX_GameObject)
 
removeParent()
Removes this objects parent. (Inherited from KX_GameObject.KX_GameObject)
 
replaceMesh(mesh_name)
Replace the mesh of this object with a new mesh. (Inherited from KX_GameObject.KX_GameObject)
 
restoreDynamics()
Resumes physics for this object. (Inherited from KX_GameObject.KX_GameObject)
 
sendMessage(subject, body='', to='')
Sends a message. (Inherited from KX_GameObject.KX_GameObject)
 
setAngularVelocity(velocity, local=0)
Sets the game object's angular velocity. (Inherited from KX_GameObject.KX_GameObject)
 
setCollisionMargin(margin)
Set the objects collision margin. (Inherited from KX_GameObject.KX_GameObject)
 
setLinearVelocity(velocity, local=0)
Sets the game object's linear velocity. (Inherited from KX_GameObject.KX_GameObject)
 
setOcclusion(occlusion, recursive)
Sets the game object's occlusion capability. (Inherited from KX_GameObject.KX_GameObject)
 
setOrientation(orn)
Sets the game object's orientation. (Inherited from KX_GameObject.KX_GameObject)
 
setParent(parent)
Sets this object's parent. (Inherited from KX_GameObject.KX_GameObject)
 
setPosition(pos)
Sets the game object's position. (Inherited from KX_GameObject.KX_GameObject)
 
setState(state)
Sets the game object's state flag. (Inherited from KX_GameObject.KX_GameObject)
 
setVisible(visible, recursive)
Sets the game object's visible flag. (Inherited from KX_GameObject.KX_GameObject)
 
setWorldPosition(pos)
Sets the game object's position in world coordinates regardless if the object is root or child. (Inherited from KX_GameObject.KX_GameObject)
 
suspendDynamics()
Suspends physics for this object. (Inherited from KX_GameObject.KX_GameObject)
Instance Variables
list actuators
a list of SCA_IActuator objects. (Inherited from KX_GameObject.KX_GameObject)
  color
Synonym for colour.
list [r, g, b] colour
The colour of this light.
list of SCA_ISensor. controllers
a list of SCA_IController objects. (Inherited from KX_GameObject.KX_GameObject)
float distance
The maximum distance this light can illuminate.
float energy
The brightness of this light.
bool isValid
Retuerns fails when the object has been removed from the scene and can no longer be used. (Inherited from KX_GameObject.KX_GameObject)
bitfield layer
The layer mask that this light affects object on.
float linVelocityMax
Clamp the maximum linear velocity to prevent objects moving beyond a set speed. (Inherited from KX_GameObject.KX_GameObject)
float linVelocityMin
Enforces the object keeps moving at a minimum velocity. (Inherited from KX_GameObject.KX_GameObject)
float lin_attenuation
The linear component of this light's attenuation.
list [ix, iy, iz] localInertia
the object's inertia vector in local coordinates. (Inherited from KX_GameObject.KX_GameObject)
3x3 Matrix [[float]] localOrientation
The object's local orientation. (Inherited from KX_GameObject.KX_GameObject)
list [x, y, z] localPosition
The object's local position. (Inherited from KX_GameObject.KX_GameObject)
list [sx, sy, sz] localScaling
The object's local scaling factor. (Inherited from KX_GameObject.KX_GameObject)
float mass
The object's mass (Inherited from KX_GameObject.KX_GameObject)
list of KX_MeshProxy meshes
a list meshes for this object. (Inherited from KX_GameObject.KX_GameObject)
string. name
The object's name. (Inherited from KX_GameObject.KX_GameObject)
boolean occlusion
occlusion capability flag. (Inherited from KX_GameObject.KX_GameObject)
3x3 Matrix [[float]] On write: local orientation, on read: world orientation orientation
The object's orientation. (Inherited from KX_GameObject.KX_GameObject)
KX_GameObject or None parent
The object's parent object. (Inherited from KX_GameObject.KX_GameObject)
list [x, y, z] On write: local position, on read: world position position
The object's position. (Inherited from KX_GameObject.KX_GameObject)
float quad_attenuation
The quadratic component of this light's attenuation (SPOT and NORMAL lights only)
list [sx, sy, sz] On write: local scaling, on read: world scaling scaling
The object's scaling factor. (Inherited from KX_GameObject.KX_GameObject)
list sensors
a list of SCA_ISensor objects. (Inherited from KX_GameObject.KX_GameObject)
  spotblend
Specifies the intensity distribution of the spot light.
  spotsize
The cone angle of the spot light, in degrees.
int state
the game object's state bitmask, using the first 30 bits, one bit must always be set. (Inherited from KX_GameObject.KX_GameObject)
float timeOffset
adjust the slowparent delay at runtime. (Inherited from KX_GameObject.KX_GameObject)
  type
The type of light - must be SPOT, SUN or NORMAL
boolean visible
visibility flag. (Inherited from KX_GameObject.KX_GameObject)
3x3 Matrix [[float]] worldOrientation
The object's world orientation. (Inherited from KX_GameObject.KX_GameObject)
list [x, y, z] worldPosition
The object's world position. (Inherited from KX_GameObject.KX_GameObject)
list [sx, sy, sz] worldScaling
The object's world scaling factor. (Inherited from KX_GameObject.KX_GameObject)
    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.