Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csLightMap Class Reference

The static and all dynamic lightmaps for one polygon. More...

#include <lghtmap.h>

Inheritance diagram for csLightMap:

iLightMap iBase List of all members.

Public Methods

 csLightMap ()
virtual ~csLightMap ()
void MakeDirtyDynamicLights ()
 set the dirty flag for this lightmap.

bool UpdateRealLightMap ()
csRGBMap& GetStaticMap ()
csRGBMap& GetRealMap ()
void Alloc (int w, int h, int r, int g, int b)
 Allocate the lightmap. More...

void CopyLightMap (csLightMap *source)
 Copy a lightmap.

csShadowMap* NewShadowMap (csLight *light, int w, int h)
 Create a ShadowMap for this LightMap.

void AllocStaticLM (int w, int h)
 Allocate the static csRGBMap.

csShadowMap* FindShadowMap (csLight *light)
 Find a ShadowMap for a specific pseudo-dynamic light.

void DelShadowMap (csShadowMap *plm)
 Delete a ShadowMap. More...

bool ReadFromCache (iCacheManager *cache_mgr, int id, int w, int h, csObject *obj, bool isPolygon, csEngine *)
 Read from the cache. More...

void Cache (iCacheManager *cache_mgr, int id, csPolygon3D *poly, csCurve *curve, csEngine *)
 Cache the lightmaps in the precalculation area. More...

void ConvertToMixingMode ()
 Convert the lightmaps to the correct mixing mode. More...

void ConvertFor3dDriver (bool requirePO2, int maxAspect=32767)
 Convert the lightmaps to a 3D driver dependent size.

virtual csRGBpixelGetMapData ()
 Get light map data.

virtual int GetWidth ()
 Get lightmap width (could be adjusted to power of two).

virtual int GetHeight ()
 Get lightmap height (could be adjusted to power of two).

virtual int GetRealWidth ()
 Get real lightmap width (could be less than returned by GetWidth()).

virtual int GetRealHeight ()
 Get real lightmap height (could be less than returned by GetHeight()).

virtual void* GetCacheData ()
 Get data used internally by texture cache.

virtual void SetCacheData (void *d)
 Set data used internally by texture cache.

virtual void GetMeanLighting (int &r, int &g, int &b)
 Get mean color for the lightmaps.

virtual long GetSize ()
 Get size of one lightmap.


Public Attributes

 SCF_DECLARE_IBASE

Static Public Methods

int CalcLightMapWidth (int w)
 Return the width of a lightmap given a texture size.

int CalcLightMapHeight (int h)
 Return the height of a lightmap given a texture size.

void SetLightCellSize (int size)
 Set the size of one lightmap cell (default = 16). More...


Static Public Attributes

int lightcell_size
 Option variable: shadow cell size.

int lightcell_shift
 Log base 2 of lightcell_size.


Friends

class  csPolyTexture

Detailed Description

The static and all dynamic lightmaps for one polygon.


Member Function Documentation

void csLightMap::Alloc ( int w,
int h,
int r,
int g,
int b )
 

Allocate the lightmap.

'w' and 'h' are the size of the bounding box in lightmap space. r,g,b is the ambient light color used to initialize the lightmap.

void csLightMap::Cache ( iCacheManager * cache_mgr,
int id,
csPolygon3D * poly,
csCurve * curve,
csEngine * )
 

Cache the lightmaps in the precalculation area.

'id' is a global id that is used to identify objects.

void csLightMap::ConvertToMixingMode ( )
 

Convert the lightmaps to the correct mixing mode.

This function does nothing unless the mixing mode is nocolor.

This function also calculates the mean color of the lightmap.

void csLightMap::DelShadowMap ( csShadowMap * plm )
 

Delete a ShadowMap.

NOTE!!! This function only works if the ShadowMap was the LAST CREATED for this LightMap!!! It is ment for dynamic lights that do not reach the polygon but this can only be seen after trying.

bool csLightMap::ReadFromCache ( iCacheManager * cache_mgr,
int id,
int w,
int h,
csObject * obj,
bool isPolygon,
csEngine * )
 

Read from the cache.

Return true if succesful. 'id' is a global id that is used to identify objects.

void csLightMap::SetLightCellSize ( int size ) [static]
 

Set the size of one lightmap cell (default = 16).

Do not directly assign to the lightcell_size variable, as lightmap_shift also has to be updated.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000