![]() |
Public API Reference |
#include <light.h>
Inheritance diagram for csStatLight:
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... |
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 373 of file csengine/light.h.
|
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. |
|
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. |
|
Add affected 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. |
|
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. |
|
Return true if this light is pseudo-dynamic.
Reimplemented from csLight. Definition at line 409 of file csengine/light.h. |
|
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. |
|
iStatLight implementation.
|