My Project
|
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 CLightManager & | GetSingleton () |
managing local lights.
its basics functionality is to return a number of lights which are interested to a given (spherical) area.
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.
pLight | the given light. The score will be saved as well. |
vCenter | the center of the sphere |
fRadius | the radius of the sphere |
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.
vCenter | center of the sphere |
fRadius | radius of the sphere |
listOutLights | this lists will be filled with lights. |
nMaxNumLights | the returned number of lights is always smaller than this value. |
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
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