CrystalSpace

Public API Reference

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

csLight::Light Struct Reference

iLight implementation. More...

#include <light.h>

Inheritance diagram for csLight::Light:

iLight iBase List of all members.

Public Methods

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


Detailed Description

iLight implementation.

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


Member Function Documentation

virtual void csLight::Light::CalculateAttenuationVector int    atttype,
float    radius,
float    brightness
[inline, 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

Implements iLight.

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

virtual iCrossHalo* csLight::Light::CreateCrossHalo float    intensity,
float    cross
[virtual]
 

Create a cross halo for this light.

Implements iLight.

virtual iFlareHalo* csLight::Light::CreateFlareHalo   [virtual]
 

Create a flare halo for this light.

Implements iLight.

virtual iNovaHalo* csLight::Light::CreateNovaHalo int    seed,
int    num_spokes,
float    roundness
[virtual]
 

Create a nova halo for this light.

Implements iLight.

virtual int csLight::Light::GetAttenuation   [inline, virtual]
 

Return current attenuation mode.

Implements iLight.

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

virtual const csVector3& csLight::Light::GetAttenuationVector   [inline, virtual]
 

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

Implements iLight.

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

virtual float csLight::Light::GetBrightnessAtDistance float    d [inline, virtual]
 

Get the brightness of a light at a given distance.

Implements iLight.

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

virtual const csVector3& csLight::Light::GetCenter   [inline, virtual]
 

Get the position of this light.

Implements iLight.

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

virtual const csColor& csLight::Light::GetColor   [inline, virtual]
 

Get the color of this light.

Implements iLight.

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

virtual bool csLight::Light::GetDistanceForBrightness float    brightness,
float &    distance
[inline, 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.

Implements iLight.

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

virtual csFlags& csLight::Light::GetFlags   [inline, virtual]
 

Get flags for this light.

Supported flags:

Implements iLight.

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

References csFlags::flags.

virtual float csLight::Light::GetInfluenceRadius   [inline, virtual]
 

Get the influence radius of the light.

Implements iLight.

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

virtual float csLight::Light::GetInfluenceRadiusSq   [inline, virtual]
 

Get the squared influence radius of the light.

Implements iLight.

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

virtual iLightCallback* csLight::Light::GetLightCallback int    idx const [inline, virtual]
 

Get the specified light callback.

Implements iLight.

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

virtual int csLight::Light::GetLightCallbackCount   const [inline, virtual]
 

Get the number of light callbacks.

Implements iLight.

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

virtual const char* csLight::Light::GetLightID   [inline, virtual]
 

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

Implements iLight.

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

virtual uint32 csLight::Light::GetLightNumber   const [inline, virtual]
 

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

Implements iLight.

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

References uint32.

virtual csLight* csLight::Light::GetPrivateObject   [inline, virtual]
 

Get private pointer to light object. UGLY.

Implements iLight.

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

virtual iSector* csLight::Light::GetSector   [inline, virtual]
 

Get the sector for this light.

Implements iLight.

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

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

Return true if this light is pseudo-dynamic.

Implements iLight.

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

virtual iObject* csLight::Light::QueryObject   [inline, virtual]
 

Get the iObject for this light.

Implements iLight.

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

virtual void csLight::Light::RemoveLightCallback iLightCallback   cb [inline, virtual]
 

Remove a light callback.

Implements iLight.

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

virtual void csLight::Light::SetAttenuation int    a [inline, virtual]
 

Set attenuation mode.

The following values are possible (default is CS_ATTN_LINEAR):

Implements iLight.

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

virtual void csLight::Light::SetAttenuationVector const csVector3   attenv [inline, virtual]
 

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

Implements iLight.

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

virtual void csLight::Light::SetCenter const csVector3   pos [inline, virtual]
 

Set the position of this light.

Implements iLight.

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

virtual void csLight::Light::SetColor const csColor   col [inline, virtual]
 

Set the color of this light.

Implements iLight.

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

virtual void csLight::Light::SetInfluenceRadius float    radius [inline, virtual]
 

Override the influence radius.

Implements iLight.

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

virtual void csLight::Light::SetLightCallback iLightCallback   cb [inline, virtual]
 

Set the light callback.

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

Implements iLight.

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

virtual void csLight::Light::SetSector iSector   sector [inline, virtual]
 

Set the sector for this light.

Implements iLight.

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


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