![]() |
Public API Reference |
#include <light.h>
Inheritance diagram for csLight:
Public Methods | |
csLight (float x, float y, float z, float dist, float red, float green, float blue) | |
Construct a light at a given position. More... | |
virtual | ~csLight () |
Destroy the light. More... | |
void | SetChildNode (csKDTreeChild *childnode) |
Set the kdtree child node used by this light (in the kdtree that is maintained by the sector light list). More... | |
csKDTreeChild * | GetChildNode () const |
Get the kdtree child node. More... | |
const char * | GetLightID () |
Get the ID of this light. More... | |
virtual bool | IsDynamic () const |
Return true if the light is pseudo-dynamic. More... | |
virtual void | SetSector (csSector *sector) |
Set the current sector for this light. More... | |
csSector * | GetSector () const |
Get the current sector for this light. More... | |
void | SetCenter (const csVector3 &v) |
Set the center position. More... | |
const csVector3 & | GetCenter () |
Get the center position. More... | |
float | GetRadius () const |
Get the radius. More... | |
float | GetSquaredRadius () const |
Get the squared radius. More... | |
float | GetInverseRadius () const |
Get the inverse radius. More... | |
void | SetRadius (float radius) |
Set the radius. More... | |
csColor & | GetColor () |
Get the light color. More... | |
virtual void | SetColor (const csColor &col) |
Set the light color. More... | |
csHalo * | GetHalo () |
Return the associated halo. More... | |
void | SetHalo (csHalo *Halo) |
Set the halo associated with this light. More... | |
int | GetAttenuation () |
Get the light's attenuation type. More... | |
void | SetAttenuation (int a) |
Change the light's attenuation type. More... | |
float | GetBrightnessAtDistance (float d) |
Get the brightness of a light at a given distance. More... | |
Public Attributes | |
csFlags | flags |
Set of flags. More... | |
csLight::Light | scfiLight |
iLight implementation. More... | |
Static Public Attributes | |
int | ambient_red |
Config value: ambient red value. More... | |
int | ambient_green |
Config value: ambient green value. More... | |
int | ambient_blue |
Config value: ambient blue value. More... | |
Protected Methods | |
const char * | GenerateUniqueID () |
Get a unique ID for this light. Generate it if needed. More... | |
void | CalculateInfluenceRadius () |
Calculate the influenceradius from the attenuation vector. More... | |
Protected Attributes | |
csSector * | sector |
Home sector of the light. More... | |
csVector3 | center |
Position of the light. More... | |
float | dist |
Radius of light. More... | |
float | sqdist |
Squared radius of light. More... | |
float | inv_dist |
Inverse radius of light. More... | |
csColor | color |
Color. More... | |
csHalo * | halo |
The associated halo (if not NULL). More... | |
int | attenuation |
Attenuation type. More... | |
uint32 | lightnr |
Light number. Changes when the light changes in some way (color/pos). More... | |
csRefArray< iLightCallback > | light_cb_vector |
List of light callbacks. More... |
A light subclassing from this has a color, a position and a radius.
Definition at line 49 of file csengine/light.h.
|
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. |
|
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. |
|
Calculate the influenceradius from the attenuation vector.
|
|
Get a unique ID for this light. Generate it if needed.
Referenced by GetLightID. |
|
Get the light's attenuation type.
Definition at line 239 of file csengine/light.h. References attenuation. |
|
Get the brightness of a light at a given distance.
|
|
Get the center position.
Definition at line 187 of file csengine/light.h. |
|
Get the kdtree child node.
Definition at line 161 of file csengine/light.h. |
|
Get the light color.
Definition at line 214 of file csengine/light.h. |
|
Return the associated halo.
Definition at line 228 of file csengine/light.h. |
|
Get the inverse radius.
Definition at line 203 of file csengine/light.h. References inv_dist. |
|
Get the ID of this light.
Definition at line 164 of file csengine/light.h. References GenerateUniqueID. |
|
Get the radius.
Definition at line 193 of file csengine/light.h. References dist. |
|
Get the current sector for this light.
Definition at line 177 of file csengine/light.h. |
|
Get the squared radius.
Definition at line 198 of file csengine/light.h. References sqdist. |
|
Return true if the light is pseudo-dynamic.
Reimplemented in csStatLight. Definition at line 167 of file csengine/light.h. |
|
Change the light's attenuation type.
|
|
Set the center position.
|
|
Set the kdtree child node used by this light (in the kdtree that is maintained by the sector light list).
Definition at line 153 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. Reimplemented in csStatLight. |
|
Set the halo associated with this light.
|
|
Set the radius.
|
|
Set the current sector for this light.
|
|
Config value: ambient blue value.
Definition at line 130 of file csengine/light.h. |
|
Config value: ambient green value.
Definition at line 126 of file csengine/light.h. |
|
Config value: ambient red value.
Definition at line 122 of file csengine/light.h. |
|
Attenuation type.
Definition at line 78 of file csengine/light.h. Referenced by GetAttenuation. |
|
Position of the light.
Definition at line 62 of file csengine/light.h. |
|
Color.
Definition at line 72 of file csengine/light.h. |
|
Radius of light.
Definition at line 65 of file csengine/light.h. Referenced by GetRadius. |
|
Set of flags.
Definition at line 116 of file csengine/light.h. |
|
The associated halo (if not NULL).
Definition at line 74 of file csengine/light.h. |
|
Inverse radius of light.
Definition at line 69 of file csengine/light.h. Referenced by GetInverseRadius. |
|
List of light callbacks.
Definition at line 105 of file csengine/light.h. |
|
Light number. Changes when the light changes in some way (color/pos).
Definition at line 100 of file csengine/light.h. |
|
iLight implementation.
Referenced by csLightingProcessInfo::GetLight. |
|
Home sector of the light.
Definition at line 60 of file csengine/light.h. |
|
Squared radius of light.
Definition at line 67 of file csengine/light.h. Referenced by GetSquaredRadius. |