aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a02747.html
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
committerneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
commit0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch)
tree2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02747.html
downloadnevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz
nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip
Initial commit
Diffstat (limited to '')
-rw-r--r--docs/doxygen/nel/a02747.html1349
1 files changed, 1349 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02747.html b/docs/doxygen/nel/a02747.html
new file mode 100644
index 00000000..b4f5882e
--- /dev/null
+++ b/docs/doxygen/nel/a02747.html
@@ -0,0 +1,1349 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>NeL: NL3D::CLightingManager class Reference</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.6 -->
+<div class="qindex"> <form class="search" action="search.php" method="get">
+<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a> | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
+<h1>NL3D::CLightingManager Class Reference</h1><code>#include &lt;<a class="el" href="a05902.html">lighting_manager.h</a>&gt;</code>
+<p>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+Owned by CLightingTrav. This class compute modelContributions. It gets which dynamic light may influence a model, ask to <a class="el" href="a03863.html">ILogicInfo</a> the contribution of staticLights then decides which light are best suitable to influence the model.<p>
+<dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p>
+Nevrax France </dd></dl>
+<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00060">60</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.<table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagera0">CLightingManager</a> (bool bSmallScene)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor (bSmallScene is used to setup size of the grids). <a href="#NL3D_1_1CLightingManagera0"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagera1">computeModelLightContributions</a> (<a class="el" href="a02316.html">CTransform</a> *model, <a class="el" href="a02744.html">CLightContribution</a> &amp;lightContrib, <a class="el" href="a03863.html">ILogicInfo</a> *logicInfo=NULL)</td></tr>
+
+<tr><td colspan="2"><div class="groupHeader">Dynamic Lights localisation.</div></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz334_0">addDynamicLight</a> (<a class="el" href="a03091.html">CPointLight</a> *light)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz334_1">clearDynamicLights</a> ()</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">clear for the pass all the lights. <a href="#NL3D_1_1CLightingManagerz334_1"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>const std::vector&lt; <a class="el" href="a03091.html">CPointLight</a> * &gt; &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz334_2">getAllDynamicLightList</a> () const </td></tr>
+
+<tr><td colspan="2"><div class="groupHeader">Static Lighted Objects Localisation. Used for lights to touch nearest static models.</div></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02749.html">CQGItLightedModel</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz336_0">eraseStaticLightedModel</a> (<a class="el" href="a02749.html">CQGItLightedModel</a> ite)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02749.html">CQGItLightedModel</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz336_1">insertStaticLightedModel</a> (<a class="el" href="a02316.html">CTransform</a> *model)</td></tr>
+
+<tr><td colspan="2"><div class="groupHeader">Parameters</div></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_0">getLightTransitionThreshold</a> () const </td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_1">getMaxLightContribution</a> () const </td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_2">getNoAttLightRadius</a> () const </td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_3">getOutOfAttLightInfFactor</a> () const </td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_4">setLightTransitionThreshold</a> (float lightTransitionThreshold)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_5">setMaxLightContribution</a> (<a class="el" href="a04558.html#a15">uint</a> nlights)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_6">setNoAttLightRadius</a> (float noAttLightRadius)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_7">setOutOfAttLightInfFactor</a> (float outOfAttLightInfFactor)</td></tr>
+
+<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerd0">getDynamicPointLightList</a> (const <a class="el" href="a03128.html">CVector</a> &amp;worldPos, std::vector&lt; <a class="el" href="a03092.html">CPointLightInfluence</a> &gt; &amp;lightList)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">get the list of dynamic light viewed from a position. append to lightList <a href="#NL3D_1_1CLightingManagerd0"></a><br><br></td></tr>
+<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a03091.html">CPointLight</a> * &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerr0">_DynamicLightList</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03273.html">CQuadGrid</a>&lt; <a class="el" href="a02748.html">CPointLightInfo</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a> [4]</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerr2">_LightQuadGridRadiusLimit</a> [4]</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03273.html">CQuadGrid</a>&lt; <a class="el" href="a02316.html">CTransform</a> * &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a> [4]</td></tr>
+
+<tr><td colspan="2"><div class="groupHeader">Parameters.</div></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a></td></tr>
+
+</table>
+<hr><h2>Constructor &amp; Destructor Documentation</h2>
+<a class="anchor" name="NL3D_1_1CLightingManagera0" doxytag="NL3D::CLightingManager::CLightingManager" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> NL3D::CLightingManager::CLightingManager </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">bool&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>bSmallScene</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Constructor (bSmallScene is used to setup size of the grids).
+<p>
+
+<p>
+Definition at line <a class="el" href="a05901.html#l00064">64</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00177">_LightQuadGrid</a>, <a class="el" href="a05902.html#l00179">_LightQuadGridRadiusLimit</a>, <a class="el" href="a05902.html#l00188">_LightTransitionThreshold</a>, <a class="el" href="a05902.html#l00186">_NoAttLightRadius</a>, <a class="el" href="a05902.html#l00187">_OutOfAttLightInfFactor</a>, <a class="el" href="a05902.html#l00176">_StaticLightedModelQuadGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz772_1">NL3D::CQuadGrid&lt; CTransform * &gt;::create()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz772_1">NL3D::CQuadGrid&lt; CPointLightInfo &gt;::create()</a>, <a class="el" href="a05901.html#l00060">NL3D_DEFAULT_LIGHT_TRANSITION_THRESHOLD</a>, <a class="el" href="a05901.html#l00056">NL3D_DEFAULT_NOATT_LIGHT_RADIUS</a>, <a class="el" href="a05901.html#l00058">NL3D_DEFAULT_OUT_OF_ATT_LIGHT_INF_FACTOR</a>, <a class="el" href="a05901.html#l00049">NL3D_LIGHT_QUAD_GRID_ELTSIZE</a>, <a class="el" href="a05901.html#l00052">NL3D_LIGHT_QUAD_GRID_FACTOR</a>, <a class="el" href="a05901.html#l00050">NL3D_LIGHT_QUAD_GRID_RADIUS_LIMIT</a>, <a class="el" href="a05901.html#l00048">NL3D_LIGHT_QUAD_GRID_SIZE</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a05901.html#l00105">setMaxLightContribution()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+<div class="fragment"><pre>00065 {
+00066 <span class="comment">// Init the lightQuadGrids and StaticLightedModelQuadGrid</span>
+00067 <span class="comment">// finer level.</span>
+00068 <a class="code" href="a04558.html#a15">uint</a> qgSize= <a class="code" href="a04478.html#a0">NL3D_LIGHT_QUAD_GRID_SIZE</a>;
+00069 <span class="keywordtype">float</span> eltSize= <a class="code" href="a04478.html#a1">NL3D_LIGHT_QUAD_GRID_ELTSIZE</a>;
+00070 <span class="keywordtype">float</span> radiusLimit= <a class="code" href="a04478.html#a2">NL3D_LIGHT_QUAD_GRID_RADIUS_LIMIT</a>;
+00071
+00072 <span class="keywordflow">if</span> (bSmallScene)
+00073 {
+00074 qgSize = 4;
+00075 }
+00076
+00077 <span class="comment">// for all levels</span>
+00078 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>;i++)
+00079 {
+00080 <span class="comment">// init _LightQuadGrid and _StaticLightedModelQuadGrid</span>
+00081 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a>[i].create(qgSize, eltSize);
+00082 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[i].create(qgSize, eltSize);
+00083 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr2">_LightQuadGridRadiusLimit</a>[i]= radiusLimit;
+00084
+00085 <span class="comment">// coarser quadGrid level</span>
+00086 qgSize/= <a class="code" href="a04478.html#a3">NL3D_LIGHT_QUAD_GRID_FACTOR</a>;
+00087 qgSize= max(qgSize, 1U);
+00088 eltSize*= <a class="code" href="a04478.html#a3">NL3D_LIGHT_QUAD_GRID_FACTOR</a>;
+00089 radiusLimit*= <a class="code" href="a04478.html#a3">NL3D_LIGHT_QUAD_GRID_FACTOR</a>;
+00090 }
+00091
+00092
+00093 <span class="comment">// default paramters</span>
+00094 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a>= <a class="code" href="a04478.html#a4">NL3D_DEFAULT_NOATT_LIGHT_RADIUS</a>;
+00095 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a>= <a class="code" href="a04478.html#a5">NL3D_DEFAULT_OUT_OF_ATT_LIGHT_INF_FACTOR</a>;
+00096 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a>= <a class="code" href="a04478.html#a6">NL3D_DEFAULT_LIGHT_TRANSITION_THRESHOLD</a>;
+00097
+00098
+00099 <span class="comment">// Default number of pointLight on an object.</span>
+00100 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz332_5">setMaxLightContribution</a>(3);
+00101 }
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Member Function Documentation</h2>
+<a class="anchor" name="NL3D_1_1CLightingManagerz334_0" doxytag="NL3D::CLightingManager::addDynamicLight" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void NL3D::CLightingManager::addDynamicLight </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a03091.html">CPointLight</a> *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>light</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+temp add a dynamic light to the manager. light is added to the _LightQuadGrid. This method calls <a class="el" href="a02316.html#NL3D_1_1CWaveMakerModelz1024_5">CTransform::resetLighting()</a> for all models around the light.<p>
+Additionaly light are added to a list (a vector of pointer), see getDynamicLightList()
+<p>
+Definition at line <a class="el" href="a05901.html#l00151">151</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00177">_LightQuadGrid</a>, <a class="el" href="a05902.html#l00179">_LightQuadGridRadiusLimit</a>, <a class="el" href="a05902.html#l00186">_NoAttLightRadius</a>, <a class="el" href="a05902.html#l00176">_StaticLightedModelQuadGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_0">NL3D::CQuadGrid&lt; CTransform * &gt;::begin()</a>, <a class="el" href="a05505.html#l00048">NLMISC::CBSphere::Center</a>, <a class="el" href="a06300.html#l00646">NL3D::CQuadGrid&lt; T &gt;::end()</a>, <a class="el" href="a06180.html#l00143">NL3D::CPointLight::getAttenuationEnd()</a>, <a class="el" href="a05973.html#l00198">NLMISC::CMatrix::getPos()</a>, <a class="el" href="a06180.html#l00116">NL3D::CPointLight::getPosition()</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a05504.html#l00063">NLMISC::CBSphere::include()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_2">NL3D::CQuadGrid&lt; CPointLightInfo &gt;::insert()</a>, <a class="el" href="a05902.html#l00169">NL3D::CLightingManager::CPointLightInfo::Light</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a05505.html#l00049">NLMISC::CBSphere::Radius</a>, <a class="el" href="a06568.html#l00988">NL3D::CTransform::resetLighting()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_3">NL3D::CQuadGrid&lt; CTransform * &gt;::select()</a>, <a class="el" href="a05902.html#l00170">NL3D::CLightingManager::CPointLightInfo::Sphere</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a06182.html#l00084">NL3D::CPointLightModel::traverseLight()</a>.
+<p>
+<div class="fragment"><pre>00152 {
+00153
+00154 <span class="comment">// Insert the light in the quadGrid.</span>
+00155 <span class="comment">//----------</span>
+00156 CPointLightInfo plInfo;
+00157 plInfo.Light= light;
+00158
+00159 <span class="comment">// build the bounding sphere for this light, with the AttenuationEnd of the light</span>
+00160 <span class="keywordtype">float</span> radius=light-&gt;getAttenuationEnd();
+00161 <span class="comment">// if attenuation is disabled (ie getAttenuationEnd() return 0), then have a dummy radius</span>
+00162 <span class="keywordflow">if</span>(radius==0)
+00163 radius= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a>;
+00164 plInfo.Sphere.Center= light-&gt;getPosition();
+00165 plInfo.Sphere.Radius= radius;
+00166
+00167 <span class="comment">// build a bbox, so it includes the sphere</span>
+00168 CVector bbmin= light-&gt;getPosition();
+00169 bbmin-= CVector(radius, radius, radius);
+00170 CVector bbmax= light-&gt;getPosition();
+00171 bbmax+= CVector(radius, radius, radius);
+00172
+00173 <span class="comment">// choose the correct quadgrid according to the radius of the light.</span>
+00174 <a class="code" href="a04558.html#a15">uint</a> qgId;
+00175 <span class="keywordflow">for</span>(qgId= 0; qgId&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>-1; qgId++)
+00176 {
+00177 <span class="comment">// if radius is inferior to the requested radius for this quadGrid, ok!</span>
+00178 <span class="keywordflow">if</span>(radius&lt;<a class="code" href="a02747.html#NL3D_1_1CLightingManagerr2">_LightQuadGridRadiusLimit</a>[qgId])
+00179 <span class="keywordflow">break</span>;
+00180 }
+00181 <span class="comment">// insert this light in the correct quadgrid.</span>
+00182 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a>[qgId].insert(bbmin, bbmax, plInfo);
+00183
+00184
+00185 <span class="comment">// touch the objects around the lights.</span>
+00186 <span class="comment">//----------</span>
+00187
+00188 <span class="comment">// Select the static lightedModels to update around this light.</span>
+00189 <span class="comment">// Use the same level of _StaticLightedModelQuadGrid than me to not select too many squares in the quadGrid</span>
+00190 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[qgId].select(bbmin, bbmax);
+00191 <span class="comment">// For all those models.</span>
+00192 CQuadGrid&lt;CTransform*&gt;::CIterator itModel= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[qgId].begin();
+00193 <span class="keywordflow">while</span>(itModel != _StaticLightedModelQuadGrid[qgId].end() )
+00194 {
+00195 CTransform *model= *itModel;
+00196 <span class="keyword">const</span> CVector &amp;modelPos= model-&gt;getWorldMatrix().getPos();
+00197
+00198 <span class="comment">// test first if this model is in the area of the light.</span>
+00199 <span class="keywordflow">if</span>( plInfo.Sphere.include(modelPos) )
+00200 {
+00201 <span class="comment">// yes, then this model must recompute his lighting, because a dynamic light touch him.</span>
+00202 model-&gt;resetLighting();
+00203 }
+00204
+00205 <span class="comment">// next.</span>
+00206 itModel++;
+00207 }
+00208
+00209
+00210 <span class="comment">// insert the light in the list.</span>
+00211 <span class="comment">//----------</span>
+00212 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr0">_DynamicLightList</a>.push_back(light);
+00213
+00214 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz334_1" doxytag="NL3D::CLightingManager::clearDynamicLights" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void NL3D::CLightingManager::clearDynamicLights </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+clear for the pass all the lights.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05901.html#l00137">137</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00177">_LightQuadGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_0">NL3D::CQuadGrid&lt; CPointLightInfo &gt;::clear()</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a05897.html#l00068">NL3D::CLightTrav::traverse()</a>.
+<p>
+<div class="fragment"><pre>00138 {
+00139 <span class="comment">// for all levels</span>
+00140 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>;i++)
+00141 {
+00142 <span class="comment">// clear all the lights in the quadGrid.</span>
+00143 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a>[i].clear();
+00144 }
+00145
+00146 <span class="comment">// clear the list.</span>
+00147 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr0">_DynamicLightList</a>.clear();
+00148 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagera1" doxytag="NL3D::CLightingManager::computeModelLightContributions" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void NL3D::CLightingManager::computeModelLightContributions </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a02316.html">CTransform</a> *&nbsp;</td>
+ <td class="mdname" nowrap> <em>model</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap><a class="el" href="a02744.html">CLightContribution</a> &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>lightContrib</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap><a class="el" href="a03863.html">ILogicInfo</a> *&nbsp;</td>
+ <td class="mdname" nowrap> <em>logicInfo</em> = NULL</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+get the description of nearsest lights viewed for this model. Dynamic lights are parsed to get list of lights, and ILogicInfo-&gt;getStaticLightDesc() is parsed too. Then, maxLights are returned, which may be a blended result of max influence light.<p>
+NB: model-&gt;_LightContribution is filled with real contributions of lights. NB: model is append to the _LightedModelList of each contributed light NB: this list is valid until model-&gt;isNeedUpdateLighting() is true.
+<p>
+Definition at line <a class="el" href="a05901.html#l00256">256</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00188">_LightTransitionThreshold</a>, <a class="el" href="a05902.html#l00185">_MaxLightContribution</a>, <a class="el" href="a05902.html#l00187">_OutOfAttLightInfFactor</a>, <a class="el" href="a06179.html#l00409">NL3D::CPointLight::appendLightedModel()</a>, <a class="el" href="a05894.html#l00073">NL3D::CLightContribution::AttFactor</a>, <a class="el" href="a06340.html#l00338">NLMISC::CRGBA::B</a>, <a class="el" href="a06340.html#l00659">NLMISC::CRGBAF::B</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a06179.html#l00267">NL3D::CPointLight::computeLinearAttenuation()</a>, <a class="el" href="a05894.html#l00071">NL3D::CLightContribution::Factor</a>, <a class="el" href="a05894.html#l00079">NL3D::CLightContribution::FrozenStaticLightSetup</a>, <a class="el" href="a06340.html#l00336">NLMISC::CRGBA::G</a>, <a class="el" href="a06340.html#l00657">NLMISC::CRGBAF::G</a>, <a class="el" href="a06180.html#l00129">NL3D::CPointLight::getAmbient()</a>, <a class="el" href="a06180.html#l00141">NL3D::CPointLight::getAttenuationBegin()</a>, <a class="el" href="a06180.html#l00143">NL3D::CPointLight::getAttenuationEnd()</a>, <a class="el" href="a06180.html#l00131">NL3D::CPointLight::getDiffuse()</a>, <a class="el" href="a05901.html#l00525">getDynamicPointLightList()</a>, <a class="el" href="a06569.html#l00381">NL3D::CTransform::getLightHotSpotInWorld()</a>, <a class="el" href="a06180.html#l00116">NL3D::CPointLight::getPosition()</a>, <a class="el" href="a03863.html#NL3D_1_1ILogicInfoa0">NL3D::ILogicInfo::getStaticLightSetup()</a>, <a class="el" href="a06179.html#l00138">NL3D::CPointLight::getType()</a>, <a class="el" href="a05894.html#l00075">NL3D::CLightContribution::LocalAmbient</a>, <a class="el" href="a05894.html#l00096">NL3D::CLightContribution::MergedPointLight</a>, <a class="el" href="a05894.html#l00042">NL3D_MAX_LIGHT_CONTRIBUTION</a>, <a class="el" href="a05894.html#l00084">NL3D::CLightContribution::NumFrozenStaticLight</a>, <a class="el" href="a05701.html#l00125">NLMISC::OptFastFloor()</a>, <a class="el" href="a05894.html#l00067">NL3D::CLightContribution::PointLight</a>, <a class="el" href="a06340.html#l00334">NLMISC::CRGBA::R</a>, <a class="el" href="a06340.html#l00655">NLMISC::CRGBAF::R</a>, <a class="el" href="a06339.html#l00066">NLMISC::CRGBA::set()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05894.html#l00086">NL3D::CLightContribution::SunContribution</a>, <a class="el" href="a05894.html#l00069">NL3D::CLightContribution::TransformIterator</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05894.html#l00088">NL3D::CLightContribution::UseMergedPointLight</a>, and <a class="el" href="a05646.html#l00237">v</a>.
+<p>
+Referenced by <a class="el" href="a06568.html#l01080">NL3D::CTransform::traverseLight()</a>.
+<p>
+<div class="fragment"><pre>00258 {
+00259 <a class="code" href="a04558.html#a14">sint</a> i;
+00260
+00261 <span class="comment">// This is the list of light which touch this model.</span>
+00262 <span class="keyword">static</span> std::vector&lt;CPointLightInfluence&gt; lightList;
+00263 <span class="comment">// static, for malloc perf.</span>
+00264 lightList.clear();
+00265
+00266 <span class="comment">// the position of the model.</span>
+00267 CVector modelPos;
+00268 <span class="keywordtype">float</span> modelRadius;
+00269
+00270 <span class="comment">// depends on model</span>
+00271 model-&gt;getLightHotSpotInWorld(modelPos, modelRadius);
+00272
+00273 <span class="comment">// First pass, fill the list of light which touch this model.</span>
+00274 <span class="comment">//=========</span>
+00275 <span class="comment">// get the dynamic lights around the model</span>
+00276 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerd0">getDynamicPointLightList</a>(modelPos, lightList);
+00277
+00278 <span class="comment">// if not already precomputed, append staticLights to this list.</span>
+00279 <span class="keywordflow">if</span>( !lightContrib.FrozenStaticLightSetup )
+00280 {
+00281 <span class="comment">// If no logicInfo provided</span>
+00282 <span class="keywordflow">if</span>(!logicInfo)
+00283 {
+00284 <span class="comment">// Default: suppose full SunLight and no PointLights.</span>
+00285 lightContrib.SunContribution= 255;
+00286 <span class="comment">// Take full SunAmbient.</span>
+00287 lightContrib.LocalAmbient.set(0,0,0,0);
+00288 <span class="comment">// do not append any pointLight to the setup</span>
+00289 }
+00290 <span class="keywordflow">else</span>
+00291 {
+00292 <span class="comment">// NB: SunContribution is computed by logicInfo</span>
+00293 logicInfo-&gt;getStaticLightSetup(lightList, lightContrib.SunContribution, lightContrib.LocalAmbient);
+00294 }
+00295 }
+00296
+00297 <span class="comment">// Second pass, in the lightList, choose the best suited light to lit this model</span>
+00298 <span class="comment">//=========</span>
+00299
+00300 <span class="comment">// for each light, modulate the factor of influence</span>
+00301 <span class="keywordflow">for</span>(i=0; i&lt;(<a class="code" href="a04558.html#a14">sint</a>)lightList.size();i++)
+00302 {
+00303 CPointLight *pl= lightList[i].PointLight;
+00304
+00305 <span class="comment">// get the distance from the light to the model</span>
+00306 <span class="keywordtype">float</span> dist= (pl-&gt;getPosition() - modelPos).norm();
+00307 <span class="keywordtype">float</span> distMinusRadius= dist - modelRadius;
+00308
+00309 <span class="comment">// modulate the factor by the distance and the attenuation distance.</span>
+00310 <span class="keywordtype">float</span> inf;
+00311 <span class="keywordtype">float</span> attBegin= pl-&gt;getAttenuationBegin();
+00312 <span class="keywordtype">float</span> attEnd= pl-&gt;getAttenuationEnd();
+00313 <span class="comment">// if no attenuation</span>
+00314 <span class="keywordflow">if</span>( attEnd==0 )
+00315 {
+00316 <span class="comment">// influence is awlays 1.</span>
+00317 inf= 1;
+00318
+00319 <span class="comment">// If SpotLight, must modulate with SpotAttenuation.</span>
+00320 <span class="keywordflow">if</span>(pl-&gt;getType() == CPointLight::SpotLight)
+00321 inf*= pl-&gt;computeLinearAttenuation(modelPos, dist, modelRadius);
+00322 }
+00323 <span class="keywordflow">else</span>
+00324 {
+00325 <span class="comment">// if correct attenuation radius</span>
+00326 <span class="keywordflow">if</span>(distMinusRadius&lt;attBegin)
+00327 {
+00328 <span class="comment">// NB: we are sure that attBegin&gt;0, because dist&gt;=0.</span>
+00329 <span class="comment">// if &lt; attBegin, inf should be ==1, but must select the nearest lights; for better</span>
+00330 <span class="comment">// understanding of the scene</span>
+00331 inf= 1 + <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a> * (attBegin - distMinusRadius); <span class="comment">// inf E [1, +oo[</span>
+00332 <span class="comment">// NB: this formula favour big lights (ie light with big attBegin).</span>
+00333
+00334 <span class="comment">// If SpotLight, must modulate with SpotAttenuation.</span>
+00335 <span class="keywordflow">if</span>(pl-&gt;getType() == CPointLight::SpotLight)
+00336 inf*= pl-&gt;computeLinearAttenuation(modelPos, dist, modelRadius);
+00337 }
+00338 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(distMinusRadius&lt;attEnd)
+00339 {
+00340 <span class="comment">// we are sure attEnd-attBegin&gt;0 because of the test</span>
+00341 <span class="comment">// compute influence of the light: attenuation and SpotAttenuation</span>
+00342 inf= pl-&gt;computeLinearAttenuation(modelPos, dist, modelRadius);
+00343 }
+00344 <span class="keywordflow">else</span>
+00345 {
+00346 <span class="comment">// if &gt;= attEnd, inf should be ==0, but must select the nearest lights; for better</span>
+00347 <span class="comment">// understanding of the scene</span>
+00348 inf= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a> * (attEnd - distMinusRadius); <span class="comment">// inf E ]-oo, 0]</span>
+00349 }
+00350 }
+00351
+00352 <span class="comment">// modulate the influence with this factor</span>
+00353 lightList[i].BkupInfluence= lightList[i].Influence;
+00354 lightList[i].Influence*= inf;
+00355
+00356 <span class="comment">// Bkup distance to model.</span>
+00357 lightList[i].DistanceToModel= dist;
+00358 }
+00359
+00360 <span class="comment">// sort the light by influence</span>
+00361 sort(lightList.begin(), lightList.end());
+00362
+00363 <span class="comment">// prepare Light Merging.</span>
+00364 <span class="keyword">static</span> std::vector&lt;float&gt; lightToMergeWeight;
+00365 lightToMergeWeight.clear();
+00366 lightToMergeWeight.resize(lightList.size(), 1);
+00367
+00368
+00369 <span class="comment">// and choose only max light.</span>
+00370 <a class="code" href="a04558.html#a15">uint</a> startId= 0;
+00371 <a class="code" href="a04558.html#a15">uint</a> ligthSrcId= 0;
+00372 <span class="comment">// skip already setuped light (statically)</span>
+00373 <span class="keywordflow">if</span>(lightContrib.FrozenStaticLightSetup)
+00374 startId= lightContrib.NumFrozenStaticLight;
+00375
+00376 <span class="comment">// If there is still place for unFrozen static lights or dynamic lights.</span>
+00377 <span class="keywordflow">if</span>(startId &lt; <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>)
+00378 {
+00379 <span class="comment">// setup the transition.</span>
+00380 <span class="keywordtype">float</span> deltaMinInfluence= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a>;
+00381 <span class="keywordtype">float</span> minInfluence= 0;
+00382 <a class="code" href="a04558.html#a14">sint</a> doMerge= 0;
+00383 <a class="code" href="a04558.html#a14">sint</a> firstLightToMergeFull= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>-startId;
+00384 <span class="comment">// If there is more light than we can accept in not merged mode, Must merge</span>
+00385 <span class="keywordflow">if</span>((<a class="code" href="a04558.html#a14">sint</a>)lightList.size() &gt; firstLightToMergeFull)
+00386 {
+00387 doMerge= 1;
+00388 <span class="comment">// the minInfluence is the influence of the first light not taken.</span>
+00389 minInfluence= lightList[firstLightToMergeFull].Influence;
+00390 <span class="comment">// but must still be &gt;=0.</span>
+00391 minInfluence= max(minInfluence, 0.f);
+00392 }
+00393 <span class="comment">// Any light under this minInfluence+deltaMinInfluence will be smoothly darken.</span>
+00394 <span class="keywordtype">float</span> minInfluenceStart = minInfluence + deltaMinInfluence;
+00395 <span class="keywordtype">float</span> OOdeltaMinInfluence= 1.0f / deltaMinInfluence;
+00396 <span class="comment">/* NB: this is not an error if we have only 3 light for example (assuming _MaxLightContribution=3), </span>
+00397 <span class="comment"> and still have minInfluenceStart&gt;0.</span>
+00398 <span class="comment"> It's to have a continuity in the case of for example we have 3 lights in lightLists at frame T0, </span>
+00399 <span class="comment"> resulting in "doMerge=0" and at frame T1 we have 4 lights, the farthest having an influence of 0 </span>
+00400 <span class="comment"> or nearly 0.</span>
+00401 <span class="comment"> */</span>
+00402
+00403 <span class="comment">// fill maxLight at max.</span>
+00404 <span class="keywordflow">for</span>(i=startId;i&lt;(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>; i++)
+00405 {
+00406 <span class="comment">// if not so many pointLights found, end!!</span>
+00407 <span class="keywordflow">if</span>(ligthSrcId&gt;=lightList.size())
+00408 <span class="keywordflow">break</span>;
+00409 <span class="keywordflow">else</span>
+00410 {
+00411 CPointLight *pl= lightList[ligthSrcId].PointLight;
+00412 <span class="keywordtype">float</span> inf= lightList[ligthSrcId].Influence;
+00413 <span class="keywordtype">float</span> bkupInf= lightList[ligthSrcId].BkupInfluence;
+00414 <span class="keywordtype">float</span> distToModel= lightList[ligthSrcId].DistanceToModel;
+00415 <span class="comment">// else fill it.</span>
+00416 lightContrib.PointLight[i]= pl;
+00417
+00418 <span class="comment">// Compute the Final factor of influence of the light.</span>
+00419 <span class="keywordflow">if</span>(inf &gt;= minInfluenceStart)
+00420 {
+00421 <span class="comment">// For Static LightSetup BiLinear to work correctly, modulate with BkupInfluence</span>
+00422 <span class="comment">// don't worry about the precision of floor, because of *255.</span>
+00423 lightContrib.Factor[i]= (<a class="code" href="a04558.html#a7">uint8</a>)<a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>(bkupInf*255);
+00424 <span class="comment">// Indicate that this light don't need to be merged at all!</span>
+00425 lightToMergeWeight[ligthSrcId]= 0;
+00426 }
+00427 <span class="keywordflow">else</span>
+00428 {
+00429 <span class="keywordtype">float</span> f= (inf-minInfluence) * OOdeltaMinInfluence;
+00430 <span class="comment">// For Static LightSetup BiLinear to work correctly, modulate with BkupInfluence</span>
+00431 <span class="comment">// don't worry about the precision of floor, because of *255.</span>
+00432 <a class="code" href="a04558.html#a14">sint</a> fi= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>( bkupInf*f*255 );
+00433 <a class="code" href="a05378.html#a374">clamp</a>(fi, 0, 255);
+00434 lightContrib.Factor[i]= fi;
+00435 <span class="comment">// The rest of the light contribution is to be merged.</span>
+00436 lightToMergeWeight[ligthSrcId]= 1-f;
+00437 }
+00438
+00439 <span class="comment">// Compute the Final Att factor for models using Global Attenuation. NB: modulate with Factor</span>
+00440 <span class="comment">// don't worry about the precision of floor, because of *255.</span>
+00441 <span class="comment">// NB: compute att on the center of the model =&gt; modelRadius==0</span>
+00442 <a class="code" href="a04558.html#a14">sint</a> attFactor= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>( lightContrib.Factor[i] * pl-&gt;computeLinearAttenuation(modelPos, distToModel) );
+00443 lightContrib.AttFactor[i]= (<a class="code" href="a04558.html#a7">uint8</a>)attFactor;
+00444
+00445 <span class="comment">// must append this lightedModel to the list in the light.</span>
+00446 lightContrib.TransformIterator[i]= pl-&gt;appendLightedModel(model);
+00447
+00448 <span class="comment">// next light.</span>
+00449 ligthSrcId++;
+00450 }
+00451 }
+00452
+00453 <span class="comment">// Compute LightToMerge.</span>
+00454 <span class="keywordflow">if</span>(doMerge)
+00455 {
+00456 <a class="code" href="a03338.html">CRGBAF</a> mergedAmbient(0,0,0);
+00457 <a class="code" href="a04558.html#a15">uint</a> j;
+00458
+00459 <span class="comment">// For all lights in the lightList, merge Diffuse and Ambient term to mergedAmbient.</span>
+00460 <span class="keywordflow">for</span>(j=0;j&lt;lightToMergeWeight.size();j++)
+00461 {
+00462 <span class="keywordflow">if</span>(lightToMergeWeight[j] &amp;&amp; lightList[j].Influence&gt;0)
+00463 {
+00464 CPointLight *pl= lightList[j].PointLight;
+00465
+00466 <span class="comment">// Get the original influence (ie for static PLs, biLinear influence)</span>
+00467 <span class="keywordtype">float</span> bkupInf= lightList[j].BkupInfluence;
+00468 <span class="comment">// Get the attenuation of the pointLight to the model</span>
+00469 <span class="keywordtype">float</span> distToModel= lightList[j].DistanceToModel;
+00470 <span class="keywordtype">float</span> attInf= pl-&gt;computeLinearAttenuation(modelPos, distToModel);
+00471 <span class="comment">// Attenuate the color of the light by biLinear and distance/spot attenuation.</span>
+00472 <span class="keywordtype">float</span> lightInf= attInf * bkupInf;
+00473 <span class="comment">// Modulate also by the percentage to merge </span>
+00474 lightInf*= lightToMergeWeight[j];
+00475 <span class="comment">// Add the full ambient term of the light, attenuated by light attenuation and WeightMerge</span>
+00476 mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo3">R</a>+= pl-&gt;getAmbient().R * lightInf;
+00477 mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo2">G</a>+= pl-&gt;getAmbient().G * lightInf;
+00478 mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo1">B</a>+= pl-&gt;getAmbient().B * lightInf;
+00479 <span class="comment">// Add 0.25f of the diffuse term of the light, attenuated by light attenuation and WeightMerge</span>
+00480 <span class="comment">// mul by 0.25f, because this is the averaged contribution of the diffuse part of a </span>
+00481 <span class="comment">// light to a sphere (do the maths...).</span>
+00482 <span class="keywordtype">float</span> f= lightInf*0.25f;
+00483 mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo3">R</a>+= pl-&gt;getDiffuse().R * f;
+00484 mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo2">G</a>+= pl-&gt;getDiffuse().G * f;
+00485 mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo1">B</a>+= pl-&gt;getDiffuse().B * f;
+00486 }
+00487 }
+00488
+00489
+00490 <span class="comment">// Setup the merged Light</span>
+00491 <a class="code" href="a03337.html">CRGBA</a> amb;
+00492 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a576">v</a>;
+00493 <span class="comment">// Because of floating point error, it appears that sometime result may be slightly below 0. </span>
+00494 <span class="comment">// =&gt; clamp necessary</span>
+00495 <a class="code" href="a04223.html#a576">v</a>= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>(mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo3">R</a>); fastClamp8(v); amb.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>= <a class="code" href="a04223.html#a576">v</a>;
+00496 <a class="code" href="a04223.html#a576">v</a>= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>(mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo2">G</a>); fastClamp8(v); amb.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>= <a class="code" href="a04223.html#a576">v</a>;
+00497 <a class="code" href="a04223.html#a576">v</a>= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>(mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo1">B</a>); fastClamp8(v); amb.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>= <a class="code" href="a04223.html#a576">v</a>;
+00498 lightContrib.MergedPointLight= amb;
+00499
+00500 <span class="comment">// Indicate we use the merged pointLight =&gt; the model must recompute lighting each frame</span>
+00501 lightContrib.UseMergedPointLight= <span class="keyword">true</span>;
+00502 }
+00503 <span class="keywordflow">else</span>
+00504 {
+00505 <span class="comment">// If the model is freezeHRC(), need to test each frame only if MergedPointLight is used.</span>
+00506 lightContrib.UseMergedPointLight= <span class="keyword">false</span>;
+00507 }
+00508 }
+00509 <span class="keywordflow">else</span>
+00510 {
+00511 <span class="comment">// point to end the list</span>
+00512 i= startId;
+00513 }
+00514
+00515 <span class="comment">// End the list.</span>
+00516 <span class="keywordflow">if</span>(i&lt;<a class="code" href="a04471.html#a0">NL3D_MAX_LIGHT_CONTRIBUTION</a>)
+00517 {
+00518 lightContrib.PointLight[i]= NULL;
+00519 }
+00520
+00521 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz336_0" doxytag="NL3D::CLightingManager::eraseStaticLightedModel" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a02749.html">CLightingManager::CQGItLightedModel</a> NL3D::CLightingManager::eraseStaticLightedModel </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a02749.html">CQGItLightedModel</a>&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>ite</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+erase a lighted object to the _StaticLightedModelQuadGrid. must do it at deletion of the model or when it leaves freeHRC state. NB: default <a class="el" href="a02749.html">CQGItLightedModel</a> (ie NULL) can be passed in. <dl compact><dt><b>Returns:</b></dt><dd>quadgrid.end(), ie NULL iterator.</dd></dl>
+
+<p>
+Definition at line <a class="el" href="a05901.html#l00217">217</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00176">_StaticLightedModelQuadGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_1">NL3D::CQuadGrid&lt; CTransform * &gt;::erase()</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a05902.html#l00068">NL3D::CLightingManager::CQGItLightedModel::QgItes</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a06568.html#l00406">NL3D::CTransform::unfreezeHRC()</a>, <a class="el" href="a06568.html#l00450">NL3D::CTransform::update()</a>, and <a class="el" href="a06568.html#l00143">NL3D::CTransform::~CTransform()</a>.
+<p>
+<div class="fragment"><pre>00218 {
+00219 <span class="comment">// Erase the iterator for all levels</span>
+00220 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>;i++)
+00221 {
+00222 <span class="comment">// NB: it is possible here that the iterator is NULL (ie end()).</span>
+00223 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[i].erase(ite.QgItes[i]);
+00224 }
+00225
+00226 <span class="comment">// return end(), ie NULL iterators</span>
+00227 <span class="keywordflow">return</span> CQGItLightedModel();
+00228 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz334_2" doxytag="NL3D::CLightingManager::getAllDynamicLightList" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> const std::vector&lt;<a class="el" href="a03091.html">CPointLight</a>*&gt;&amp; NL3D::CLightingManager::getAllDynamicLightList </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap> const<code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+retrieve (for this pass only) list of all pointLights visible in scene
+<p>
+Definition at line <a class="el" href="a05902.html#l00126">126</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05870.html#l00143">NL3D::CLandscapeModel::clipAndRenderLandscape()</a>.
+<p>
+<div class="fragment"><pre>00126 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr0">_DynamicLightList</a>;}
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerd0" doxytag="NL3D::CLightingManager::getDynamicPointLightList" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void NL3D::CLightingManager::getDynamicPointLightList </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>worldPos</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>std::vector&lt; <a class="el" href="a03092.html">CPointLightInfluence</a> &gt; &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>lightList</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"><code> [private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+get the list of dynamic light viewed from a position. append to lightList
+<p>
+
+<p>
+Definition at line <a class="el" href="a05901.html#l00525">525</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00177">_LightQuadGrid</a>, <a class="el" href="a06300.html#l00641">NL3D::CQuadGrid&lt; T &gt;::begin()</a>, <a class="el" href="a06300.html#l00646">NL3D::CQuadGrid&lt; T &gt;::end()</a>, <a class="el" href="a06181.html#l00051">NL3D::CPointLightInfluence::Influence</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a06181.html#l00049">NL3D::CPointLightInfluence::PointLight</a>, <a class="el" href="a06300.html#l00613">NL3D::CQuadGrid&lt; T &gt;::select()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a05901.html#l00256">computeModelLightContributions()</a>.
+<p>
+<div class="fragment"><pre>00526 {
+00527 <span class="comment">// For all quadGrids.</span>
+00528 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> qgId=0; qgId&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>; qgId++)
+00529 {
+00530 CQuadGrid&lt;CPointLightInfo&gt; &amp;quadGrid= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a>[qgId];
+00531
+00532 <span class="comment">// select the lights around this position in the quadGrids.</span>
+00533 quadGrid.select(worldPos, worldPos);
+00534
+00535 <span class="comment">// for all possible found lights</span>
+00536 CQuadGrid&lt;CPointLightInfo&gt;::CIterator itLight;
+00537 <span class="keywordflow">for</span>(itLight= quadGrid.begin(); itLight!=quadGrid.end(); itLight++)
+00538 {
+00539 <span class="comment">// verify it includes the entity</span>
+00540 <span class="keywordflow">if</span>( (*itLight).Sphere.include(worldPos) )
+00541 {
+00542 <span class="comment">// ok, insert in list.</span>
+00543 CPointLightInfluence pli;
+00544 pli.PointLight= (*itLight).Light;
+00545 <span class="comment">// No special Influence degradation scheme for Dynamic lighting</span>
+00546 pli.Influence= 1;
+00547 lightList.push_back( pli );
+00548 }
+00549 }
+00550 }
+00551 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz332_0" doxytag="NL3D::CLightingManager::getLightTransitionThreshold" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float NL3D::CLightingManager::getLightTransitionThreshold </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap> const<code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00109">109</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+References <a class="el" href="a05902.html#l00188">_LightTransitionThreshold</a>.
+<p>
+Referenced by <a class="el" href="a06348.html#l00903">NL3D::CScene::getLightTransitionThreshold()</a>.
+<p>
+<div class="fragment"><pre>00109 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a>;}
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz332_1" doxytag="NL3D::CLightingManager::getMaxLightContribution" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NL3D::CLightingManager::getMaxLightContribution </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap> const<code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00084">84</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+References <a class="el" href="a05902.html#l00185">_MaxLightContribution</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a06348.html#l00894">NL3D::CScene::getMaxLightContribution()</a>.
+<p>
+<div class="fragment"><pre>00084 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>;}
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz332_2" doxytag="NL3D::CLightingManager::getNoAttLightRadius" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float NL3D::CLightingManager::getNoAttLightRadius </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap> const<code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00091">91</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+References <a class="el" href="a05902.html#l00186">_NoAttLightRadius</a>.
+<p>
+<div class="fragment"><pre>00091 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a>;}
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz332_3" doxytag="NL3D::CLightingManager::getOutOfAttLightInfFactor" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float NL3D::CLightingManager::getOutOfAttLightInfFactor </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap> const<code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00098">98</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+References <a class="el" href="a05902.html#l00187">_OutOfAttLightInfFactor</a>.
+<p>
+<div class="fragment"><pre>00098 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a>;}
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz336_1" doxytag="NL3D::CLightingManager::insertStaticLightedModel" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a02749.html">CLightingManager::CQGItLightedModel</a> NL3D::CLightingManager::insertStaticLightedModel </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a02316.html">CTransform</a> *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>model</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+insert a lighted object to the _StaticLightedModelQuadGrid. must not be inserted before must do it only for static objects, ie when freeHRC state is validated (see <a class="el" href="a02316.html#NL3D_1_1CWaveMakerModelz1017_4">CTransform::update()</a>) NB: only lightable models with no AncestorSkeletonModel should be inserted
+<p>
+Definition at line <a class="el" href="a05901.html#l00231">231</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00176">_StaticLightedModelQuadGrid</a>, <a class="el" href="a05973.html#l00198">NLMISC::CMatrix::getPos()</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_2">NL3D::CQuadGrid&lt; CTransform * &gt;::insert()</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a05902.html#l00068">NL3D::CLightingManager::CQGItLightedModel::QgItes</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a06568.html#l00450">NL3D::CTransform::update()</a>.
+<p>
+<div class="fragment"><pre>00232 {
+00233 CQGItLightedModel ite;
+00234 <span class="keyword">const</span> CVector &amp;worldPos= model-&gt;getWorldMatrix().getPos();
+00235
+00236 <span class="comment">// Insert the models in all levels, because addDynamicLight() may choose the best suited level to select</span>
+00237 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>;i++)
+00238 {
+00239 ite.QgItes[i]= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[i].insert(worldPos, worldPos, model);
+00240 }
+00241
+00242 <span class="comment">// return the iterator</span>
+00243 <span class="keywordflow">return</span> ite;
+00244 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz332_4" doxytag="NL3D::CLightingManager::setLightTransitionThreshold" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void NL3D::CLightingManager::setLightTransitionThreshold </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">float&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>lightTransitionThreshold</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Advanced. When a model is influenced by more light than allowed, or when it reach the limits of the light (attenuationEnd), the light can be darkened according to some threshold. The resultLightColor begin to fade when distModelToLight== attEnd- threshold*(attEnd-attBegin). when distModelToLight== 0, resultLightColor==Black. By default, this value is 0.1f. Setting higher values will smooth transition but will generally darken the global effects of lights. NB: clamp(value, 0, 1);
+<p>
+Definition at line <a class="el" href="a05901.html#l00128">128</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00188">_LightTransitionThreshold</a>, and <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>.
+<p>
+Referenced by <a class="el" href="a06348.html#l00899">NL3D::CScene::setLightTransitionThreshold()</a>.
+<p>
+<div class="fragment"><pre>00129 {
+00130 <a class="code" href="a05378.html#a374">clamp</a>(lightTransitionThreshold, 0.f, 1.f);
+00131 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a>= lightTransitionThreshold;
+00132 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz332_5" doxytag="NL3D::CLightingManager::setMaxLightContribution" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void NL3D::CLightingManager::setMaxLightContribution </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>nlights</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+set the max number of point light that can influence a model. NB: clamped by NL3D_MAX_LIGHT_CONTRIBUTION Default is 3. NB: the sun contribution is not taken into account
+<p>
+Definition at line <a class="el" href="a05901.html#l00105">105</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00185">_MaxLightContribution</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05894.html#l00042">NL3D_MAX_LIGHT_CONTRIBUTION</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a05901.html#l00064">CLightingManager()</a>, and <a class="el" href="a06348.html#l00890">NL3D::CScene::setMaxLightContribution()</a>.
+<p>
+<div class="fragment"><pre>00106 {
+00107 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>= <a class="code" href="a04061.html#a0">min</a>(nlights, (<a class="code" href="a04558.html#a15">uint</a>)NL3D_MAX_LIGHT_CONTRIBUTION);
+00108 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz332_6" doxytag="NL3D::CLightingManager::setNoAttLightRadius" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void NL3D::CLightingManager::setNoAttLightRadius </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">float&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>noAttLightRadius</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Advanced. When a light has no attenuation, it's still inserted in a quadgrid with some radius and won't influence models beyond. You can setup this radius with this method. Default is 1000m. NB: <a class="el" href="a04199.html#a6">nlassert(noAttLightRadius&gt;0)</a>;
+<p>
+Definition at line <a class="el" href="a05901.html#l00112">112</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00186">_NoAttLightRadius</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>.
+<p>
+<div class="fragment"><pre>00113 {
+00114 <a class="code" href="a04199.html#a6">nlassert</a>(noAttLightRadius&gt;0);
+00115 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a>= noAttLightRadius;
+00116 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz332_7" doxytag="NL3D::CLightingManager::setOutOfAttLightInfFactor" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void NL3D::CLightingManager::setOutOfAttLightInfFactor </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">float&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>outOfAttLightInfFactor</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Advanced. When a model is out of [AttBegin, AttEnd] of a light, the computed influence of the light used to choose "best lights" is not constant, and is a function of distance multiplied by a factor you can setup here. Default is 0.1f and is good for lights with att like (50, 100) (arbitrary).
+<p>
+Definition at line <a class="el" href="a05901.html#l00120">120</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
+<p>
+References <a class="el" href="a05902.html#l00187">_OutOfAttLightInfFactor</a>.
+<p>
+<div class="fragment"><pre>00121 {
+00122 outOfAttLightInfFactor= max(0.f, outOfAttLightInfFactor);
+00123 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a>= outOfAttLightInfFactor;
+00124 }
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Field Documentation</h2>
+<a class="anchor" name="NL3D_1_1CLightingManagerr0" doxytag="NL3D::CLightingManager::_DynamicLightList" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> std::vector&lt;<a class="el" href="a03091.html">CPointLight</a>*&gt; <a class="el" href="a02747.html#NL3D_1_1CLightingManagerr0">NL3D::CLightingManager::_DynamicLightList</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00181">181</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerr1" doxytag="NL3D::CLightingManager::_LightQuadGrid" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a03273.html">CQuadGrid</a>&lt;<a class="el" href="a02748.html">CPointLightInfo</a>&gt; <a class="el" href="a02747.html#NL3D_1_1CLightingManagerr1">NL3D::CLightingManager::_LightQuadGrid</a>[ 4 ]<code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00177">177</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05901.html#l00151">addDynamicLight()</a>, <a class="el" href="a05901.html#l00137">clearDynamicLights()</a>, <a class="el" href="a05901.html#l00064">CLightingManager()</a>, and <a class="el" href="a05901.html#l00525">getDynamicPointLightList()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerr2" doxytag="NL3D::CLightingManager::_LightQuadGridRadiusLimit" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float <a class="el" href="a02747.html#NL3D_1_1CLightingManagerr2">NL3D::CLightingManager::_LightQuadGridRadiusLimit</a>[ 4 ]<code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00179">179</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05901.html#l00151">addDynamicLight()</a>, and <a class="el" href="a05901.html#l00064">CLightingManager()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz338_0" doxytag="NL3D::CLightingManager::_LightTransitionThreshold" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float <a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_0">NL3D::CLightingManager::_LightTransitionThreshold</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00188">188</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05901.html#l00064">CLightingManager()</a>, <a class="el" href="a05901.html#l00256">computeModelLightContributions()</a>, <a class="el" href="a05902.html#l00109">getLightTransitionThreshold()</a>, and <a class="el" href="a05901.html#l00128">setLightTransitionThreshold()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz338_1" doxytag="NL3D::CLightingManager::_MaxLightContribution" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_1">NL3D::CLightingManager::_MaxLightContribution</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00185">185</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05901.html#l00256">computeModelLightContributions()</a>, <a class="el" href="a05902.html#l00084">getMaxLightContribution()</a>, and <a class="el" href="a05901.html#l00105">setMaxLightContribution()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz338_2" doxytag="NL3D::CLightingManager::_NoAttLightRadius" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float <a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_2">NL3D::CLightingManager::_NoAttLightRadius</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00186">186</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05901.html#l00151">addDynamicLight()</a>, <a class="el" href="a05901.html#l00064">CLightingManager()</a>, <a class="el" href="a05902.html#l00091">getNoAttLightRadius()</a>, and <a class="el" href="a05901.html#l00112">setNoAttLightRadius()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerz338_3" doxytag="NL3D::CLightingManager::_OutOfAttLightInfFactor" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float <a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_3">NL3D::CLightingManager::_OutOfAttLightInfFactor</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00187">187</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05901.html#l00064">CLightingManager()</a>, <a class="el" href="a05901.html#l00256">computeModelLightContributions()</a>, <a class="el" href="a05902.html#l00098">getOutOfAttLightInfFactor()</a>, and <a class="el" href="a05901.html#l00120">setOutOfAttLightInfFactor()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CLightingManagerr3" doxytag="NL3D::CLightingManager::_StaticLightedModelQuadGrid" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a03273.html">CQuadGrid</a>&lt;<a class="el" href="a02316.html">CTransform</a>*&gt; <a class="el" href="a02747.html#NL3D_1_1CLightingManagerr3">NL3D::CLightingManager::_StaticLightedModelQuadGrid</a>[ 4 ]<code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05902.html#l00176">176</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05901.html#l00151">addDynamicLight()</a>, <a class="el" href="a05901.html#l00064">CLightingManager()</a>, <a class="el" href="a05901.html#l00217">eraseStaticLightedModel()</a>, and <a class="el" href="a05901.html#l00231">insertStaticLightedModel()</a>. </td>
+ </tr>
+</table>
+<hr>The documentation for this class was generated from the following files:<ul>
+<li><a class="el" href="a05902.html">lighting_manager.h</a><li><a class="el" href="a05901.html">lighting_manager.cpp</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:49:30 2004 for NeL by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.6 </small></address>
+</body>
+</html>