Cafu Engine
Cafu Engine Scripting
The open-source game engine and graphics engine for multiplayer, cross-platform, real-time 3D action
EntPointLightSourceT Class Reference

This entity represents a dynamic light source. More...

Inheritance diagram for EntPointLightSourceT:

Public Member Functions

dr dg db sr sg sb GetColor ()
 Returns both the diffuse and the specular color of this light source as a 6-tuple. More...
 
 SetColor (number r, number g, number b)
 Sets the color (both diffuse and specular) of this light source. More...
 
 SetColor (number dr, number dg, number db, number sr, number sg, number sb)
 Sets the color (diffuse and specular separately) of this light source. More...
 
number GetRadius ()
 Returns the radius of this light source. More...
 
 SetRadius (number r)
 Sets the radius of this light source. More...
 
- Public Member Functions inherited from BaseEntityT
string GetName ()
 Returns the name of this entity. More...
 
x y z GetOrigin ()
 Returns the origin of this entity as a triple of numbers. More...
 
 SetOrigin (number x, number y, number z)
 Sets a new position for this entity. More...
 

Detailed Description

This entity represents a dynamic light source.

Dynamic light sources cast dynamic, per-pixel computed light. Its shading details and shadows are updated with each rendered frame.

EntPointLightSourceT entities are easy to use, but note that too many of them with a too large radius in a single scene can negatively affect the rendering performance.

See http://www.cafu.de/wiki/mapping:cawe:lighting for more details about the available kinds of light sources and their characteristics.

Map Editor Name:
PointLightSource
Implementing C++ Class:
DeathMatch::EntPointLightSourceT

Member Function Documentation

dr dg db sr sg sb GetColor ( )

Returns both the diffuse and the specular color of this light source as a 6-tuple.

local dr, dg, db, sr, sg, sb = DynLight:GetColor()
Returns
The diffuse and the specular color of this light source as a 6-tuple.
number GetRadius ( )

Returns the radius of this light source.

The radius determines the distance from the light source origin at which the light intensity has dropped to zero.

local r = DynLight:GetRadius()
SetColor ( number  r,
number  g,
number  b 
)

Sets the color (both diffuse and specular) of this light source.

The parameters r, g and b are numbers between 0 (no contribution) and 255 (max. contribution) for the respective color component.

Parameters
rThe red component of the light color.
gThe green component of the light color.
bThe blue component of the light color.
SetColor ( number  dr,
number  dg,
number  db,
number  sr,
number  sg,
number  sb 
)

Sets the color (diffuse and specular separately) of this light source.

The parameters are numbers between 0 (no contribution) and 255 (max. contribution) for the respective color component.

Parameters
drThe red component of the diffuse light color.
dgThe green component of the diffuse light color.
dbThe blue component of the diffuse light color.
srThe red component of the specular light color.
sgThe green component of the specular light color.
sbThe blue component of the specular light color.
SetRadius ( number  r)

Sets the radius of this light source.