iLight Struct Reference
[Lighting]
The iLight interface is the SCF interface for the csLight class.
More...
#include <light.h>
Inheritance diagram for iLight:

Public Methods | |
| virtual csLight * | GetPrivateObject ()=0 |
| Get private pointer to light object. UGLY. | |
| virtual const char * | GetLightID ()=0 |
| Get the id of this light. This is a 16-byte MD5. | |
| virtual iObject * | QueryObject ()=0 |
| Get the iObject for this light. | |
| virtual int | GetDynamicType () const=0 |
| Get the dynamic type of this light. | |
| virtual const csVector3 & | GetCenter ()=0 |
| Get the position of this light. | |
| virtual void | SetCenter (const csVector3 &pos)=0 |
| Set the position of this light. | |
| virtual iSector * | GetSector ()=0 |
| Get the sector for this light. | |
| virtual const csColor & | GetColor ()=0 |
| Get the color of this light. | |
| virtual void | SetColor (const csColor &col)=0 |
| Set the color of this light. | |
| virtual float | GetInfluenceRadius ()=0 |
| Get the influence radius of the light. | |
| virtual float | GetInfluenceRadiusSq ()=0 |
| Get the squared influence radius of the light. | |
| virtual void | SetInfluenceRadius (float radius)=0 |
| Override the influence radius. | |
| virtual int | GetAttenuation ()=0 |
| Return current attenuation mode. | |
| virtual void | SetAttenuation (int a)=0 |
| Set attenuation mode. | |
| virtual void | SetAttenuationVector (const csVector3 &attenv)=0 |
| Set attenuation vector csVector3(constant, linear, quadric) FIXME: examples. | |
| virtual const csVector3 & | GetAttenuationVector ()=0 |
| Get attenuation vector csVector3(constant, linear, quadric). | |
| virtual void | CalculateAttenuationVector (int atttype, float radius=1.0f, float brightness=1.0f)=0 |
| Calculate the attenuation vector for a given attenuation type. | |
| virtual bool | GetDistanceForBrightness (float brightness, float &distance)=0 |
| Get the distance for a given light brightness. | |
| virtual iCrossHalo * | CreateCrossHalo (float intensity, float cross)=0 |
| Create a cross halo for this light. | |
| virtual iNovaHalo * | CreateNovaHalo (int seed, int num_spokes, float roundness)=0 |
| Create a nova halo for this light. | |
| virtual iFlareHalo * | CreateFlareHalo ()=0 |
| Create a flare halo for this light. | |
| virtual float | GetBrightnessAtDistance (float d)=0 |
| Get the brightness of a light at a given distance. | |
| virtual csFlags & | GetFlags ()=0 |
| Get flags for this light. | |
| virtual void | SetLightCallback (iLightCallback *cb)=0 |
| Set the light callback. | |
| virtual void | RemoveLightCallback (iLightCallback *cb)=0 |
| Remove a light callback. | |
| virtual int | GetLightCallbackCount () const=0 |
| Get the number of light callbacks. | |
| virtual iLightCallback * | GetLightCallback (int idx) const=0 |
| Get the specified light callback. | |
| virtual uint32 | GetLightNumber () const=0 |
| Return a number that changes when the light changes (color, or position). | |
| virtual void | AddAffectedLightingInfo (iLightingInfo *li)=0 |
| Add a mesh to this light. | |
| virtual void | RemoveAffectedLightingInfo (iLightingInfo *li)=0 |
| Remove a mesh from this light. | |
| virtual void | Setup ()=0 |
| For a dynamic light you need to call this to do the actual lighting calculations. | |
Detailed Description
The iLight interface is the SCF interface for the csLight class.
First some terminology about all the several types of lights that Crystal Space supports:
- Static light. This is a normal static light that cannot move and cannot change intensity/color. All lighting information from all static lights is collected in one static lightmap.
- Pseudo-dynamic light. This is a static light that still cannot move but the intensity/color can change. The shadow information from every pseudo-dynamic light is kept in a separate shadow-map. Shadowing is very accurate with pseudo-dynamic lights since they use the same algorithm as static lights.
- Dynamic light. This is a light that can move and change intensity/color. These lights are the most flexible. All lighting information from all dynamic lights is collected in one dynamic lightmap (separate from the pseudo-dynamic shadow-maps). Shadows for dynamic lights will be less accurate because things will not cast accurate shadows (due to computation speed limitations).
Main creators of instances implementing this interface:
Main ways to get pointers to this interface:- iEngine::FindLight()
- iEngine::FindLightID()
- iEngine::GetLightIterator()
- iEngine::GetNearbyLights()
- iLightList::Get()
- iLightList::FindByName()
- iLoaderContext::FindLight()
Definition at line 211 of file light.h.
Member Function Documentation
|
|
Add a mesh to this light. This is usually called during Setup() by meshes that are hit by the light. |
|
||||||||||||||||
|
Calculate the attenuation vector for a given attenuation type.
|
|
||||||||||||
|
Create a cross halo for this light.
|
|
|
Create a flare halo for this light.
|
|
||||||||||||||||
|
Create a nova halo for this light.
|
|
|
Return current attenuation mode.
|
|
|
Get attenuation vector csVector3(constant, linear, quadric).
|
|
|
Get the brightness of a light at a given distance.
|
|
|
Get the position of this light.
|
|
|
Get the color of this light.
|
|
||||||||||||
|
Get the distance for a given light brightness.
|
|
|
Get the dynamic type of this light. Supported types: |
|
|
Get flags for this light. Supported flags: |
|
|
Get the influence radius of the light.
|
|
|
Get the squared influence radius of the light.
|
|
|
Get the specified light callback.
|
|
|
Get the number of light callbacks.
|
|
|
Get the id of this light. This is a 16-byte MD5.
|
|
|
Return a number that changes when the light changes (color, or position).
|
|
|
Get private pointer to light object. UGLY.
|
|
|
Get the sector for this light.
|
|
|
Get the iObject for this light.
|
|
|
Remove a mesh from this light.
|
|
|
Remove a light callback.
|
|
|
Set attenuation mode. The following values are possible (default is CS_ATTN_LINEAR):
|
|
|
Set attenuation vector csVector3(constant, linear, quadric) FIXME: examples.
|
|
|
Set the position of this light.
|
|
|
Set the color of this light.
|
|
|
Override the influence radius.
|
|
|
Set the light callback. This will call IncRef() on the callback So make sure you call DecRef() to release your own reference. |
|
|
For a dynamic light you need to call this to do the actual lighting calculations.
|
The documentation for this struct was generated from the following file:
- iengine/light.h
Generated for Crystal Space by doxygen 1.2.18
