My Project
Public Member Functions | Static Public Member Functions | List of all members
ParaEngine::CLightManager Class Reference

managing local lights. More...

#include <LightManager.h>

Public Member Functions

void CleanupLights ()
 clean up the light pool
 
bool RegisterLight (CLightParam *pLight)
 add a new light to the pool
 
bool UnRegisterLight (CLightParam *pLight)
 remove a light to the pool
 
int GetBestLights (const Vector3 &vCenter, float fRadius, LightList &listOutLights, int nMaxNumLights=0xffffffff)
 select up to nMaxNumLights lights, which are affecting a sphere area (vCenter, fRadius). More...
 
int GetBestLights (const Vector3 &vCenter, float fRadius, int nMaxNumLights=0xffffffff)
 the result can by get by GetLastResult()
 
LightList * GetLastResult ()
 get the result returned from GetBestLights(). More...
 
int GetLastResultNum ()
 the number of lights returned in the last GetBestLights() call. More...
 
int GetNumLights () const
 number of lights in the pool
 
LightList & GetLights ()
 get the light pool
 
int ComputeLightScore (CLightParam *pLight, const Vector3 &vCenter, float fRadius) const
 The more the given light affects the sphere area(vCenter, fRadius), the higher the scored light will be. More...
 

Static Public Member Functions

static CLightManagerGetSingleton ()
 

Detailed Description

managing local lights.

its basics functionality is to return a number of lights which are interested to a given (spherical) area.

Member Function Documentation

§ ComputeLightScore()

int CLightManager::ComputeLightScore ( CLightParam pLight,
const Vector3 vCenter,
float  fRadius 
) const

The more the given light affects the sphere area(vCenter, fRadius), the higher the scored light will be.

score is 0 or negative if the light is not affecting the area at all.

Parameters
pLightthe given light. The score will be saved as well.
vCenterthe center of the sphere
fRadiusthe radius of the sphere
Returns
: the score is returned.

§ GetBestLights()

int CLightManager::GetBestLights ( const Vector3 vCenter,
float  fRadius,
LightList &  listOutLights,
int  nMaxNumLights = 0xffffffff 
)

select up to nMaxNumLights lights, which are affecting a sphere area (vCenter, fRadius).

this function is automatically called by the effect manager to determine which lights are to be enabled for a certain drawable object.

Parameters
vCentercenter of the sphere
fRadiusradius of the sphere
listOutLightsthis lists will be filled with lights.
nMaxNumLightsthe returned number of lights is always smaller than this value.
Returns
: the number of light, returned in listOutLights. Please do not use the size of listOutLights for the number of light. Always use this returned value.

§ GetLastResult()

LightList * CLightManager::GetLastResult ( )

get the result returned from GetBestLights().

Please note that the light manager just return the member point which is used to keep the best light result if the user does not supply it. So the light list returned is not persistent across multiple calls of GetBestLights

§ GetLastResultNum()

int CLightManager::GetLastResultNum ( )

the number of lights returned in the last GetBestLights() call.

Please note that the light manager just return the member point which is used to keep the best light result if the user does not supply it. So the light list returned is not persistent across multiple calls of GetBestLights


The documentation for this class was generated from the following files: