CrystalSpace

Public API Reference

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

iLight Struct Reference
[Lighting]

The iLight interface is the SCF interface for the csLight class. More...

#include <light.h>

Inheritance diagram for iLight:

iBase csLight::Light List of all members.

Public Methods

virtual csLightGetPrivateObject ()=0
 Get private pointer to light object. UGLY. More...

virtual const char * GetLightID ()=0
 Get the id of this light. This is a 16-byte MD5. More...

virtual iObjectQueryObject ()=0
 Get the iObject for this light. More...

virtual const csVector3GetCenter ()=0
 Get the position of this light. More...

virtual void SetCenter (const csVector3 &pos)=0
 Set the position of this light. More...

virtual iSectorGetSector ()=0
 Get the sector for this light. More...

virtual void SetSector (iSector *sector)=0
 Set the sector for this light. More...

virtual const csColorGetColor ()=0
 Get the color of this light. More...

virtual void SetColor (const csColor &col)=0
 Set the color of this light. More...

virtual bool IsDynamic () const=0
 Return true if this light is pseudo-dynamic. More...

virtual float GetInfluenceRadius ()=0
 Get the influence radius of the light. More...

virtual float GetInfluenceRadiusSq ()=0
 Get the squared influence radius of the light. More...

virtual void SetInfluenceRadius (float radius)=0
 Override the influence radius. More...

virtual int GetAttenuation ()=0
 Return current attenuation mode. More...

virtual void SetAttenuation (int a)=0
 Set attenuation mode. More...

virtual void SetAttenuationVector (const csVector3 &attenv)=0
 Set attenuation vector csVector3(constant, linear, quadric) FIXME: examples. More...

virtual const csVector3GetAttenuationVector ()=0
 Get attenuation vector csVector3(constant, linear, quadric). More...

virtual void CalculateAttenuationVector (int atttype, float radius=1.0f, float brightness=1.0f)=0
 Calculate the attenuation vector for a given attenuation type. More...

virtual bool GetDistanceForBrightness (float brightness, float &distance)=0
 Get the distance for a given light brightness. More...

virtual iCrossHaloCreateCrossHalo (float intensity, float cross)=0
 Create a cross halo for this light. More...

virtual iNovaHaloCreateNovaHalo (int seed, int num_spokes, float roundness)=0
 Create a nova halo for this light. More...

virtual iFlareHaloCreateFlareHalo ()=0
 Create a flare halo for this light. More...

virtual float GetBrightnessAtDistance (float d)=0
 Get the brightness of a light at a given distance. More...

virtual csFlagsGetFlags ()=0
 Get flags for this light. More...

virtual void SetLightCallback (iLightCallback *cb)=0
 Set the light callback. More...

virtual void RemoveLightCallback (iLightCallback *cb)=0
 Remove a light callback. More...

virtual int GetLightCallbackCount () const=0
 Get the number of light callbacks. More...

virtual iLightCallbackGetLightCallback (int idx) const=0
 Get the specified light callback. More...

virtual uint32 GetLightNumber () const=0
 Return a number that changes when the light changes (color, or position). More...


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:

Note that static and pseudo-dynamic lights are represented by the same csStatLight class.

Definition at line 154 of file iengine/light.h.


Member Function Documentation

virtual void iLight::CalculateAttenuationVector int    atttype,
float    radius = 1.0f,
float    brightness = 1.0f
[pure virtual]
 

Calculate the attenuation vector for a given attenuation type.

Parameters:
atttype  Attenuation type constant - CS_ATTN_NONE, CS_ATTN_INVERSE, CS_ATTN_REALISTIC
radius  Radius where the light is brightness bright
brightness  Brightness of the light at radius

Implemented in csLight::Light.

virtual iCrossHalo* iLight::CreateCrossHalo float    intensity,
float    cross
[pure virtual]
 

Create a cross halo for this light.

Implemented in csLight::Light.

virtual iFlareHalo* iLight::CreateFlareHalo   [pure virtual]
 

Create a flare halo for this light.

Implemented in csLight::Light.

virtual iNovaHalo* iLight::CreateNovaHalo int    seed,
int    num_spokes,
float    roundness
[pure virtual]
 

Create a nova halo for this light.

Implemented in csLight::Light.

virtual int iLight::GetAttenuation   [pure virtual]
 

Return current attenuation mode.

Implemented in csLight::Light.

virtual const csVector3& iLight::GetAttenuationVector   [pure virtual]
 

Get attenuation vector csVector3(constant, linear, quadric).

Implemented in csLight::Light.

virtual float iLight::GetBrightnessAtDistance float    d [pure virtual]
 

Get the brightness of a light at a given distance.

Implemented in csLight::Light.

virtual const csVector3& iLight::GetCenter   [pure virtual]
 

Get the position of this light.

Implemented in csLight::Light.

virtual const csColor& iLight::GetColor   [pure virtual]
 

Get the color of this light.

Implemented in csLight::Light.

virtual bool iLight::GetDistanceForBrightness float    brightness,
float &    distance
[pure virtual]
 

Get the distance for a given light brightness.

Returns:
Returns whether the distance could be calculated. E.g. when attenuation vector only has a constant part. distance is unaltered in this case.
Remarks:
  • Might fail when brightness <= 0.

Implemented in csLight::Light.

virtual csFlags& iLight::GetFlags   [pure virtual]
 

Get flags for this light.

Supported flags:

Implemented in csLight::Light.

virtual float iLight::GetInfluenceRadius   [pure virtual]
 

Get the influence radius of the light.

Implemented in csLight::Light.

virtual float iLight::GetInfluenceRadiusSq   [pure virtual]
 

Get the squared influence radius of the light.

Implemented in csLight::Light.

virtual iLightCallback* iLight::GetLightCallback int    idx const [pure virtual]
 

Get the specified light callback.

Implemented in csLight::Light.

virtual int iLight::GetLightCallbackCount   const [pure virtual]
 

Get the number of light callbacks.

Implemented in csLight::Light.

virtual const char* iLight::GetLightID   [pure virtual]
 

Get the id of this light. This is a 16-byte MD5.

Implemented in csLight::Light.

virtual uint32 iLight::GetLightNumber   const [pure virtual]
 

Return a number that changes when the light changes (color, or position).

Implemented in csLight::Light.

virtual csLight* iLight::GetPrivateObject   [pure virtual]
 

Get private pointer to light object. UGLY.

Implemented in csLight::Light.

virtual iSector* iLight::GetSector   [pure virtual]
 

Get the sector for this light.

Implemented in csLight::Light.

virtual bool iLight::IsDynamic   const [pure virtual]
 

Return true if this light is pseudo-dynamic.

Implemented in csLight::Light.

virtual iObject* iLight::QueryObject   [pure virtual]
 

Get the iObject for this light.

Implemented in csLight::Light.

virtual void iLight::RemoveLightCallback iLightCallback   cb [pure virtual]
 

Remove a light callback.

Implemented in csLight::Light.

virtual void iLight::SetAttenuation int    a [pure virtual]
 

Set attenuation mode.

The following values are possible (default is CS_ATTN_LINEAR):

Implemented in csLight::Light.

virtual void iLight::SetAttenuationVector const csVector3   attenv [pure virtual]
 

Set attenuation vector csVector3(constant, linear, quadric) FIXME: examples.

Implemented in csLight::Light.

virtual void iLight::SetCenter const csVector3   pos [pure virtual]
 

Set the position of this light.

Implemented in csLight::Light.

virtual void iLight::SetColor const csColor   col [pure virtual]
 

Set the color of this light.

Implemented in csLight::Light.

virtual void iLight::SetInfluenceRadius float    radius [pure virtual]
 

Override the influence radius.

Implemented in csLight::Light.

virtual void iLight::SetLightCallback iLightCallback   cb [pure virtual]
 

Set the light callback.

This will call IncRef() on the callback So make sure you call DecRef() to release your own reference.

Implemented in csLight::Light.

virtual void iLight::SetSector iSector   sector [pure virtual]
 

Set the sector for this light.

Implemented in csLight::Light.


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