#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... | |
bool | IsDynamic () |
Return true if this light is pseudo-dynamic. | |
virtual void | SetColor (const csColor &col) |
Set the light color. More... | |
void | RegisterLightMap (csLightMap *lmap) |
Register a lightmap for a pseudo-dynamic light. 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... | |
SCF_DECLARE_IBASE_EXT (csLight) | |
Public Attributes | |
csStatLight::eiStaticLight | scfiStatLight |
Friends | |
class | eiStaticLight |
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).
|
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. |
|
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. |
|
Register a lightmap for a pseudo-dynamic light. Every lightmap which is interested in updating itself as this light changes should register itself to the light. |
|
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. |