Definition at line 244 of file instance_lighter.h.
Public Member Functions | |
| bool | operator() (CPointLightRT *pla, CPointLightRT *plb) const |
Data Fields | |
| CVector | Point |
|
||||||||||||
|
Definition at line 1140 of file instance_lighter.cpp. References NL3D::CInstanceLighter::CPointLightRT::BSphere, NLMISC::CBSphere::Center, NLMISC::clamp(), NL3D::CPointLight::getAttenuationEnd(), NL3D::CInstanceLighter::CPointLightRT::OODeltaAttenuation, and NL3D::CInstanceLighter::CPointLightRT::PointLight.
01141 {
01142 float ra= (pla->BSphere.Center - Point).norm();
01143 float rb= (plb->BSphere.Center - Point).norm();
01144 float infA= (pla->PointLight.getAttenuationEnd() - ra) * pla->OODeltaAttenuation;
01145 float infB= (plb->PointLight.getAttenuationEnd() - rb) * plb->OODeltaAttenuation;
01146 // It is important to clamp, else strange results...
01147 clamp(infA, 0.f, 1.f);
01148 clamp(infB, 0.f, 1.f);
01149 // return which light impact the most.
01150 // If same impact
01151 if(infA==infB)
01152 // return nearest
01153 return ra < rb;
01154 else
01155 // return better impact
01156 return infA > infB;
01157 }
|
|
|
Definition at line 246 of file instance_lighter.h. Referenced by NL3D::CInstanceLighter::processIGPointLightRT(). |
1.3.6