Definition at line 218 of file instance_lighter.h.
Public Member Functions | |
CPointLightRT () | |
bool | testRaytrace (const CVector &v, sint instanceComputed=-1) |
Data Fields | |
NLMISC::CBSphere | BSphere |
uint | DstId |
CCubeGrid< const CTriangle * > | FaceCubeGrid |
float | OODeltaAttenuation |
CPointLightNamed | PointLight |
uint | RefCount |
|
Definition at line 947 of file instance_lighter.cpp. References RefCount.
00948 { 00949 RefCount= 0; 00950 } |
|
Tells if a point is visible from this light. NB: test first if in BSphere. If occluded or out of radius, return false, else return true. if instanceComputed>=0, then skip obstacles with InstanceId==instanceComputed. Also Skip if the light is an Ambient, and skip if the light is a spot and if the position is out of the cone Definition at line 954 of file instance_lighter.cpp. References BSphere, NLMISC::CBSphere::Center, NL3D::CPointLight::computeLinearAttenuation(), FaceCubeGrid, NL3D::CInstanceLighter::CTriangle::getPlane(), NL3D::CCubeGrid< const CTriangle * >::getSel(), NL3D::CPointLight::getType(), NLMISC::CBSphere::include(), NL3D::CInstanceLighter::CTriangle::InstanceId, NLMISC::CTriangle::intersect(), NL3D::CCubeGrid< const CTriangle * >::isEndSel(), NL3D::CCubeGrid< const CTriangle * >::nextSel(), PointLight, NL3D::CCubeGrid< const CTriangle * >::select(), sint, NL3D::CInstanceLighter::CTriangle::Triangle, and v. Referenced by NL3D::CInstanceLighter::processIGPointLightRT().
00955 { 00956 CVector dummy; 00957 00958 if(!BSphere.include(v)) 00959 return false; 00960 00961 // If Ambient light, just skip 00962 if(PointLight.getType()== CPointLight::AmbientLight) 00963 return false; 00964 00965 // If SpotLight verify in angle radius. 00966 if(PointLight.getType()== CPointLight::SpotLight) 00967 { 00968 float att= PointLight.computeLinearAttenuation(v); 00969 if (att==0) 00970 return false; 00971 } 00972 00973 00974 // Select in the cubeGrid 00975 FaceCubeGrid.select(v); 00976 // For all faces selected 00977 while(!FaceCubeGrid.isEndSel()) 00978 { 00979 const CTriangle *tri= FaceCubeGrid.getSel(); 00980 00981 // If the triangle is not a triangle of the instance currenlty lighted 00982 if( instanceComputed<0 || tri->InstanceId != instanceComputed ) 00983 { 00984 // If intersect, the point is occluded. 00985 if( tri->Triangle.intersect(BSphere.Center, v, dummy, tri->getPlane()) ) 00986 return false; 00987 } 00988 00989 // next 00990 FaceCubeGrid.nextSel(); 00991 } 00992 00993 // Ok the point is visilbe from the light 00994 return true; 00995 } |
|
|
Definition at line 230 of file instance_lighter.h. Referenced by NL3D::CInstanceLighter::processIGPointLightRT(). |
|
Definition at line 226 of file instance_lighter.h. Referenced by NL3D::CInstanceLighter::compilePointLightRT(), and testRaytrace(). |
|
Definition at line 221 of file instance_lighter.h. Referenced by NL3D::CInstanceLighter::addStaticPointLight(), and NL3D::CInstanceLighter::CPredPointLightToPoint::operator()(). |
|
|
Definition at line 228 of file instance_lighter.h. Referenced by NL3D::CInstanceLighter::compilePointLightRT(), CPointLightRT(), and NL3D::CInstanceLighter::processIGPointLightRT(). |