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