![]() |
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 (iSector *sector) |
Set the current sector for this light. More... | |
iSector * | 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... | |
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... | |
void | SetAttenuationVector (const csVector3 &pattenv) |
Set attenuation vector csVector3(constant, linear, quadric). More... | |
const csVector3 & | GetAttenuationVector () |
Get attenuation vector csVector3(constant, linear, quadric). More... | |
float | GetInfluenceRadius () |
Get the influence radius of the light. More... | |
float | GetInfluenceRadiusSq () |
Get the squared influence radius of the light. More... | |
void | SetInfluenceRadius (float radius) |
Override the influence radius. More... | |
void | CalculateAttenuationVector (int atttype, float radius=1.0f, float brightness=1.0f) |
Calculate the attenuation vector for a given attenuation type. More... | |
bool | GetDistanceForBrightness (float brightness, float &distance) |
Get the distance for a given light brightness. 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 | |
iSector * | sector |
Home sector of the light. More... | |
csVector3 | center |
Position of the light. More... | |
csColor | color |
Color. More... | |
csHalo * | halo |
The associated halo (if not 0). More... | |
int | attenuation |
Attenuation type. More... | |
csVector3 | attenuationvec |
Attenuation vector in the format x=kc, y=kl, z=kq. More... | |
float | influenceRadius |
The radius where the light have any effect at all. More... | |
float | influenceRadiusSq |
Squared influence radius. More... | |
float | inv_dist |
Inverse radius of light. More... | |
bool | influenceValid |
Is the influence radius valid? 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... | |
Static Protected Attributes | |
float | influenceIntensityFraction |
Config value: The intensity at the influenceRadius in parts of the main light intensity. 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 attenuation vector for a given attenuation type.
|
|
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 207 of file csengine/light.h. References attenuation. |
|
Get attenuation vector csVector3(constant, linear, quadric).
|
|
Get the brightness of a light at a given distance.
|
|
Get the center position.
Definition at line 178 of file csengine/light.h. |
|
Get the kdtree child node.
Definition at line 152 of file csengine/light.h. |
|
Get the light color.
Definition at line 183 of file csengine/light.h. |
|
Get the distance for a given light brightness.
|
|
Return the associated halo.
Definition at line 197 of file csengine/light.h. |
|
Get the influence radius of the light.
|
|
Get the squared influence radius of the light.
|
|
Get the ID of this light.
Definition at line 155 of file csengine/light.h. References GenerateUniqueID. |
|
Get the current sector for this light.
Definition at line 168 of file csengine/light.h. |
|
Return true if the light is pseudo-dynamic.
Reimplemented in csStatLight. Definition at line 158 of file csengine/light.h. |
|
Change the light's attenuation type.
|
|
Set attenuation vector csVector3(constant, linear, quadric).
|
|
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 144 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.
|
|
Override the influence radius.
|
|
Set the current sector for this light.
|
|
Config value: ambient blue value.
Definition at line 121 of file csengine/light.h. |
|
Config value: ambient green value.
Definition at line 117 of file csengine/light.h. |
|
Config value: ambient red value.
Definition at line 113 of file csengine/light.h. |
|
Attenuation type.
Definition at line 69 of file csengine/light.h. Referenced by GetAttenuation. |
|
Attenuation vector in the format x=kc, y=kl, z=kq.
Definition at line 71 of file csengine/light.h. |
|
Position of the light.
Definition at line 62 of file csengine/light.h. |
|
Color.
Definition at line 64 of file csengine/light.h. |
|
Set of flags.
Definition at line 107 of file csengine/light.h. |
|
The associated halo (if not 0).
Definition at line 66 of file csengine/light.h. |
|
Config value: The intensity at the influenceRadius in parts of the main light intensity.
Definition at line 87 of file csengine/light.h. |
|
The radius where the light have any effect at all.
Definition at line 74 of file csengine/light.h. |
|
Squared influence radius.
Definition at line 76 of file csengine/light.h. |
|
Is the influence radius valid?
Definition at line 81 of file csengine/light.h. |
|
Inverse radius of light.
Definition at line 78 of file csengine/light.h. |
|
List of light callbacks.
Definition at line 95 of file csengine/light.h. |
|
Light number. Changes when the light changes in some way (color/pos).
Definition at line 90 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. |