In file include/csengine/light.h:

## class csLight : public csObject

> Superclass of all positional lights

## Inheritance:

### Public Fields

  static int | ambient_blue Config value: ambient blue value.
  static int | ambient_green Config value: ambient green value.
  static int | ambient_red Config value: ambient red value.
  static int | ambient_white Config value: ambient white value.

### Public Methods

  void | AddReference () Add a reference to the halo
  bool | CheckFlags (ULong to_check) Check if all the given flags are set.
  static void | CorrectForNocolor (unsigned char* rp, unsigned char* gp, unsigned char* bp) Change the given r, g, b value to the current mixing mode (TRUE_RGB or NOCOLOR)
  static void | CorrectForNocolor (float* rp, float* gp, float* bp) Change the given r, g, b value to the current mixing mode (TRUE_RGB or NOCOLOR)
  | csLight (float x, float y, float z, float dist, float red, float green, float blue) Construct a light at a given position
  csVector3& | GetCenter () Get the center position
  csColor& | GetColor () Get the light color
  ULong | GetFlags () Get flags.
  bool | GetHaloInQueue () Query if the halo is in the queue
  float | GetHaloIntensity () Get the intensity of the halo
  float | GetHaloMaxIntensity () Return the maximum intensity of the halo
  float | GetRadius () Get the radius
  int | GetReferenceCount () Return the reference count
  csSector* | GetSector () Get the current sector for this light
  float | GetSquaredRadius () Get the squared radius
  void | RemoveReference () Remove a reference to the halo
  virtual void | SetColor (const csColor& col) Set the light color
  void | SetFlags (ULong mask, ULong value) Set all flags with the given mask.
  void | SetHaloInQueue (bool bNew) Set whether or not the halo is in the queue
  void | SetHaloIntensity (float newI) Set the intensity of the halo
  virtual void | SetSector (csSector* sector) Set the current sector for this light
  virtual | ~csLight () Destroy the light

### Protected Fields

  csVector3 | center Position of the light.
  csColor | color Color.
  float | dist Radius of light.
  ULong | flags Set of flags
  float | halo_intensity the current intensity of the attached halo.
  float | halo_max_intensity the maximum intensity of the attached halo.
  int | halo_ref_count the reference count (for halo fading purposes).
  bool | in_halo_queue whether this light is in the halo queue or not.
  csSector* | sector Home sector of the light.
  float | sqdist Squared radius of light.

### 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)

## Documentation

> Superclass of all positional lights. A light subclassing from this has a color, a position and a radius.

> First some terminology about all the several types of lights that Crystal Space supports:

> - Static light. This is a normal static light that cannot move and cannot change intensity/color. All lighting information from all static lights is collected in one static lightmap.
> - Pseudo-dynamic light. This is a static light that still cannot move but the intensity/color can change. The shadow information from every pseudo-dynamic light is kept in a seperate shadow-map. Shadowing is very accurate with pseudo-dynamic lights since they use the same algorithm as static lights.
> - Dynamic light. This is a light that can move and change intensity/color. These lights are the most flexible. All lighting information from all dynamic lights is collected in one dynamic lightmap (seperate from the pseudo-dynamic shadow-maps). Shadows for dynamic lights will be less accurate because things will not cast accurate shadows (due to computation speed limitations).
> Note that static and pseudo-dynamic lights are represented by the same csStatLight class.

`csSector* sector`
  Home sector of the light.

`csVector3 center`
  Position of the light.

`float dist`
  Radius of light.

`float sqdist`
  Squared radius of light.

`csColor color`
  Color.

`float halo_intensity`
  the current intensity of the attached halo.

`float halo_max_intensity`
  the maximum intensity of the attached halo.

`int halo_ref_count`
  the reference count (for halo fading purposes).

`bool in_halo_queue`
  whether this light is in the halo queue or not.

`ULong flags`
  Set of flags

`static int ambient_red`
  Config value: ambient red value.

`static int ambient_green`
  Config value: ambient green value.

`static int ambient_blue`
  Config value: ambient blue value.

`static int ambient_white`
  Config value: ambient white value.

`csLight(float x, float y, float z, float dist, float red, float green, float blue)`
  Construct a light at a given position. With a given radius, a given color, a given name and type. The light will not have a halo by default.

`virtual ~csLight()`
  Destroy the light. Note that destroying a light may not have the expected effect. Static lights result in changes in the lightmaps. Removing them will not automatically update those lightmaps as that is a time-consuming process.

`void SetFlags(ULong mask, ULong value)`
  Set all flags with the given mask.

`ULong GetFlags()`
  Get flags.

`bool CheckFlags(ULong to_check)`
  Check if all the given flags are set.

`virtual void SetSector(csSector* sector)`
  Set the current sector for this light

`csSector* GetSector()`
  Get the current sector for this light

`csVector3& GetCenter()`
  Get the center position

`float GetRadius()`
  Get the radius

`float GetSquaredRadius()`
  Get the squared radius

`csColor& GetColor()`
  Get the light color

`virtual void SetColor(const csColor& col)`
  Set the light color. Note that setting the color of a light may not always have an immediate visible effect. Static lights are precalculated into the lightmaps and those lightmaps are not automatically updated when calling this function as that is a time consuming process.

`float GetHaloMaxIntensity()`
  Return the maximum intensity of the halo

`void SetHaloIntensity(float newI)`
  Set the intensity of the halo

`float GetHaloIntensity()`
  Get the intensity of the halo

`int GetReferenceCount()`
  Return the reference count. This counter keeps track of the number of times a halo is visible. If 0 the halo will slowly fade away.

`void AddReference()`
  Add a reference to the halo. As long as there are references to the halo it is visible.

`void RemoveReference()`
  Remove a reference to the halo. When all references are gone the halo will slowly fade away.

`void SetHaloInQueue(bool bNew)`
  Set whether or not the halo is in the queue

`bool GetHaloInQueue()`
  Query if the halo is in the queue

`static void CorrectForNocolor(unsigned char* rp, unsigned char* gp, unsigned char* bp)`
  Change the given r, g, b value to the current mixing mode (TRUE_RGB or NOCOLOR). In NOCOLOR mode this function will take the average of the three colors to return a grayscale value.

`static void CorrectForNocolor(float* rp, float* gp, float* bp)`
  Change the given r, g, b value to the current mixing mode (TRUE_RGB or NOCOLOR). In NOCOLOR mode this function will take the average of the three colors to return a grayscale value.

Direct child classes:
  csStatLight
  csDynLight

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