CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

csLight Class Reference

Superclass of all positional lights. More...

#include <light.h>

Inheritance diagram for csLight:

csObject iObject iBase csDynLight csStatLight List of all members.

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

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

csSectorGetSector () const
 Get the current sector for this light. More...

void SetCenter (const csVector3 &v)
 Set the center position. More...

const csVector3GetCenter ()
 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...

csColorGetColor ()
 Get the light color. More...

virtual void SetColor (const csColor &col)
 Set the light color. More...

csHaloGetHalo ()
 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

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

csHalohalo
 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< iLightCallbacklight_cb_vector
 List of light callbacks. More...


Detailed Description

Superclass of all positional lights.

A light subclassing from this has a color, a position and a radius.

Definition at line 49 of file csengine/light.h.


Constructor & Destructor Documentation

csLight::csLight float    x,
float    y,
float    z,
float    dist,
float    red,
float    green,
float    blue
 

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.

virtual csLight::~csLight   [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.


Member Function Documentation

void csLight::CalculateInfluenceRadius   [protected]
 

Calculate the influenceradius from the attenuation vector.

const char* csLight::GenerateUniqueID   [protected]
 

Get a unique ID for this light. Generate it if needed.

Referenced by GetLightID.

int csLight::GetAttenuation   [inline]
 

Get the light's attenuation type.

Definition at line 239 of file csengine/light.h.

References attenuation.

float csLight::GetBrightnessAtDistance float    d
 

Get the brightness of a light at a given distance.

const csVector3& csLight::GetCenter   [inline]
 

Get the center position.

Definition at line 187 of file csengine/light.h.

csKDTreeChild* csLight::GetChildNode   const [inline]
 

Get the kdtree child node.

Definition at line 161 of file csengine/light.h.

csColor& csLight::GetColor   [inline]
 

Get the light color.

Definition at line 214 of file csengine/light.h.

csHalo* csLight::GetHalo   [inline]
 

Return the associated halo.

Definition at line 228 of file csengine/light.h.

float csLight::GetInverseRadius   const [inline]
 

Get the inverse radius.

Definition at line 203 of file csengine/light.h.

References inv_dist.

const char* csLight::GetLightID   [inline]
 

Get the ID of this light.

Definition at line 164 of file csengine/light.h.

References GenerateUniqueID.

float csLight::GetRadius   const [inline]
 

Get the radius.

Definition at line 193 of file csengine/light.h.

References dist.

csSector* csLight::GetSector   const [inline]
 

Get the current sector for this light.

Definition at line 177 of file csengine/light.h.

float csLight::GetSquaredRadius   const [inline]
 

Get the squared radius.

Definition at line 198 of file csengine/light.h.

References sqdist.

virtual bool csLight::IsDynamic   const [inline, virtual]
 

Return true if the light is pseudo-dynamic.

Reimplemented in csStatLight.

Definition at line 167 of file csengine/light.h.

void csLight::SetAttenuation int    a
 

Change the light's attenuation type.

void csLight::SetCenter const csVector3   v
 

Set the center position.

void csLight::SetChildNode csKDTreeChild   childnode [inline]
 

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.

virtual void csLight::SetColor const csColor   col [virtual]
 

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.

void csLight::SetHalo csHalo   Halo
 

Set the halo associated with this light.

void csLight::SetRadius float    radius
 

Set the radius.

virtual void csLight::SetSector csSector   sector [virtual]
 

Set the current sector for this light.


Member Data Documentation

int csLight::ambient_blue [static]
 

Config value: ambient blue value.

Definition at line 130 of file csengine/light.h.

int csLight::ambient_green [static]
 

Config value: ambient green value.

Definition at line 126 of file csengine/light.h.

int csLight::ambient_red [static]
 

Config value: ambient red value.

Definition at line 122 of file csengine/light.h.

int csLight::attenuation [protected]
 

Attenuation type.

Definition at line 78 of file csengine/light.h.

Referenced by GetAttenuation.

csVector3 csLight::center [protected]
 

Position of the light.

Definition at line 62 of file csengine/light.h.

csColor csLight::color [protected]
 

Color.

Definition at line 72 of file csengine/light.h.

float csLight::dist [protected]
 

Radius of light.

Definition at line 65 of file csengine/light.h.

Referenced by GetRadius.

csFlags csLight::flags
 

Set of flags.

Definition at line 116 of file csengine/light.h.

csHalo* csLight::halo [protected]
 

The associated halo (if not NULL).

Definition at line 74 of file csengine/light.h.

float csLight::inv_dist [protected]
 

Inverse radius of light.

Definition at line 69 of file csengine/light.h.

Referenced by GetInverseRadius.

csRefArray<iLightCallback> csLight::light_cb_vector [protected]
 

List of light callbacks.

Definition at line 105 of file csengine/light.h.

uint32 csLight::lightnr [protected]
 

Light number. Changes when the light changes in some way (color/pos).

Definition at line 100 of file csengine/light.h.

csLight::Light csLight::scfiLight
 

iLight implementation.

Referenced by csLightingProcessInfo::GetLight.

csSector* csLight::sector [protected]
 

Home sector of the light.

Definition at line 60 of file csengine/light.h.

float csLight::sqdist [protected]
 

Squared radius of light.

Definition at line 67 of file csengine/light.h.

Referenced by GetSquaredRadius.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14