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 List of all members.

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 iObjectQueryObject ()=0
 Get the iObject for this light.

virtual int GetDynamicType () const=0
 Get the dynamic type of this light.

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

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

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

virtual const csColorGetColor ()=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 csVector3GetAttenuationVector ()=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 iCrossHaloCreateCrossHalo (float intensity, float cross)=0
 Create a cross halo for this light.

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

virtual iFlareHaloCreateFlareHalo ()=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 csFlagsGetFlags ()=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 iLightCallbackGetLightCallback (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:

Definition at line 177 of file light.h.


Member Function Documentation

virtual void iLight::AddAffectedLightingInfo iLightingInfo   li [pure virtual]
 

Add a mesh to this light.

This is usually called during Setup() by meshes that are hit by the light.

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

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

Create a cross halo for this light.

virtual iFlareHalo* iLight::CreateFlareHalo   [pure virtual]
 

Create a flare halo for this light.

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

Create a nova halo for this light.

virtual int iLight::GetAttenuation   [pure virtual]
 

Return current attenuation mode.

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

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

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

Get the brightness of a light at a given distance.

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

Get the position of this light.

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

Get the color of this 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.

virtual int iLight::GetDynamicType   [pure virtual]
 

Get the dynamic type of this light.

Supported types:

virtual csFlags& iLight::GetFlags   [pure virtual]
 

Get flags for this light.

Supported flags:

virtual float iLight::GetInfluenceRadius   [pure virtual]
 

Get the influence radius of the light.

virtual float iLight::GetInfluenceRadiusSq   [pure virtual]
 

Get the squared influence radius of the light.

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

Get the specified light callback.

virtual int iLight::GetLightCallbackCount   [pure virtual]
 

Get the number of light callbacks.

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

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

virtual uint32 iLight::GetLightNumber   [pure virtual]
 

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

virtual csLight* iLight::GetPrivateObject   [pure virtual]
 

Get private pointer to light object. UGLY.

virtual iSector* iLight::GetSector   [pure virtual]
 

Get the sector for this light.

virtual iObject* iLight::QueryObject   [pure virtual]
 

Get the iObject for this light.

virtual void iLight::RemoveAffectedLightingInfo iLightingInfo   li [pure virtual]
 

Remove a mesh from this light.

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

Remove a light callback.

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

Set attenuation mode.

The following values are possible (default is CS_ATTN_LINEAR):

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

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

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

Set the position of this light.

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

Set the color of this light.

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

Override the influence radius.

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.

virtual void iLight::Setup   [pure virtual]
 

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:
Generated for Crystal Space by doxygen 1.2.18