CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

csStatLight Class Reference

Class for a static light. More...

#include <light.h>

Inheritance diagram for csStatLight:

csLight csObject iObject iBase List of all members.

Public Methods

 csStatLight (float x, float y, float z, float dist, float red, float green, float blue, bool dynamic)
 Construct a static light at a given position. More...

virtual ~csStatLight ()
 Destroy the light. More...

virtual bool IsDynamic () const
 Return true if this light is pseudo-dynamic. More...

virtual void SetColor (const csColor &col)
 Set the light color. More...

void AddAffectedLightingInfo (iLightingInfo *li)
 Add affected mesh. More...

void CalculateLighting ()
 Shine this light on all polygons visible from the light. More...

void CalculateLighting (iMeshWrapper *mesh)
 Shine this light on all polygons of the mesh. More...


Public Attributes

csStatLight::eiStaticLight scfiStatLight
 iStatLight implementation. More...


Detailed Description

Class for a static light.

These lights cast shadows (against sector boundaries and with things), they support three different colors (R,G,B). They cannot move and they can only vary in intensity with some memory trade-offs (in which case we call it a pseudo-dynamic light).

Definition at line 409 of file csengine/light.h.


Constructor & Destructor Documentation

csStatLight::csStatLight float    x,
float    y,
float    z,
float    dist,
float    red,
float    green,
float    blue,
bool    dynamic
 

Construct a static light at a given position.

With a given radius and a given color. If 'dynamic' is true we have a pseudo-dynamic light which can change intensity and color (but not move). The light will not have a halo by default.

virtual csStatLight::~csStatLight   [virtual]
 

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.


Member Function Documentation

void csStatLight::AddAffectedLightingInfo iLightingInfo   li
 

Add affected mesh.

void csStatLight::CalculateLighting iMeshWrapper   mesh
 

Shine this light on all polygons of the mesh.

Only backface culling is used. The light is assumed to be in the same sector as the mesh. Currently only works on thing meshes.

void csStatLight::CalculateLighting  
 

Shine this light on all polygons visible from the light.

This routine will update the lightmaps of all polygons or update the vertex colors if gouraud shading is used. It correctly takes pseudo-dynamic lights into account and will then update the corresponding shadow map.

virtual bool csStatLight::IsDynamic   const [inline, virtual]
 

Return true if this light is pseudo-dynamic.

Reimplemented from csLight.

Definition at line 445 of file csengine/light.h.

virtual void csStatLight::SetColor const csColor   col [virtual]
 

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. However, this function works as expected for pseudo-dynamic lights. In this case the lightmaps will be correctly updated the next time they become visible.

Reimplemented from csLight.


Member Data Documentation

csStatLight::eiStaticLight csStatLight::scfiStatLight
 

iStatLight implementation.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14