In file include/csengine/light.h:

## class csDynLight : public csLight

> Class for a dynamic light

## Inheritance:

### Public Methods

void AddLightedSprite(csLightHitsSprite* lp)
  Add a light-hits-sprite to the list
void AddLightpatch(csLightPatch* lp)
  Add a light patch to the light patch list
csDynLight(float x, float y, float z, float dist, float red, float green, float blue)
  Create a new dynamic light at the given position and with the given radius and color
csDynLight* GetNext()
csDynLight* GetPrev()
void Move(csSector* sector, float x, float y, float z)
  Move the light
void Move(csSector* sector, csVector3& v)
  Move the light
void Resize(float radius)
  Resize the light
void SetNext(csDynLight* n)
void SetPrev(csDynLight* p)
void Setup()
  Initial placement of the light
void UnlinkLightedSprite(csLightHitsSprite* lp)
  Unlink a light-hits-sprite from the list
void UnlinkLightpatch(csLightPatch* lp)
  Unlink a light patch from the light patch list
virtual ~csDynLight()
  Remove the dynamic light from all polygons (i

### Private Fields

csLightHitsSprite* lightedsprites
  List of light-hits-sprite structures for this dynamic light.
csLightPatch* lightpatches
  List of light patches for this dynamic light.

### Inherited from csLight:

### Public Fields

static int ambient_blue
static int ambient_green
static int ambient_red
static int ambient_white

### Public Methods

void AddReference()
bool CheckFlags(ULong to_check)
static void CorrectForNocolor(float* rp, float* gp, float* bp)
static void CorrectForNocolor(unsigned char* rp, unsigned char* gp, unsigned char* bp)
csVector3& GetCenter()
csColor& GetColor()
ULong GetFlags()
bool GetHaloInQueue()
float GetHaloIntensity()
float GetHaloMaxIntensity()
float GetRadius()
int GetReferenceCount()
csSector* GetSector()
float GetSquaredRadius()
void RemoveReference()
virtual void SetColor(const csColor& col)
void SetFlags(ULong mask, ULong value)
void SetHaloInQueue(bool bNew)
void SetHaloIntensity(float newI)
virtual void SetSector(csSector* sector)

### Protected Fields

csVector3 center
csColor color
float dist
ULong flags
float halo_intensity
float halo_max_intensity
int halo_ref_count
bool in_halo_queue
csSector* sector
float sqdist

### Inherited from csObject:

### Public Methods

CS_ID GetID()
csObject* GetObj(const csIdType& objtype)
virtual csObject* GetObjectParent()
void ObjAdd(csObject* obj)
csObjIterator ObjGet(const csIdType& objtype)
void ObjRelease(csObject* obj)
void ObjRemove(csObject* obj)

### Private Fields

CS_ID csid_value
csObjTree* objtree

### Private Methods

virtual void SetObjectParent(csObject* parent)

### Inherited from csBase:

## Documentation

> Class for a dynamic light. These lights only cast shadows for sectors/portals and not for things. However, they can freely move and change color intensity.

`csLightPatch* lightpatches`
  List of light patches for this dynamic light.

`csLightHitsSprite* lightedsprites`
  List of light-hits-sprite structures for this dynamic light.

`csDynLight(float x, float y, float z, float dist, float red, float green, float blue)`
  Create a new dynamic light at the given position and with the given radius and color. Initially the light will not be visible. You need to set the current sector and call 'Setup()' first.

`virtual ~csDynLight()`
  Remove the dynamic light from all polygons (i.e. remove all light patches) and then destroy the light itself.

`void Setup()`
  Initial placement of the light. This routine generates a view frustrum as seen from the light. The clipped polygons that result from this are light patches and are put in the lightpatches list. This routine needs to be called whenever the light moves.

`void Move(csSector* sector, csVector3& v)`
  Move the light. This will NOT automatically recalculate the view frustrum. You still need to call Setup() after this.

`void Move(csSector* sector, float x, float y, float z)`
  Move the light. This will NOT automatically recalculate the view frustrum. You still need to call Setup() after this.

`void Resize(float radius)`
  Resize the light. This will NOT automatically recalculate the view frustrum. You still need to call Setup() after this.

`void UnlinkLightpatch(csLightPatch* lp)`
  Unlink a light patch from the light patch list. Warning! This function does not test if the light patch is really on the list!

`void AddLightpatch(csLightPatch* lp)`
  Add a light patch to the light patch list

`void UnlinkLightedSprite(csLightHitsSprite* lp)`
  Unlink a light-hits-sprite from the list. Warning! This function does not test if the structure is really on the list!

`void AddLightedSprite(csLightHitsSprite* lp)`
  Add a light-hits-sprite to the list

`void SetNext(csDynLight* n)`

`void SetPrev(csDynLight* p)`

`csDynLight* GetNext()`

`csDynLight* GetPrev()`

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de