Module GameTypes :: Class KX_LightObject
[frames] | no frames]

Class KX_LightObject

PyObjectPlus --+            
               |            
          CValue --+        
                   |        
         SCA_IObject --+    
                       |    
           KX_GameObject --+
                           |
                          KX_LightObject

A Light object.

Example:

# Turn on a red alert light. import GameLogic

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

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

Instance Methods
 
alignAxisToVect(vect, axis, factor)
Aligns any of the game object's axis along the given vector. (Inherited from GameTypes.KX_GameObject)
 
applyForce(force, local=0)
Sets the game object's force. (Inherited from GameTypes.KX_GameObject)
 
applyImpulse(point, impulse)
Applies an impulse to the game object. (Inherited from GameTypes.KX_GameObject)
 
applyMovement(movement, local=0)
Sets the game object's movement. (Inherited from GameTypes.KX_GameObject)
 
applyRotation(rotation, local=0)
Sets the game object's rotation. (Inherited from GameTypes.KX_GameObject)
 
applyTorque(torque, local=0)
Sets the game object's torque. (Inherited from GameTypes.KX_GameObject)
 
disableRigidBody()
Disables rigid body physics for this object. (Inherited from GameTypes.KX_GameObject)
 
enableRigidBody()
Enables rigid body physics for this object. (Inherited from GameTypes.KX_GameObject)
 
endObject()
Delete this object, can be used inpace of the EndObject Actuator. (Inherited from GameTypes.KX_GameObject)
list [vx, vy, vz]
getAngularVelocity(local=0)
Gets the game object's angular velocity. (Inherited from GameTypes.KX_GameObject)
3d vector.
getAxisVect(vect)
Returns the axis vector rotates by the objects worldspace orientation. (Inherited from GameTypes.KX_GameObject)
float
getDistanceTo(other)
Returns the distance to another object or point. (Inherited from GameTypes.KX_GameObject)
list [vx, vy, vz]
getLinearVelocity(local=0)
Gets the game object's linear velocity. (Inherited from GameTypes.KX_GameObject)
 
getPhysicsId()
Returns the user data object associated with this game object's physics controller. (Inherited from GameTypes.KX_GameObject)
list [fx, fy, fz]
getReactionForce()
Gets the game object's reaction force. (Inherited from GameTypes.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 GameTypes.KX_GameObject)
list [vx, vy, vz]
getVelocity(point)
Gets the game object's velocity at the specified point. (Inherited from GameTypes.KX_GameObject)
bool
isA(game_type)
Check if this is a type or a subtype game_type. (Inherited from GameTypes.PyObjectPlus)
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 GameTypes.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 GameTypes.KX_GameObject)
boolean
reinstancePhysicsMesh(gameObject, meshObject)
Updates the physics system with the changed mesh. (Inherited from GameTypes.KX_GameObject)
 
removeParent()
Removes this objects parent. (Inherited from GameTypes.KX_GameObject)
 
replaceMesh(mesh, useDisplayMesh=True, usePhysicsMesh=False)
Replace the mesh of this object with a new mesh. (Inherited from GameTypes.KX_GameObject)
 
restoreDynamics()
Resumes physics for this object. (Inherited from GameTypes.KX_GameObject)
 
sendMessage(subject, body='', to='')
Sends a message. (Inherited from GameTypes.KX_GameObject)
 
setAngularVelocity(velocity, local=0)
Sets the game object's angular velocity. (Inherited from GameTypes.KX_GameObject)
 
setCollisionMargin(margin)
Set the objects collision margin. (Inherited from GameTypes.KX_GameObject)
 
setLinearVelocity(velocity, local=0)
Sets the game object's linear velocity. (Inherited from GameTypes.KX_GameObject)
 
setOcclusion(occlusion, recursive)
Sets the game object's occlusion capability. (Inherited from GameTypes.KX_GameObject)
 
setParent(parent, compound, ghost)
Sets this object's parent. (Inherited from GameTypes.KX_GameObject)
 
setVisible(visible, recursive)
Sets the game object's visible flag. (Inherited from GameTypes.KX_GameObject)
 
suspendDynamics()
Suspends physics for this object. (Inherited from GameTypes.KX_GameObject)
    Deprecated
CListValue of KX_GameObject
getChildren()
Return a list of immediate children of this object. (Inherited from GameTypes.KX_GameObject)
CListValue of KX_GameObject
getChildrenRecursive()
Return a list of children of this object, including all their childrens children. (Inherited from GameTypes.KX_GameObject)
float
getMass()
Gets the game object's mass. (Inherited from GameTypes.KX_GameObject)
KX_MeshProxy
getMesh(mesh)
Gets the mesh object for this object. (Inherited from GameTypes.KX_GameObject)
string
getName()
Returns the name of the CValue. (Inherited from GameTypes.CValue)
3x3 rotation matrix
getOrientation()
Gets the game object's orientation. (Inherited from GameTypes.KX_GameObject)
KX_GameObject
getParent()
Gets this object's parent. (Inherited from GameTypes.KX_GameObject)
list [x, y, z]
getPosition()
Gets the game object's position. (Inherited from GameTypes.KX_GameObject)
int
getState()
Gets the game object's state bitmask. (Inherited from GameTypes.KX_GameObject)
boolean
getVisible()
Gets the game object's visible flag. (Inherited from GameTypes.KX_GameObject)
 
setOrientation(orn)
Sets the game object's orientation. (Inherited from GameTypes.KX_GameObject)
 
setPosition(pos)
Sets the game object's position. (Inherited from GameTypes.KX_GameObject)
 
setState(state)
Sets the game object's state flag. (Inherited from GameTypes.KX_GameObject)
 
setWorldPosition(pos)
Sets the game object's position in world coordinates regardless if the object is root or child. (Inherited from GameTypes.KX_GameObject)
    Property Access
 
get(key, default=None)
Return the value matching key, or the default value if its not found. (Inherited from GameTypes.KX_GameObject)
list
getPropertyNames()
Gets a list of all property names. (Inherited from GameTypes.KX_GameObject)
boolean
has_key(key)
Return True if the key is found. (Inherited from GameTypes.KX_GameObject)
Instance Variables
list actuators
a list of SCA_IActuator with string/index lookups and iterator support. (Inherited from GameTypes.KX_GameObject)
CListValue of KX_GameObject's children
direct children of this object, (read-only). (Inherited from GameTypes.KX_GameObject)
CListValue of KX_GameObject's childrenRecursive
all children of this object including childrens children, (read-only). (Inherited from GameTypes.KX_GameObject)
  color
Synonym for colour.
list [r, g, b] colour
The colour of this light.
list of SCA_ISensor. controllers
a sequence of SCA_IController objects with string/index lookups and iterator support. (Inherited from GameTypes.KX_GameObject)
float distance
The maximum distance this light can illuminate.
float energy
The brightness of this light.
bool invalid
Test if the object has been freed by the game engine and is no longer valid. (Inherited from GameTypes.PyObjectPlus)
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 GameTypes.KX_GameObject)
float linVelocityMin
Enforces the object keeps moving at a minimum velocity. (Inherited from GameTypes.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 GameTypes.KX_GameObject)
3x3 Matrix [[float]] localOrientation
The object's local orientation. (Inherited from GameTypes.KX_GameObject)
list [x, y, z] localPosition
The object's local position. (Inherited from GameTypes.KX_GameObject)
list [sx, sy, sz] localScale
The object's local scaling factor. (Inherited from GameTypes.KX_GameObject)
float mass
The object's mass (Inherited from GameTypes.KX_GameObject)
list of KX_MeshProxy meshes
a list meshes for this object. (Inherited from GameTypes.KX_GameObject)
string name
The name of this CValue derived object (read-only). (Inherited from GameTypes.KX_GameObject)
boolean occlusion
occlusion capability flag. (Inherited from GameTypes.KX_GameObject)
3x3 Matrix [[float]] On write: local orientation, on read: world orientation orientation
The object's orientation. (Inherited from GameTypes.KX_GameObject)
KX_GameObject or None parent
The object's parent object. (Inherited from GameTypes.KX_GameObject)
list [x, y, z] On write: local position, on read: world position position
The object's position. (Inherited from GameTypes.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 GameTypes.KX_GameObject)
list sensors
a sequence of SCA_ISensor objects with string/index lookups and iterator support. (Inherited from GameTypes.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 GameTypes.KX_GameObject)
float timeOffset
adjust the slowparent delay at runtime. (Inherited from GameTypes.KX_GameObject)
  type
The type of light - must be SPOT, SUN or NORMAL
boolean visible
visibility flag. (Inherited from GameTypes.KX_GameObject)
3x3 Matrix [[float]] worldOrientation
The object's world orientation. (Inherited from GameTypes.KX_GameObject)
list [x, y, z] worldPosition
The object's world position. (Inherited from GameTypes.KX_GameObject)
list [sx, sy, sz] worldScale
The object's world scaling factor. (Inherited from GameTypes.KX_GameObject)
    Constants
  NORMAL
A point light source.
  SPOT
A spot light source.
  SUN
A point light source with no attenuation.
    Property Access
dict attrDict
get the objects internal python attribute dictionary for direct (faster) access. (Inherited from GameTypes.KX_GameObject)
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.