diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02675.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to 'docs/doxygen/nel/a02675.html')
-rw-r--r-- | docs/doxygen/nel/a02675.html | 3380 |
1 files changed, 3380 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02675.html b/docs/doxygen/nel/a02675.html new file mode 100644 index 00000000..355aa5f8 --- /dev/null +++ b/docs/doxygen/nel/a02675.html @@ -0,0 +1,3380 @@ +<!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::CInstanceLighter 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 Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NL3D::CInstanceLighter Class Reference</h1><code>#include <<a class="el" href="a05825.html">instance_lighter.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A class to precompute "StaticSetup" lighting for instances in an InstanceGroup. Class "inspired" from <a class="el" href="a03739.html">CZoneLighter</a> :) <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="a05825.html#l00055">55</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Cell Iteration. ie iteration on _IGRetrieverGridMap cells and _IGSurfaceLightBuild cells</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03465.html">CSurfaceLightGrid::CCellCorner</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02657.html">CIGSurfaceLightBuild::CCellCorner</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_3">getCurrentCellNumber</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03465.html">CSurfaceLightGrid::CCellCorner</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_4">getCurrentNeighborCell</a> (<a class="el" href="a04558.html#a14">sint</a> xnb, <a class="el" href="a04558.html#a14">sint</a> ynb)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02657.html">CIGSurfaceLightBuild::CCellCorner</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_5">getCurrentNeighborCellInfo</a> (<a class="el" href="a04558.html#a14">sint</a> xnb, <a class="el" href="a04558.html#a14">sint</a> ynb)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_6">getTotalCellNumber</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_7">isCurrentNeighborCellInSurface</a> (<a class="el" href="a04558.html#a14">sint</a> xnb, <a class="el" href="a04558.html#a14">sint</a> ynb)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a> (const char *message)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_13">_ItCurrentCellNumber</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02654.html#NL3D_1_1CIGSurfaceLightw0">CIGSurfaceLight::ItRetrieverGridMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw1">CIGSurfaceLightBuild::ItRetrieverGridMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_17">_LastCellProgress</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_18">_TotalCellNumber</a></td></tr> + +<tr><td colspan=2><br><h2>Public Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom>{ <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterw0NL3D_1_1CInstanceLighterw1">MaxOverSamples</a> = 16 + }</td></tr> + +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera0">CInstanceLighter</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NL3D_1_1CInstanceLightera0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera1">init</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera2">light</a> (const <a class="el" href="a02671.html">CInstanceGroup</a> &igIn, <a class="el" href="a02671.html">CInstanceGroup</a> &igOut, const <a class="el" href="a02677.html">CLightDesc</a> &lightDesc, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &obstacles, <a class="el" href="a02702.html">CLandscape</a> *landscape=NULL, <a class="el" href="a02656.html">CIGSurfaceLightBuild</a> *igSurfaceLightBuild=NULL)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (const char *message, float progress)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera4">~CInstanceLighter</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#NL3D_1_1CInstanceLightera4"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Static PointLights mgt.</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz207_0">addStaticPointLight</a> (const <a class="el" href="a03094.html">CPointLightNamed</a> &pln, const char *igName)</td></tr> + +<tr><td colspan=2><br><h2>Static Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightere0">addTriangles</a> (const <a class="el" href="a02539.html">IShape</a> &shape, const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &modelMT, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &triangleArray, <a class="el" href="a04558.html#a14">sint</a> instanceId)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (<a class="el" href="a02702.html">CLandscape</a> &landscape, std::vector< <a class="el" href="a04558.html#a15">uint</a> > &listZone, <a class="el" href="a04558.html#a15">uint</a> order, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &triangleArray)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightere2">lightIgSimple</a> (<a class="el" href="a02675.html">CInstanceLighter</a> &instLighter, const <a class="el" href="a02671.html">CInstanceGroup</a> &igIn, <a class="el" href="a02671.html">CInstanceGroup</a> &igOut, const <a class="el" href="a02677.html">CLightDesc</a> &lightDesc, const char *igName)</td></tr> + +<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterd0">compilePointLightRT</a> (<a class="el" href="a04558.html#a15">uint</a> gridSize, float gridCellSize, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &obstacles, bool doShadow)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Fill CubeGrid, and set PointLightRT in _StaticPointLightQuadGrid. <a href="#NL3D_1_1CInstanceLighterd0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterd1">computeSunContribution</a> (const <a class="el" href="a02677.html">CLightDesc</a> &lightDesc, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &obstacles, <a class="el" href="a02702.html">CLandscape</a> *landscape)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterd2">dilateLightingOnSurfaceCells</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterd3">processIGPointLightRT</a> (std::vector< <a class="el" href="a03094.html">CPointLightNamed</a> > &listPointLight)</td></tr> + +<tr><td colspan=2><br><h2>Static Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterh0">addTriangles</a> (const <a class="el" href="a02892.html">CMeshMRMGeom</a> &meshGeom, const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &modelMT, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &triangleArray, <a class="el" href="a04558.html#a14">sint</a> instanceId)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterh1">addTriangles</a> (const <a class="el" href="a02878.html">CMeshGeom</a> &meshGeom, const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &modelMT, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &triangleArray, <a class="el" href="a04558.html#a14">sint</a> instanceId)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterh2">excludeAllPatchFromRefineAll</a> (<a class="el" href="a02702.html">CLandscape</a> &landscape, std::vector< <a class="el" href="a04558.html#a15">uint</a> > &listZone, bool exclude)</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr0">_CurrentInstanceComputed</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02654.html#NL3D_1_1CIGSurfaceLightw1">CIGSurfaceLight::TRetrieverGridMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02656.html">CIGSurfaceLightBuild</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02676.html">CInstanceInfo</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02672.html">CInstanceGroup::CInstance</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03273.html">CQuadGrid</a>< <a class="el" href="a02678.html">CPointLightRT</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">QuadGrid of PointLights. Builded from _StaticPointLights. <a href="#NL3D_1_1CInstanceLighterr5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02678.html">CPointLightRT</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">List of PointLights. <a href="#NL3D_1_1CInstanceLighterr6"></a><br><br></td></tr> +</table> +<hr><h2>Member Enumeration Documentation</h2> +<a class="anchor" name="NL3D_1_1CInstanceLighterw0" doxytag="NL3D::CInstanceLighter::@14" ></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"> anonymous enum + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<dl compact><dt><b>Enumeration values: </b></dt><dd> +<table border=0 cellspacing=2 cellpadding=0> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CInstanceLighterw0NL3D_1_1CInstanceLighterw1" doxytag="MaxOverSamples" ></a>MaxOverSamples</em> </td><td> +</td></tr> +</table> +</dl> + +<p> +Definition at line <a class="el" href="a05825.html#l00059">59</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +<div class="fragment"><pre>00059 {<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterw0NL3D_1_1CInstanceLighterw1">MaxOverSamples</a>= 16}; +</pre></div> </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NL3D_1_1CInstanceLightera0" doxytag="NL3D::CInstanceLighter::CInstanceLighter" ></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::CInstanceLighter::CInstanceLighter </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor. +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l00066">66</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>. +<p> +<div class="fragment"><pre>00067 { +00068 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>= NULL; +00069 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLightera4" doxytag="NL3D::CInstanceLighter::~CInstanceLighter" ></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"> virtual NL3D::CInstanceLighter::~<a class="el" href="a02675.html">CInstanceLighter</a> </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Destructor. +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00131">131</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +<div class="fragment"><pre>00131 {} +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NL3D_1_1CInstanceLighterz207_0" doxytag="NL3D::CInstanceLighter::addStaticPointLight" ></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::CInstanceLighter::addStaticPointLight </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03094.html">CPointLightNamed</a> & </td> + <td class="mdname" nowrap> <em>pln</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const char * </td> + <td class="mdname" nowrap> <em>igName</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Append a static point light to compute. call at setup stage (before <a class="el" href="a02675.html#NL3D_1_1CInstanceLightera2">light()</a> ). NB: you must append all PointLights of intersets, even ones from the IG to compute. +<p> +Definition at line <a class="el" href="a05824.html#l00999">999</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00253">_StaticPointLights</a>, <a class="el" href="a05825.html#l00223">NL3D::CInstanceLighter::CPointLightRT::BSphere</a>, <a class="el" href="a05505.html#l00048">NLMISC::CBSphere::Center</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#l00116">NL3D::CPointLight::getPosition()</a>, <a class="el" href="a05825.html#l00221">NL3D::CInstanceLighter::CPointLightRT::OODeltaAttenuation</a>, <a class="el" href="a05825.html#l00220">NL3D::CInstanceLighter::CPointLightRT::PointLight</a>, and <a class="el" href="a05505.html#l00049">NLMISC::CBSphere::Radius</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01502">lightIgSimple()</a>. +<p> +<div class="fragment"><pre>01000 { +01001 <span class="comment">// NB: adding light more than 255 is allowed here, since the important thig is to not overflow really usefull lights</span> +01002 +01003 <span class="comment">// build the plRT.</span> +01004 CPointLightRT plRT; +01005 plRT.PointLight= pln; +01006 <span class="comment">// compute plRT.OODeltaAttenuation</span> +01007 plRT.OODeltaAttenuation= pln.getAttenuationEnd() - pln.getAttenuationBegin(); +01008 <span class="keywordflow">if</span>(plRT.OODeltaAttenuation <=0 ) +01009 plRT.OODeltaAttenuation= 1e10f; +01010 <span class="keywordflow">else</span> +01011 plRT.OODeltaAttenuation= 1.0f / plRT.OODeltaAttenuation; +01012 <span class="comment">// compute plRT.BSphere</span> +01013 plRT.BSphere.Center= pln.getPosition(); +01014 plRT.BSphere.Radius= pln.getAttenuationEnd(); +01015 <span class="comment">// NB: FaceCubeGrid will be computed during light()</span> +01016 +01017 <span class="comment">// add the plRT</span> +01018 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>.push_back(plRT); +01019 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterh0" doxytag="NL3D::CInstanceLighter::addTriangles" ></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::CInstanceLighter::addTriangles </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02892.html">CMeshMRMGeom</a> & </td> + <td class="mdname" nowrap> <em>meshGeom</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02851.html">NLMISC::CMatrix</a> & </td> + <td class="mdname" nowrap> <em>modelMT</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td> + <td class="mdname" nowrap> <em>triangleArray</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>instanceId</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [static, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l00231">231</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a06006.html#l00192">NL3D::CMeshMRMGeom::getNbRdrPass()</a>, <a class="el" href="a06198.html#l00141">NL3D::CPrimitiveBlock::getNumQuad()</a>, <a class="el" href="a06198.html#l00108">NL3D::CPrimitiveBlock::getNumTri()</a>, <a class="el" href="a06197.html#l00149">NL3D::CPrimitiveBlock::getQuadPointer()</a>, <a class="el" href="a06006.html#l00199">NL3D::CMeshMRMGeom::getRdrPassPrimitiveBlock()</a>, <a class="el" href="a06197.html#l00091">NL3D::CPrimitiveBlock::getTriPointer()</a>, <a class="el" href="a06006.html#l00176">NL3D::CMeshMRMGeom::getVertexBuffer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>00232 { +00233 <span class="comment">// Get the vertex buffer</span> +00234 <span class="keyword">const</span> CVertexBuffer &vb=meshGeom.getVertexBuffer(); +00235 +00236 <span class="comment">// For each render pass</span> +00237 <a class="code" href="a04558.html#a15">uint</a> numRenderPass=meshGeom.getNbRdrPass(0); +00238 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> pass=0; pass<numRenderPass; pass++) +00239 { +00240 <span class="comment">// Get the primitive block</span> +00241 <span class="keyword">const</span> CPrimitiveBlock &primitive=meshGeom.getRdrPassPrimitiveBlock ( 0, pass); +00242 +00243 <span class="comment">// Dump triangles</span> +00244 <span class="keyword">const</span> <a class="code" href="a04558.html#a11">uint32</a>* triIndex=primitive.getTriPointer (); +00245 <a class="code" href="a04558.html#a15">uint</a> numTri=primitive.getNumTri (); +00246 <a class="code" href="a04558.html#a15">uint</a> tri; +00247 <span class="keywordflow">for</span> (tri=0; tri<numTri; tri++) +00248 { +00249 <span class="comment">// Vertex</span> +00250 CVector v0=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3])); +00251 CVector v1=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3+1])); +00252 CVector v2=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3+2])); +00253 +00254 <span class="comment">// Make a triangle</span> +00255 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v1, v2), instanceId)); +00256 } +00257 +00258 <span class="comment">// Dump quad</span> +00259 triIndex=primitive.getQuadPointer (); +00260 numTri=primitive.getNumQuad (); +00261 <span class="keywordflow">for</span> (tri=0; tri<numTri; tri++) +00262 { +00263 <span class="comment">// Vertex</span> +00264 CVector v0=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4])); +00265 CVector v1=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+1])); +00266 CVector v2=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+2])); +00267 CVector v3=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+3])); +00268 +00269 <span class="comment">// Make 2 triangles</span> +00270 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v1, v2), instanceId)); +00271 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v2, v3), instanceId)); +00272 } +00273 } +00274 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterh1" doxytag="NL3D::CInstanceLighter::addTriangles" ></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::CInstanceLighter::addTriangles </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02878.html">CMeshGeom</a> & </td> + <td class="mdname" nowrap> <em>meshGeom</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02851.html">NLMISC::CMatrix</a> & </td> + <td class="mdname" nowrap> <em>modelMT</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td> + <td class="mdname" nowrap> <em>triangleArray</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>instanceId</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [static, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l00179">179</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00393">NL3D::CMeshGeom::getNbMatrixBlock()</a>, <a class="el" href="a05990.html#l00398">NL3D::CMeshGeom::getNbRdrPass()</a>, <a class="el" href="a06198.html#l00141">NL3D::CPrimitiveBlock::getNumQuad()</a>, <a class="el" href="a06198.html#l00108">NL3D::CPrimitiveBlock::getNumTri()</a>, <a class="el" href="a06197.html#l00149">NL3D::CPrimitiveBlock::getQuadPointer()</a>, <a class="el" href="a05990.html#l00404">NL3D::CMeshGeom::getRdrPassPrimitiveBlock()</a>, <a class="el" href="a06197.html#l00091">NL3D::CPrimitiveBlock::getTriPointer()</a>, <a class="el" href="a05990.html#l00390">NL3D::CMeshGeom::getVertexBuffer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>00180 { +00181 <span class="comment">// Get the vertex buffer</span> +00182 <span class="keyword">const</span> CVertexBuffer &vb=meshGeom.getVertexBuffer(); +00183 +00184 <span class="comment">// For each matrix block</span> +00185 <a class="code" href="a04558.html#a15">uint</a> numBlock=meshGeom.getNbMatrixBlock(); +00186 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> block=0; block<numBlock; block++) +00187 { +00188 <span class="comment">// For each render pass</span> +00189 <a class="code" href="a04558.html#a15">uint</a> numRenderPass=meshGeom.getNbRdrPass(block); +00190 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> pass=0; pass<numRenderPass; pass++) +00191 { +00192 <span class="comment">// Get the primitive block</span> +00193 <span class="keyword">const</span> CPrimitiveBlock &primitive=meshGeom.getRdrPassPrimitiveBlock ( block, pass); +00194 +00195 <span class="comment">// Dump triangles</span> +00196 <span class="keyword">const</span> <a class="code" href="a04558.html#a11">uint32</a>* triIndex=primitive.getTriPointer (); +00197 <a class="code" href="a04558.html#a15">uint</a> numTri=primitive.getNumTri (); +00198 <a class="code" href="a04558.html#a15">uint</a> tri; +00199 <span class="keywordflow">for</span> (tri=0; tri<numTri; tri++) +00200 { +00201 <span class="comment">// Vertex</span> +00202 CVector v0=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3])); +00203 CVector v1=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3+1])); +00204 CVector v2=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3+2])); +00205 +00206 <span class="comment">// Make a triangle</span> +00207 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v1, v2), instanceId)); +00208 } +00209 +00210 <span class="comment">// Dump quad</span> +00211 triIndex=primitive.getQuadPointer (); +00212 numTri=primitive.getNumQuad (); +00213 <span class="keywordflow">for</span> (tri=0; tri<numTri; tri++) +00214 { +00215 <span class="comment">// Vertex</span> +00216 CVector v0=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4])); +00217 CVector v1=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+1])); +00218 CVector v2=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+2])); +00219 CVector v3=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+3])); +00220 +00221 <span class="comment">// Make 2 triangles</span> +00222 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v1, v2), instanceId)); +00223 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v2, v3), instanceId)); +00224 } +00225 } +00226 } +00227 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLightere0" doxytag="NL3D::CInstanceLighter::addTriangles" ></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::CInstanceLighter::addTriangles </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02539.html">IShape</a> & </td> + <td class="mdname" nowrap> <em>shape</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02851.html">NLMISC::CMatrix</a> & </td> + <td class="mdname" nowrap> <em>modelMT</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td> + <td class="mdname" nowrap> <em>triangleArray</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>instanceId</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Add triangles from a transform shape. Work only for <a class="el" href="a02857.html">CMesh</a>, CMultiMesh and <a class="el" href="a02891.html">CMeshMRM</a> all without skinning. Give An instanceId!=-1 only for instances of the IG to compute. This is to avoid auto-shadowing. +<p> +Definition at line <a class="el" href="a05824.html#l00129">129</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05824.html#l00077">addTriangles()</a>, <a class="el" href="a06005.html#l02992">NL3D::CMeshMRM::getMeshGeom()</a>, <a class="el" href="a06016.html#l00599">NL3D::CMeshMultiLod::getMeshGeom()</a>, <a class="el" href="a05989.html#l02463">NL3D::CMesh::getMeshGeom()</a>, and <a class="el" href="a05981.html#l00104">sint</a>. +<p> +<div class="fragment"><pre>00130 { +00131 <span class="comment">// Lamed from CZoneLighter.</span> +00132 +00133 <span class="comment">// Cast to CMesh</span> +00134 <span class="keyword">const</span> CMesh *mesh=dynamic_cast<const CMesh*>(&shape); +00135 +00136 <span class="comment">// Cast to CMeshMultiLod</span> +00137 <span class="keyword">const</span> CMeshMultiLod *meshMulti=dynamic_cast<const CMeshMultiLod*>(&shape); +00138 +00139 <span class="comment">// Cast to CMeshMultiLod</span> +00140 <span class="keyword">const</span> CMeshMRM *meshMRM=dynamic_cast<const CMeshMRM*>(&shape); +00141 +00142 <span class="comment">// It is a mesh ?</span> +00143 <span class="keywordflow">if</span> (mesh) +00144 { +00145 <span class="comment">// Add its triangles</span> +00146 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (mesh->getMeshGeom (), modelMT, triangleArray, instanceId); +00147 } +00148 <span class="comment">// It is a CMeshMultiLod ?</span> +00149 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (meshMulti) +00150 { +00151 <span class="comment">// Get the first geommesh</span> +00152 <span class="keyword">const</span> IMeshGeom *meshGeom=&meshMulti->getMeshGeom (0); +00153 +00154 <span class="comment">// Dynamic cast</span> +00155 <span class="keyword">const</span> CMeshGeom *geomMesh=dynamic_cast<const CMeshGeom*>(meshGeom); +00156 <span class="keywordflow">if</span> (geomMesh) +00157 { +00158 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (*geomMesh, modelMT, triangleArray, instanceId); +00159 } +00160 +00161 <span class="comment">// Dynamic cast</span> +00162 <span class="keyword">const</span> CMeshMRMGeom *mrmGeomMesh=dynamic_cast<const CMeshMRMGeom*>(meshGeom); +00163 <span class="keywordflow">if</span> (mrmGeomMesh) +00164 { +00165 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (*mrmGeomMesh, modelMT, triangleArray, instanceId); +00166 } +00167 } +00168 <span class="comment">// It is a CMeshMultiLod ?</span> +00169 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (meshMRM) +00170 { +00171 <span class="comment">// Get the first lod mesh geom</span> +00172 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (meshMRM->getMeshGeom (), modelMT, triangleArray, instanceId); +00173 } +00174 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLightere1" doxytag="NL3D::CInstanceLighter::addTriangles" ></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::CInstanceLighter::addTriangles </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02702.html">CLandscape</a> & </td> + <td class="mdname" nowrap> <em>landscape</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a04558.html#a15">uint</a> > & </td> + <td class="mdname" nowrap> <em>listZone</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>order</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td> + <td class="mdname" nowrap> <em>triangleArray</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l00077">77</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a06498.html#l00102">NL3D::CTessVertex::EndPos</a>, <a class="el" href="a05824.html#l00278">excludeAllPatchFromRefineAll()</a>, <a class="el" href="a05862.html#l02899">NL3D::CLandscape::getTessellationLeaves()</a>, <a class="el" href="a05862.html#l00737">NL3D::CLandscape::refineAll()</a>, <a class="el" href="a05862.html#l00318">NL3D::CLandscape::setThreshold()</a>, <a class="el" href="a05862.html#l00344">NL3D::CLandscape::setTileMaxSubdivision()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06498.html#l00241">NL3D::CTessFace::VBase</a>, <a class="el" href="a06498.html#l00241">NL3D::CTessFace::VLeft</a>, and <a class="el" href="a06498.html#l00241">NL3D::CTessFace::VRight</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00129">addTriangles()</a>. +<p> +<div class="fragment"><pre>00078 { +00079 <span class="comment">// Lamed from CZoneLighter.</span> +00080 <span class="comment">// Set all to refine</span> +00081 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterh2">excludeAllPatchFromRefineAll</a> (landscape, listZone, <span class="keyword">false</span>); +00082 +00083 <span class="comment">// Setup the landscape</span> +00084 landscape.setThreshold (0); +00085 landscape.setTileMaxSubdivision (order); +00086 +00087 <span class="comment">// Refine it</span> +00088 landscape.refineAll (CVector (0, 0, 0)); +00089 +00090 <span class="comment">// Dump tesselated triangles</span> +00091 std::vector<const CTessFace*> leaves; +00092 landscape.getTessellationLeaves(leaves); +00093 +00094 <span class="comment">// Number of leaves</span> +00095 <a class="code" href="a04558.html#a15">uint</a> leavesCount=leaves.size(); +00096 +00097 <span class="comment">// Reserve the array</span> +00098 triangleArray.reserve (triangleArray.size()+leavesCount); +00099 +00100 <span class="comment">// Scan each leaves</span> +00101 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> leave=0; leave<leavesCount; leave++) +00102 { +00103 <span class="comment">// Leave</span> +00104 <span class="keyword">const</span> CTessFace *face=leaves[leave]; +00105 +00106 <span class="comment">// Add a triangle. -1 because not an instance from an IG</span> +00107 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (face->VBase->EndPos, face->VLeft->EndPos, face->VRight->EndPos), -1 )); +00108 } +00109 +00110 <span class="comment">// Setup the landscape</span> +00111 landscape.setThreshold (1000); +00112 landscape.setTileMaxSubdivision (0); +00113 +00114 <span class="comment">// Remove all triangles</span> +00115 landscape.refineAll (CVector (0, 0, 0)); +00116 landscape.refineAll (CVector (0, 0, 0)); +00117 landscape.refineAll (CVector (0, 0, 0)); +00118 landscape.refineAll (CVector (0, 0, 0)); +00119 landscape.refineAll (CVector (0, 0, 0)); +00120 landscape.refineAll (CVector (0, 0, 0)); +00121 landscape.refineAll (CVector (0, 0, 0)); +00122 landscape.refineAll (CVector (0, 0, 0)); +00123 landscape.refineAll (CVector (0, 0, 0)); +00124 landscape.refineAll (CVector (0, 0, 0)); +00125 +00126 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_0" doxytag="NL3D::CInstanceLighter::beginCell" ></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::CInstanceLighter::beginCell </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01635">1635</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00214">_IGRetrieverGridMap</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00293">_IsEndCell</a>, <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00294">_ItCurrentCellNumber</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05825.html#l00296">_LastCellProgress</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05809.html#l00112">NL3D::CIGSurfaceLightBuild::RetrieverGridMap</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. +<p> +<div class="fragment"><pre>01636 { +01637 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>) +01638 { +01639 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.begin(); +01640 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a> != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.end() ) +01641 { +01642 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.find(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->first); +01643 <a class="code" href="a04199.html#a6">nlassert</a>(_ItRetrieverInfo != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.end() ); +01644 <span class="comment">// We are suze here that the retriever is not empty, and that the grid herself is not empty too</span> +01645 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>= 0; +01646 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>= 0; +01647 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_13">_ItCurrentCellNumber</a>= 0; +01648 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">false</span>; +01649 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_17">_LastCellProgress</a>= 0; +01650 } +01651 <span class="keywordflow">else</span> +01652 { +01653 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">true</span>; +01654 } +01655 } +01656 <span class="keywordflow">else</span> +01657 { +01658 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">true</span>; +01659 } +01660 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterd0" doxytag="NL3D::CInstanceLighter::compilePointLightRT" ></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::CInstanceLighter::compilePointLightRT </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>gridSize</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>gridCellSize</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td> + <td class="mdname" nowrap> <em>obstacles</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>doShadow</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Fill CubeGrid, and set PointLightRT in _StaticPointLightQuadGrid. +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01023">1023</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00255">_StaticPointLightQuadGrid</a>, <a class="el" href="a05825.html#l00253">_StaticPointLights</a>, <a class="el" href="a06300.html#l00641">NL3D::CQuadGrid< T >::begin()</a>, <a class="el" href="a05825.html#l00223">NL3D::CInstanceLighter::CPointLightRT::BSphere</a>, <a class="el" href="a05505.html#l00048">NLMISC::CBSphere::Center</a>, <a class="el" href="a02423.html#NL3D_1_1CCubeGrida1">NL3D::CCubeGrid< const CTriangle * >::compile()</a>, <a class="el" href="a02423.html#NL3D_1_1CCubeGrida2">NL3D::CCubeGrid< const CTriangle * >::create()</a>, <a class="el" href="a06300.html#l00433">NL3D::CQuadGrid< T >::create()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz772_1">NL3D::CQuadGrid< CPointLightRT * >::create()</a>, <a class="el" href="a06300.html#l00646">NL3D::CQuadGrid< T >::end()</a>, <a class="el" href="a05384.html#l00215">NLMISC::CAABBox::extend()</a>, <a class="el" href="a05825.html#l00226">NL3D::CInstanceLighter::CPointLightRT::FaceCubeGrid</a>, <a class="el" href="a06180.html#l00143">NL3D::CPointLight::getAttenuationEnd()</a>, <a class="el" href="a05385.html#l00087">NLMISC::CAABBox::getMax()</a>, <a class="el" href="a05385.html#l00086">NLMISC::CAABBox::getMin()</a>, <a class="el" href="a06180.html#l00116">NL3D::CPointLight::getPosition()</a>, <a class="el" href="a06179.html#l00138">NL3D::CPointLight::getType()</a>, <a class="el" href="a02423.html#NL3D_1_1CCubeGrida4">NL3D::CCubeGrid< const CTriangle * >::insert()</a>, <a class="el" href="a06300.html#l00516">NL3D::CQuadGrid< T >::insert()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_2">NL3D::CQuadGrid< CPointLightRT * >::insert()</a>, <a class="el" href="a05824.html#l00044">NL3D_INSTANCE_LIGHTER_CUBE_GRID_SIZE</a>, <a class="el" href="a05825.html#l00220">NL3D::CInstanceLighter::CPointLightRT::PointLight</a>, <a class="el" href="a05825.html#l00159">progress()</a>, <a class="el" href="a05505.html#l00049">NLMISC::CBSphere::Radius</a>, <a class="el" href="a05825.html#l00228">NL3D::CInstanceLighter::CPointLightRT::RefCount</a>, <a class="el" href="a06300.html#l00613">NL3D::CQuadGrid< T >::select()</a>, <a class="el" href="a05385.html#l00066">NLMISC::CAABBox::setCenter()</a>, <a class="el" href="a05385.html#l00067">NLMISC::CAABBox::setHalfSize()</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a05825.html#l00106">NL3D::CInstanceLighter::CTriangle::Triangle</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00305">light()</a>. +<p> +<div class="fragment"><pre>01024 { +01025 <a class="code" href="a04558.html#a15">uint</a> i; +01026 +01027 <span class="comment">// Fill the quadGrid of Lights.</span> +01028 <span class="comment">// ===========</span> +01029 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.create(gridSize, gridCellSize); +01030 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>.size();i++) +01031 { +01032 CPointLightRT &plRT= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>[i]; +01033 +01034 <span class="comment">// Compute the bbox of the light</span> +01035 CAABBox bbox; +01036 bbox.setCenter(plRT.BSphere.Center); +01037 <span class="keywordtype">float</span> hl= plRT.BSphere.Radius; +01038 bbox.setHalfSize(CVector(hl,hl,hl)); +01039 +01040 <span class="comment">// Insert the pointLight in the quadGrid.</span> +01041 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.insert(bbox.getMin(), bbox.getMax(), &plRT); +01042 } +01043 +01044 +01045 <span class="comment">// Append triangles to cubeGrid ??</span> +01046 <span class="keywordflow">if</span>(doShadow) +01047 { +01048 <span class="comment">// For all obstacles, Fill a quadGrid.</span> +01049 <span class="comment">// ===========</span> +01050 CQuadGrid<CTriangle*> obstacleGrid; +01051 obstacleGrid.create(gridSize, gridCellSize); +01052 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a587">size</a>= obstacles.size(); +01053 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a04223.html#a587">size</a>; i++) +01054 { +01055 <span class="comment">// bbox of triangle</span> +01056 CAABBox bbox; +01057 bbox.setCenter(obstacles[i].Triangle.V0); +01058 bbox.extend(obstacles[i].Triangle.V1); +01059 bbox.extend(obstacles[i].Triangle.V2); +01060 <span class="comment">// insert triangle in quadGrid.</span> +01061 obstacleGrid.insert(bbox.getMin(), bbox.getMax(), &obstacles[i]); +01062 } +01063 +01064 +01065 <span class="comment">// For all PointLights, fill his CubeGrid</span> +01066 <span class="comment">// ===========</span> +01067 <span class="keywordflow">for</span>(i=0; i<_StaticPointLights.size();i++) +01068 { +01069 <span class="comment">// progress</span> +01070 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute Influences of PointLights 1/2"</span>, i / (<span class="keywordtype">float</span>)_StaticPointLights.size()); +01071 +01072 CPointLightRT &plRT= _StaticPointLights[i]; +01073 <span class="comment">// Create the cubeGrid</span> +01074 plRT.FaceCubeGrid.create(plRT.PointLight.getPosition(), <a class="code" href="a04401.html#a0">NL3D_INSTANCE_LIGHTER_CUBE_GRID_SIZE</a>); +01075 +01076 <span class="comment">// AmbiantLIghts: do nothing.</span> +01077 <span class="keywordflow">if</span>(plRT.PointLight.getType()!=CPointLight::AmbientLight) +01078 { +01079 <span class="comment">// Select only obstacle Faces around the light. Other are not usefull</span> +01080 CAABBox bbox; +01081 bbox.setCenter(plRT.PointLight.getPosition()); +01082 <span class="keywordtype">float</span> hl= plRT.PointLight.getAttenuationEnd(); +01083 bbox.setHalfSize(CVector(hl,hl,hl)); +01084 obstacleGrid.select(bbox.getMin(), bbox.getMax()); +01085 +01086 <span class="comment">// For all faces, fill the cubeGrid.</span> +01087 CQuadGrid<CTriangle*>::CIterator itObstacle; +01088 itObstacle= obstacleGrid.begin(); +01089 <span class="keywordflow">while</span>( itObstacle!=obstacleGrid.end() ) +01090 { +01091 <a class="code" href="a03616.html">CTriangle</a> &tri= *(*itObstacle); +01092 <span class="comment">/* Don't Test BackFace culling Here (unlike in CZoneLighter !!).</span> +01093 <span class="comment"> For objects:</span> +01094 <span class="comment"> AutoOccluding problem is avoided with _CurrentInstanceComputed scheme.</span> +01095 <span class="comment"> Also, With pointLights, there is no multiSampling (since no factor stored)</span> +01096 <span class="comment"> Hence we are sure that no Object samples will lies under floor, and that the center of the </span> +01097 <span class="comment"> object is far away.</span> +01098 <span class="comment"> For IGSurface lighting:</span> +01099 <span class="comment"> notice that we already add 20cm in height because of "stairs problem" so</span> +01100 <span class="comment"> floor/surface auto_shadowing is not a problem here...</span> +01101 <span class="comment"> */</span> +01102 <span class="comment">// Insert the triangle in the CubeGrid</span> +01103 plRT.FaceCubeGrid.insert( tri.Triangle, &tri); +01104 +01105 itObstacle++; +01106 } +01107 } +01108 +01109 <span class="comment">// Compile the CubeGrid.</span> +01110 plRT.FaceCubeGrid.compile(); +01111 +01112 <span class="comment">// And Reset RefCount.</span> +01113 plRT.RefCount= 0; +01114 } +01115 } +01116 <span class="comment">// else, just build empty grid</span> +01117 <span class="keywordflow">else</span> +01118 { +01119 <span class="keywordflow">for</span>(i=0; i<_StaticPointLights.size();i++) +01120 { +01121 <span class="comment">// progress</span> +01122 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute Influences of PointLights 1/2"</span>, i / (<span class="keywordtype">float</span>)_StaticPointLights.size()); +01123 +01124 CPointLightRT &plRT= _StaticPointLights[i]; +01125 <span class="comment">// Create a dummy empty cubeGrid => no rayTrace :)</span> +01126 plRT.FaceCubeGrid.create(plRT.PointLight.getPosition(), 4); +01127 +01128 <span class="comment">// Compile the CubeGrid.</span> +01129 plRT.FaceCubeGrid.compile(); +01130 +01131 <span class="comment">// And Reset RefCount.</span> +01132 plRT.RefCount= 0; +01133 } +01134 } +01135 +01136 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterd1" doxytag="NL3D::CInstanceLighter::computeSunContribution" ></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::CInstanceLighter::computeSunContribution </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02677.html">CLightDesc</a> & </td> + <td class="mdname" nowrap> <em>lightDesc</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td> + <td class="mdname" nowrap> <em>obstacles</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02702.html">CLandscape</a> * </td> + <td class="mdname" nowrap> <em>landscape</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l00633">633</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00210">_CurrentInstanceComputed</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00208">_InstanceInfos</a>, <a class="el" href="a06300.html#l00641">NL3D::CQuadGrid< T >::begin()</a>, <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a06300.html#l00428">NL3D::CQuadGrid< T >::changeBase()</a>, <a class="el" href="a06300.html#l00433">NL3D::CQuadGrid< T >::create()</a>, <a class="el" href="a06729.html#l00082">NL3D::CVisualCollisionManager::createEntity()</a>, <a class="el" href="a06729.html#l00089">NL3D::CVisualCollisionManager::deleteEntity()</a>, <a class="el" href="a05825.html#l00071">NL3D::CInstanceLighter::CLightDesc::DisableSunContribution</a>, <a class="el" href="a06300.html#l00646">NL3D::CQuadGrid< T >::end()</a>, <a class="el" href="a05384.html#l00215">NLMISC::CAABBox::extend()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05385.html#l00087">NLMISC::CAABBox::getMax()</a>, <a class="el" href="a05385.html#l00086">NLMISC::CAABBox::getMin()</a>, <a class="el" href="a06725.html#l00527">NL3D::CVisualCollisionEntity::getStaticLightSetup()</a>, <a class="el" href="a05825.html#l00080">NL3D::CInstanceLighter::CLightDesc::GridCellSize</a>, <a class="el" href="a05825.html#l00077">NL3D::CInstanceLighter::CLightDesc::GridSize</a>, <a class="el" href="a06300.html#l00516">NL3D::CQuadGrid< T >::insert()</a>, <a class="el" href="a05825.html#l00109">NL3D::CInstanceLighter::CTriangle::InstanceId</a>, <a class="el" href="a05809.html#l00059">NL3D::CIGSurfaceLightBuild::CCellCorner::InSurface</a>, <a class="el" href="a03616.html#NLMISC_1_1CTriangleUVa2">NLMISC::CTriangle::intersect()</a>, <a class="el" href="a05972.html#l01090">NLMISC::CMatrix::inverted()</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a05825.html#l00074">NL3D::CInstanceLighter::CLightDesc::LightDirection</a>, <a class="el" href="a05824.html#l00617">NL3D::NEL3DCalcBase()</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06682.html#l00119">NLMISC::CVector::normalize()</a>, <a class="el" href="a05809.html#l00065">NL3D::CIGSurfaceLightBuild::CCellCorner::NumOverSamples</a>, <a class="el" href="a05809.html#l00072">NL3D::CIGSurfaceLightBuild::CCellCorner::OverSamples</a>, <a class="el" href="a05825.html#l00086">NL3D::CInstanceLighter::CLightDesc::OverSampling</a>, <a class="el" href="a05825.html#l00115">NL3D::CInstanceLighter::CTriangle::Plane</a>, <a class="el" href="a05825.html#l00159">progress()</a>, <a class="el" href="a05824.html#l01623">progressCell()</a>, <a class="el" href="a06300.html#l00613">NL3D::CQuadGrid< T >::select()</a>, <a class="el" href="a05385.html#l00066">NLMISC::CAABBox::setCenter()</a>, <a class="el" href="a06729.html#l00075">NL3D::CVisualCollisionManager::setLandscape()</a>, <a class="el" href="a05825.html#l00083">NL3D::CInstanceLighter::CLightDesc::Shadow</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05809.html#l00063">NL3D::CIGSurfaceLightBuild::CCellCorner::SunContribution</a>, <a class="el" href="a06476.html#l00068">NL3D::CSurfaceLightGrid::CCellCorner::SunContribution</a>, <a class="el" href="a05825.html#l00106">NL3D::CInstanceLighter::CTriangle::Triangle</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00305">light()</a>. +<p> +<div class="fragment"><pre>00634 { +00635 <a class="code" href="a04558.html#a14">sint</a> i; +00636 <span class="comment">// Use precoputed landscape SunContribution</span> +00637 CVisualCollisionManager *VCM= NULL; +00638 CVisualCollisionEntity *VCE= NULL; +00639 <span class="keywordflow">if</span>(landscape) +00640 { +00641 <span class="comment">// create a CVisualCollisionManager and a CVisualCollisionEntity</span> +00642 VCM= <span class="keyword">new</span> CVisualCollisionManager; +00643 VCM->setLandscape(landscape); +00644 VCE= VCM->createEntity(); +00645 } +00646 std::vector<CPointLightInfluence> dummyPointLightFromLandscape; +00647 dummyPointLightFromLandscape.reserve(1024); +00648 +00649 +00650 <span class="comment">// If DisableSunContribution, easy, </span> +00651 <span class="keywordflow">if</span>(lightDesc.DisableSunContribution) +00652 { +00653 <span class="comment">// Light all instances.</span> +00654 <span class="comment">//==========</span> +00655 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size(); i++) +00656 { +00657 <span class="comment">// If staticLight not enabled, skip.</span> +00658 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled ) +00659 <span class="keywordflow">continue</span>; +00660 +00661 <span class="comment">// fill SunContribution to 0</span> +00662 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= 0; +00663 } +00664 +00665 <span class="comment">// Light SurfaceGrid Cells.</span> +00666 <span class="comment">//==========</span> +00667 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>) +00668 { +00669 <span class="comment">// Begin cell iteration</span> +00670 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>(); +00671 <span class="comment">// For all surface cell corners</span> +00672 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() ) +00673 { +00674 <span class="comment">// get the current cell and cellInfo iterated.</span> +00675 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>(); +00676 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>(); +00677 +00678 <span class="comment">// if the cell corner lies in the polygon surface.</span> +00679 <span class="keywordflow">if</span>(cellInfo.InSurface) +00680 { +00681 <span class="comment">// fill SunContribution to 0</span> +00682 cell.SunContribution= 0; +00683 <span class="comment">// copy it to cellInfo</span> +00684 cellInfo.SunContribution= cell.SunContribution; +00685 } +00686 +00687 <span class="comment">// next cell</span> +00688 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>(); +00689 } +00690 } +00691 } +00692 <span class="comment">// If no Raytrace Shadow, easy, </span> +00693 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(!lightDesc.Shadow) +00694 { +00695 <span class="comment">// Light all instances.</span> +00696 <span class="comment">//==========</span> +00697 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size(); i++) +00698 { +00699 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute SunContribution on Instances"</span>, i / <span class="keywordtype">float</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size()) ); +00700 +00701 <span class="comment">// If staticLight not enabled, skip.</span> +00702 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled ) +00703 <span class="keywordflow">continue</span>; +00704 +00705 <span class="comment">// by default, fill SunContribution to 255</span> +00706 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= 255; +00707 <span class="comment">// Try to get landscape SunContribution (better)</span> +00708 <span class="keywordflow">if</span>(landscape) +00709 { +00710 CVector pos= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].CenterPos; +00711 <a class="code" href="a04558.html#a7">uint8</a> landSunContribution; +00712 dummyPointLightFromLandscape.clear(); +00713 <span class="comment">// If find faces under me</span> +00714 <a class="code" href="a03337.html">NLMISC::CRGBA</a> dummyAmbient; +00715 <span class="keywordflow">if</span>(VCE->getStaticLightSetup(pos, dummyPointLightFromLandscape, landSunContribution, dummyAmbient) ) +00716 { +00717 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= landSunContribution; +00718 } +00719 } +00720 } +00721 +00722 <span class="comment">// Light SurfaceGrid Cells.</span> +00723 <span class="comment">//==========</span> +00724 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>) +00725 { +00726 <span class="comment">// Begin cell iteration</span> +00727 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>(); +00728 <span class="comment">// For all surface cell corners</span> +00729 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() ) +00730 { +00731 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a>(<span class="stringliteral">"Compute SunContribution on Surfaces"</span>); +00732 +00733 <span class="comment">// get the current cell and cellInfo iterated.</span> +00734 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>(); +00735 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>(); +00736 +00737 <span class="comment">// if the cell corner lies in the polygon surface.</span> +00738 <span class="keywordflow">if</span>(cellInfo.InSurface) +00739 { +00740 <span class="comment">// Just init SunContribution to 255, since no shadowing.</span> +00741 cell.SunContribution= 255; +00742 <span class="comment">// copy it to cellInfo</span> +00743 cellInfo.SunContribution= cell.SunContribution; +00744 } +00745 +00746 <span class="comment">// next cell</span> +00747 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>(); +00748 } +00749 } +00750 } +00751 <span class="keywordflow">else</span> +00752 { +00753 <span class="comment">// Compute rayBasis</span> +00754 CVector rayDir= lightDesc.LightDirection; +00755 CMatrix rayBasis; +00756 rayDir.normalize(); +00757 <a class="code" href="a05363.html#a423">NEL3DCalcBase</a>(rayDir, rayBasis); +00758 CMatrix invRayBasis; +00759 invRayBasis= rayBasis.inverted(); +00760 +00761 <span class="comment">// Build QuadGrid of obstacles.</span> +00762 <span class="comment">//=========</span> +00763 <span class="comment">// setup quadGrid</span> +00764 CQuadGrid<const CTriangle*> quadGrid; +00765 quadGrid.changeBase (invRayBasis); +00766 quadGrid.create(lightDesc.GridSize, lightDesc.GridCellSize); +00767 <span class="comment">// Insert all obstacles in quadGrid</span> +00768 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)obstacles.size(); i++) +00769 { +00770 CAABBox triBBox; +00771 <span class="comment">// Compute the bbox in rayBasis.</span> +00772 triBBox.setCenter(invRayBasis * obstacles[i].Triangle.V0); +00773 triBBox.extend(invRayBasis * obstacles[i].Triangle.V1); +00774 triBBox.extend(invRayBasis * obstacles[i].Triangle.V2); +00775 <span class="comment">// And set the coord in our world, because will be multiplied with invRayBasis in insert()</span> +00776 quadGrid.insert(rayBasis * triBBox.getMin(), rayBasis * triBBox.getMax(), &obstacles[i]); +00777 } +00778 +00779 <span class="comment">// For all instances, light them.</span> +00780 <span class="comment">//=========</span> +00781 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size(); i++) +00782 { +00783 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute SunContribution on Instances"</span>, i / <span class="keywordtype">float</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size()) ); +00784 +00785 <span class="comment">// If staticLight not enabled, skip.</span> +00786 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled ) +00787 <span class="keywordflow">continue</span>; +00788 +00789 <span class="comment">// try to use landscape SunContribution.</span> +00790 <span class="keywordtype">bool</span> landUsed= <span class="keyword">false</span>; +00791 <span class="keywordflow">if</span>(landscape) +00792 { +00793 CVector pos= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].CenterPos; +00794 <a class="code" href="a04558.html#a7">uint8</a> landSunContribution; +00795 dummyPointLightFromLandscape.clear(); +00796 <span class="comment">// If find faces under me</span> +00797 <a class="code" href="a03337.html">NLMISC::CRGBA</a> dummyAmbient; +00798 <span class="keywordflow">if</span>(VCE->getStaticLightSetup(pos, dummyPointLightFromLandscape, landSunContribution, dummyAmbient) ) +00799 { +00800 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= landSunContribution; +00801 landUsed= <span class="keyword">true</span>; +00802 } +00803 } +00804 +00805 <span class="comment">// If failed to use landscape SunContribution, rayTrace</span> +00806 <span class="keywordflow">if</span>(!landUsed) +00807 { +00808 <span class="comment">// number of samples (1 if no overSampling)</span> +00809 <a class="code" href="a04558.html#a15">uint</a> nSamples= max(1U, lightDesc.OverSampling); +00810 +00811 <span class="comment">// Default is full lighted.</span> +00812 <a class="code" href="a04558.html#a15">uint</a> sunAccum= 255*nSamples; +00813 +00814 <span class="comment">// For all samples</span> +00815 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> sample=0; sample<nSamples; sample++) +00816 { +00817 <span class="comment">// pos to rayTrace against</span> +00818 CVector pos= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].OverSamples[sample]; +00819 +00820 <span class="comment">// rayTrace from this pos.</span> +00821 CVector lightPos= pos-(rayDir*1000.f); +00822 <span class="comment">// Select an element with the X axis as a 3d ray</span> +00823 quadGrid.select (lightPos, lightPos); +00824 <span class="comment">// For each triangle selected</span> +00825 CQuadGrid<const CTriangle*>::CIterator it=quadGrid.begin(); +00826 <span class="keywordflow">while</span> (it!=quadGrid.end()) +00827 { +00828 <span class="keyword">const</span> <a class="code" href="a03616.html">CTriangle</a> *tri= *it; +00829 +00830 <span class="comment">// If same instanceId, skip</span> +00831 <span class="keywordflow">if</span>(tri->InstanceId != i) +00832 { +00833 CVector hit; +00834 <span class="comment">// If triangle occlude the ray, no sun Contribution</span> +00835 <span class="keywordflow">if</span>(tri->Triangle.<a class="code" href="a03616.html#NLMISC_1_1CTriangleUVa2">intersect</a>(lightPos, pos, hit, tri->Plane)) +00836 { +00837 <span class="comment">// The sample is not touched by sun. sub his contribution</span> +00838 sunAccum-= 255; +00839 <span class="comment">// End</span> +00840 <span class="keywordflow">break</span>; +00841 } +00842 } +00843 +00844 it++; +00845 } +00846 } +00847 +00848 <span class="comment">// Average samples</span> +00849 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= sunAccum / nSamples; +00850 } +00851 +00852 } +00853 +00854 +00855 <span class="comment">// Light SurfaceGrid Cells.</span> +00856 <span class="comment">//==========</span> +00857 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>) +00858 { +00859 <span class="comment">// No instance currenlty computed, since we compute surface cells.</span> +00860 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr0">_CurrentInstanceComputed</a>= -1; +00861 +00862 <span class="comment">// Begin cell iteration</span> +00863 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>(); +00864 <span class="comment">// For all surface cell corners</span> +00865 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() ) +00866 { +00867 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a>(<span class="stringliteral">"Compute SunContribution on Surfaces"</span>); +00868 +00869 <span class="comment">// get the current cell and cellInfo iterated.</span> +00870 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>(); +00871 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>(); +00872 +00873 <span class="comment">// if the cell corner lies in the polygon surface.</span> +00874 <span class="keywordflow">if</span>(cellInfo.InSurface) +00875 { +00876 <span class="comment">// number of samples (at least 1 if no overSampling)</span> +00877 <a class="code" href="a04558.html#a15">uint</a> nSamples= cellInfo.NumOverSamples; +00878 <a class="code" href="a04199.html#a6">nlassert</a>(nSamples>=1); +00879 +00880 <span class="comment">// Default is full lighted.</span> +00881 <a class="code" href="a04558.html#a15">uint</a> sunAccum= 255*nSamples; +00882 +00883 <span class="comment">// For all samples</span> +00884 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> sample=0; sample<nSamples; sample++) +00885 { +00886 <span class="comment">// Get pos to rayTrace.</span> +00887 CVector pos= cellInfo.OverSamples[sample]; +00888 +00889 <span class="comment">// rayTrace from the pos of this Cell sample.</span> +00890 CVector lightPos= pos-(rayDir*1000.f); +00891 <span class="comment">// Select an element with the X axis as a 3d ray</span> +00892 quadGrid.select (lightPos, lightPos); +00893 <span class="comment">// For each triangle selected</span> +00894 CQuadGrid<const CTriangle*>::CIterator it=quadGrid.begin(); +00895 <span class="keywordflow">while</span> (it!=quadGrid.end()) +00896 { +00897 <span class="keyword">const</span> <a class="code" href="a03616.html">CTriangle</a> *tri= *it; +00898 +00899 CVector hit; +00900 <span class="comment">// If triangle occlude the ray, no sun Contribution</span> +00901 <span class="keywordflow">if</span>(tri->Triangle.<a class="code" href="a03616.html#NLMISC_1_1CTriangleUVa2">intersect</a>(lightPos, pos, hit, tri->Plane)) +00902 { +00903 <span class="comment">// The cell sample is not touched by sun. sub his contribution</span> +00904 sunAccum-= 255; +00905 <span class="comment">// End</span> +00906 <span class="keywordflow">break</span>; +00907 } +00908 +00909 it++; +00910 } +00911 } +00912 +00913 <span class="comment">// Average SunContribution</span> +00914 cell.SunContribution= sunAccum / nSamples; +00915 +00916 <span class="comment">// copy it to cellInfo</span> +00917 cellInfo.SunContribution= cell.SunContribution; +00918 } +00919 +00920 <span class="comment">// next cell</span> +00921 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>(); +00922 } +00923 } +00924 } +00925 +00926 +00927 <span class="comment">// Clean VCM and VCE</span> +00928 <span class="keywordflow">if</span>(landscape) +00929 { +00930 <span class="comment">// delete CVisualCollisionManager and CVisualCollisionEntity</span> +00931 VCM->deleteEntity(VCE); +00932 <span class="keyword">delete</span> VCM; +00933 } +00934 +00935 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterd2" doxytag="NL3D::CInstanceLighter::dilateLightingOnSurfaceCells" ></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::CInstanceLighter::dilateLightingOnSurfaceCells </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01801">1801</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05809.html#l00068">NL3D::CIGSurfaceLightBuild::CCellCorner::CenterPos</a>, <a class="el" href="a05809.html#l00061">NL3D::CIGSurfaceLightBuild::CCellCorner::Dilated</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>, <a class="el" href="a05809.html#l00059">NL3D::CIGSurfaceLightBuild::CCellCorner::InSurface</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a06476.html#l00070">NL3D::CSurfaceLightGrid::CCellCorner::Light</a>, <a class="el" href="a06476.html#l00074">NL3D::CSurfaceLightGrid::CCellCorner::LocalAmbientId</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, <a class="el" href="a05824.html#l01623">progressCell()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05809.html#l00063">NL3D::CIGSurfaceLightBuild::CCellCorner::SunContribution</a>, <a class="el" href="a06476.html#l00068">NL3D::CSurfaceLightGrid::CCellCorner::SunContribution</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00305">light()</a>. +<p> +<div class="fragment"><pre>01802 { +01803 <span class="comment">// Begin cell iteration</span> +01804 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>(); +01805 <span class="comment">// For all surface cell corners</span> +01806 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() ) +01807 { +01808 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a>(<span class="stringliteral">"Dilate Surfaces grids"</span>); +01809 +01810 <span class="comment">// get the current cell and cellInfo iterated.</span> +01811 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>(); +01812 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>(); +01813 +01814 <span class="comment">// if the cell is not in the polygon surface, try to get from his neighbors.</span> +01815 <span class="keywordflow">if</span>(!cellInfo.InSurface) +01816 { +01817 <span class="comment">// Add Weighted influence of SunContribution, and get one of the PointLightContribution (random).</span> +01818 <a class="code" href="a04558.html#a15">uint</a> wgtSunContribution= 0; +01819 <a class="code" href="a04558.html#a15">uint</a> wgtSunCount= 0; +01820 <span class="comment">// search if one of 8 neighbors is InSurface.</span> +01821 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a14">sint</a> ynb= -1; ynb<= 1; ynb++) +01822 { +01823 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a14">sint</a> xnb= -1; xnb<= 1; xnb++) +01824 { +01825 <span class="comment">// center => skip.</span> +01826 <span class="keywordflow">if</span>( xnb==0 && ynb==0 ) +01827 <span class="keywordflow">continue</span>; +01828 <span class="comment">// If the neighbor point is not out of the grid, and if in Surface.</span> +01829 <span class="keywordflow">if</span>( <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_7">isCurrentNeighborCellInSurface</a>(xnb, ynb) ) +01830 { +01831 <span class="comment">// get the neighbor cell</span> +01832 CIGSurfaceLightBuild::CCellCorner &nbCellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_5">getCurrentNeighborCellInfo</a>(xnb, ynb); +01833 CSurfaceLightGrid::CCellCorner &nbCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_4">getCurrentNeighborCell</a>(xnb, ynb); +01834 <span class="comment">// Add SunContribution.</span> +01835 wgtSunContribution+= nbCell.SunContribution; +01836 wgtSunCount++; +01837 <span class="comment">// Just Copy PointLight info.</span> +01838 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> lightId= 0; lightId<CSurfaceLightGrid::NumLightPerCorner; lightId++) +01839 cell.Light[lightId]= nbCell.Light[lightId]; +01840 <span class="comment">// Just Copy AmbientLight info.</span> +01841 cell.LocalAmbientId= nbCell.LocalAmbientId; +01842 +01843 +01844 <span class="comment">// For debug mesh only, copy z from nb cellInfo</span> +01845 cellInfo.CenterPos.z= nbCellInfo.CenterPos.z; +01846 } +01847 } +01848 } +01849 <span class="comment">// average SunContribution.</span> +01850 <span class="keywordflow">if</span>(wgtSunCount>0) +01851 { +01852 cell.SunContribution= wgtSunContribution / wgtSunCount; +01853 +01854 <span class="comment">// For debug mesh only, copy SunContribution into cellInfo</span> +01855 cellInfo.SunContribution= cell.SunContribution; +01856 cellInfo.Dilated= <span class="keyword">true</span>; +01857 } +01858 } +01859 +01860 <span class="comment">// next cell</span> +01861 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>(); +01862 } +01863 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterh2" doxytag="NL3D::CInstanceLighter::excludeAllPatchFromRefineAll" ></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::CInstanceLighter::excludeAllPatchFromRefineAll </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02702.html">CLandscape</a> & </td> + <td class="mdname" nowrap> <em>landscape</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a04558.html#a15">uint</a> > & </td> + <td class="mdname" nowrap> <em>listZone</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>exclude</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [static, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l00278">278</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05862.html#l00760">NL3D::CLandscape::excludePatchFromRefineAll()</a>, <a class="el" href="a06760.html#l00489">NL3D::CZone::getNumPatchs()</a>, <a class="el" href="a05862.html#l02206">NL3D::CLandscape::getZone()</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00077">addTriangles()</a>. +<p> +<div class="fragment"><pre>00279 { +00280 <span class="comment">// For each zone</span> +00281 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> zone=0; zone<listZone.size(); zone++) +00282 { +00283 <span class="comment">// Get num patches</span> +00284 <a class="code" href="a04558.html#a15">uint</a> patchCount=landscape.getZone(listZone[zone])->getNumPatchs(); +00285 +00286 <span class="comment">// For each patches</span> +00287 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> patch=0; patch<patchCount; patch++) +00288 { +00289 <span class="comment">// Exclude all the patches from refine all</span> +00290 landscape.excludePatchFromRefineAll (listZone[zone], patch, exclude); +00291 } +00292 } +00293 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_1" doxytag="NL3D::CInstanceLighter::getCurrentCell" ></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="a03465.html">CSurfaceLightGrid::CCellCorner</a> & NL3D::CInstanceLighter::getCurrentCell </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01705">1705</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. +<p> +<div class="fragment"><pre>01706 { +01707 <a class="code" href="a04199.html#a6">nlassert</a>(!<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>()); +01708 +01709 <span class="comment">// return ref on Cell.</span> +01710 <span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>].Cells[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>]; +01711 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_2" doxytag="NL3D::CInstanceLighter::getCurrentCellInfo" ></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="a02657.html">CIGSurfaceLightBuild::CCellCorner</a> & NL3D::CInstanceLighter::getCurrentCellInfo </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01714">1714</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. +<p> +<div class="fragment"><pre>01715 { +01716 <a class="code" href="a04199.html#a6">nlassert</a>(!<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>()); +01717 +01718 <span class="comment">// return ref on CellInfo.</span> +01719 <span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>].Cells[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>]; +01720 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_3" doxytag="NL3D::CInstanceLighter::getCurrentCellNumber" ></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::CInstanceLighter::getCurrentCellNumber </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00284">284</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +References <a class="el" href="a05825.html#l00294">_ItCurrentCellNumber</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01623">progressCell()</a>. +<p> +<div class="fragment"><pre>00284 {<span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_13">_ItCurrentCellNumber</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_4" doxytag="NL3D::CInstanceLighter::getCurrentNeighborCell" ></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="a03465.html">CSurfaceLightGrid::CCellCorner</a> & NL3D::CInstanceLighter::getCurrentNeighborCell </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>xnb</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>ynb</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01757">1757</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a06476.html#l00101">NL3D::CSurfaceLightGrid::Cells</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06476.html#l00099">NL3D::CSurfaceLightGrid::Width</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>. +<p> +<div class="fragment"><pre>01758 { +01759 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_7">isCurrentNeighborCellInSurface</a>(xnb, ynb)); +01760 +01761 <span class="comment">// get a ref on the current grid.</span> +01762 CSurfaceLightGrid &surfGrid= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>]; +01763 <span class="comment">// copute coordinate of the current cellCorner.</span> +01764 <a class="code" href="a04558.html#a14">sint</a> xCell, yCell; +01765 xCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>%surfGrid.Width; +01766 yCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>/surfGrid.Width; +01767 <span class="comment">// compute coordinate of the neighbor cell corner</span> +01768 xCell+= xnb; +01769 yCell+= ynb; +01770 <span class="comment">// compute the neighbor id</span> +01771 <a class="code" href="a04558.html#a15">uint</a> nbId= yCell*surfGrid.Width + xCell; +01772 +01773 <span class="comment">// then return a ref on it</span> +01774 <span class="keywordflow">return</span> surfGrid.Cells[nbId]; +01775 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_5" doxytag="NL3D::CInstanceLighter::getCurrentNeighborCellInfo" ></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="a02657.html">CIGSurfaceLightBuild::CCellCorner</a> & NL3D::CInstanceLighter::getCurrentNeighborCellInfo </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>xnb</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>ynb</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01779">1779</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05809.html#l00093">NL3D::CIGSurfaceLightBuild::CSurface::Cells</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05809.html#l00090">NL3D::CIGSurfaceLightBuild::CSurface::Width</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>. +<p> +<div class="fragment"><pre>01780 { +01781 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_7">isCurrentNeighborCellInSurface</a>(xnb, ynb)); +01782 +01783 <span class="comment">// get a ref on the current grid.</span> +01784 CIGSurfaceLightBuild::CSurface &surfGrid= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>]; +01785 <span class="comment">// copute coordinate of the current cellCorner.</span> +01786 <a class="code" href="a04558.html#a14">sint</a> xCell, yCell; +01787 xCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>%surfGrid.Width; +01788 yCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>/surfGrid.Width; +01789 <span class="comment">// compute coordinate of the neighbor cell corner</span> +01790 xCell+= xnb; +01791 yCell+= ynb; +01792 <span class="comment">// compute the neighbor id</span> +01793 <a class="code" href="a04558.html#a15">uint</a> nbId= yCell*surfGrid.Width + xCell; +01794 +01795 <span class="comment">// then return a ref on it</span> +01796 <span class="keywordflow">return</span> surfGrid.Cells[nbId]; +01797 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_6" doxytag="NL3D::CInstanceLighter::getTotalCellNumber" ></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::CInstanceLighter::getTotalCellNumber </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00285">285</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +References <a class="el" href="a05825.html#l00295">_TotalCellNumber</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01623">progressCell()</a>. +<p> +<div class="fragment"><pre>00285 {<span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_18">_TotalCellNumber</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLightera1" doxytag="NL3D::CInstanceLighter::init" ></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::CInstanceLighter::init </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l00072">72</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01502">lightIgSimple()</a>. +<p> +<div class="fragment"><pre>00073 { +00074 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_7" doxytag="NL3D::CInstanceLighter::isCurrentNeighborCellInSurface" ></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"> bool NL3D::CInstanceLighter::isCurrentNeighborCellInSurface </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>xnb</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>ynb</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01724">1724</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a06476.html#l00100">NL3D::CSurfaceLightGrid::Height</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06476.html#l00099">NL3D::CSurfaceLightGrid::Width</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, and <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>. +<p> +<div class="fragment"><pre>01725 { +01726 <a class="code" href="a04199.html#a6">nlassert</a>(!<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>()); +01727 +01728 <span class="comment">// get a ref on the current grid.</span> +01729 CSurfaceLightGrid &surfGrid= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>]; +01730 <span class="comment">// copute coordinate of the current cellCorner.</span> +01731 <a class="code" href="a04558.html#a14">sint</a> xCell, yCell; +01732 xCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>%surfGrid.Width; +01733 yCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>/surfGrid.Width; +01734 <span class="comment">// compute coordinate of the neighbor cell corner</span> +01735 xCell+= xnb; +01736 yCell+= ynb; +01737 +01738 <span class="comment">// check if in the surfaceGrid</span> +01739 <span class="keywordflow">if</span>(xCell<0 || xCell>=(<a class="code" href="a04558.html#a14">sint</a>)surfGrid.Width) +01740 <span class="keywordflow">return</span> <span class="keyword">false</span>; +01741 <span class="keywordflow">if</span>(yCell<0 || yCell>=(<a class="code" href="a04558.html#a14">sint</a>)surfGrid.Height) +01742 <span class="keywordflow">return</span> <span class="keyword">false</span>; +01743 +01744 <span class="comment">// compute the neighbor id</span> +01745 <a class="code" href="a04558.html#a15">uint</a> nbId= yCell*surfGrid.Width + xCell; +01746 +01747 <span class="comment">// Now check in the cellInfo if this cell is InSurface.</span> +01748 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>].Cells[nbId].InSurface ) +01749 <span class="keywordflow">return</span> <span class="keyword">false</span>; +01750 +01751 <span class="comment">// Ok, the neighbor cell is valid.</span> +01752 +01753 <span class="keywordflow">return</span> <span class="keyword">true</span>; +01754 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_8" doxytag="NL3D::CInstanceLighter::isEndCell" ></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"> bool NL3D::CInstanceLighter::isEndCell </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01699">1699</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00293">_IsEndCell</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. +<p> +<div class="fragment"><pre>01700 { +01701 <span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>; +01702 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLightera2" doxytag="NL3D::CInstanceLighter::light" ></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::CInstanceLighter::light </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02671.html">CInstanceGroup</a> & </td> + <td class="mdname" nowrap> <em>igIn</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02671.html">CInstanceGroup</a> & </td> + <td class="mdname" nowrap> <em>igOut</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02677.html">CLightDesc</a> & </td> + <td class="mdname" nowrap> <em>lightDesc</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td> + <td class="mdname" nowrap> <em>obstacles</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02702.html">CLandscape</a> * </td> + <td class="mdname" nowrap> <em>landscape</em> = NULL, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02656.html">CIGSurfaceLightBuild</a> * </td> + <td class="mdname" nowrap> <em>igSurfaceLightBuild</em> = NULL</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Light an InstanceGroup igOut has different PointLights than igIn. eg: if a pointLight do not light anything, then it is not present in igOut. NB: shapes are used to retrieve usefull info on them (center of AABBox ...) . They are taken from lightDesc.UserShapeMap, or loaded from lightDesc.ShapePath if not found. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>landscape</em> </td><td>if !NULL use this Landscape SunContribution, looking landscape faces under each instance, for faster computing, and to get influence of Sky. NB: this landscape does not have to be tesselated, but all Zones that lies under igIn should be loaded in. </td></tr> + <tr><td valign=top><em>igSurfaceLightBuild</em> </td><td>if !NULL, <a class="el" href="a02675.html#NL3D_1_1CInstanceLightera2">light()</a> will compute igOut.IGSurfaceLight, else it is just cleared.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05824.html#l00305">305</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00214">_IGRetrieverGridMap</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00208">_InstanceInfos</a>, <a class="el" href="a05825.html#l00293">_IsEndCell</a>, <a class="el" href="a05825.html#l00295">_TotalCellNumber</a>, <a class="el" href="a06350.html#l00342">NL3D::CInstanceGroup::build()</a>, <a class="el" href="a05809.html#l00093">NL3D::CIGSurfaceLightBuild::CSurface::Cells</a>, <a class="el" href="a06476.html#l00101">NL3D::CSurfaceLightGrid::Cells</a>, <a class="el" href="a05809.html#l00110">NL3D::CIGSurfaceLightBuild::CellSize</a>, <a class="el" href="a05824.html#l01023">compilePointLightRT()</a>, <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, <a class="el" href="a06116.html#l00231">NLMISC::CObjectVector< CCellCorner >::fill()</a>, <a class="el" href="a05385.html#l00090">NLMISC::CAABBox::getCenter()</a>, <a class="el" href="a05385.html#l00091">NLMISC::CAABBox::getHalfSize()</a>, <a class="el" href="a06376.html#l00113">NL3D::CShapeStream::getShapePointer()</a>, <a class="el" href="a05825.html#l00080">NL3D::CInstanceLighter::CLightDesc::GridCellSize</a>, <a class="el" href="a05807.html#l00054">NL3D::CIGSurfaceLight::CRetrieverLightGrid::Grids</a>, <a class="el" href="a05825.html#l00077">NL3D::CInstanceLighter::CLightDesc::GridSize</a>, <a class="el" href="a05809.html#l00091">NL3D::CIGSurfaceLightBuild::CSurface::Height</a>, <a class="el" href="a06476.html#l00100">NL3D::CSurfaceLightGrid::Height</a>, <a class="el" href="a05992.html#l00198">NL3D::CMeshBase::isLightable()</a>, <a class="el" href="a06476.html#l00070">NL3D::CSurfaceLightGrid::CCellCorner::Light</a>, <a class="el" href="a06476.html#l00074">NL3D::CSurfaceLightGrid::CCellCorner::LocalAmbientId</a>, <a class="el" href="a06170.html#l00036">NLMISC::CPlane::make()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05708.html#l00135">NLMISC::CIFile::open()</a>, <a class="el" href="a05809.html#l00089">NL3D::CIGSurfaceLightBuild::CSurface::Origin</a>, <a class="el" href="a06476.html#l00098">NL3D::CSurfaceLightGrid::Origin</a>, <a class="el" href="a05825.html#l00086">NL3D::CInstanceLighter::CLightDesc::OverSampling</a>, <a class="el" href="a05825.html#l00115">NL3D::CInstanceLighter::CTriangle::Plane</a>, <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector< CCellCorner >::resize()</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector< CSurfaceLightGrid >::resize()</a>, <a class="el" href="a06350.html#l00354">NL3D::CInstanceGroup::retrieve()</a>, <a class="el" href="a05809.html#l00112">NL3D::CIGSurfaceLightBuild::RetrieverGridMap</a>, <a class="el" href="a05972.html#l00644">NLMISC::CMatrix::scale()</a>, <a class="el" href="a06376.html#l00120">NL3D::CShapeStream::serial()</a>, <a class="el" href="a05385.html#l00066">NLMISC::CAABBox::setCenter()</a>, <a class="el" href="a05385.html#l00067">NLMISC::CAABBox::setHalfSize()</a>, <a class="el" href="a05972.html#l00267">NLMISC::CMatrix::setPos()</a>, <a class="el" href="a05972.html#l00209">NLMISC::CMatrix::setRot()</a>, <a class="el" href="a05825.html#l00083">NL3D::CInstanceLighter::CLightDesc::Shadow</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector< CCellCorner >::size()</a>, <a class="el" href="a06476.html#l00068">NL3D::CSurfaceLightGrid::CCellCorner::SunContribution</a>, <a class="el" href="a05825.html#l00106">NL3D::CInstanceLighter::CTriangle::Triangle</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05825.html#l00089">NL3D::CInstanceLighter::CLightDesc::UserShapeMap</a>, <a class="el" href="a06585.html#l00051">NLMISC::CTriangle::V0</a>, <a class="el" href="a06585.html#l00051">NLMISC::CTriangle::V1</a>, <a class="el" href="a06585.html#l00051">NLMISC::CTriangle::V2</a>, <a class="el" href="a05809.html#l00090">NL3D::CIGSurfaceLightBuild::CSurface::Width</a>, <a class="el" href="a06476.html#l00099">NL3D::CSurfaceLightGrid::Width</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01502">lightIgSimple()</a>. +<p> +<div class="fragment"><pre>00307 { +00308 <a class="code" href="a04558.html#a14">sint</a> i; +00309 CVector outGlobalPos; +00310 std::vector<CCluster> outClusters; +00311 std::vector<CPortal> outPortals; +00312 std::vector<CPointLightNamed> pointLightList; +00313 +00314 <a class="code" href="a04199.html#a6">nlassert</a>(lightDesc.OverSampling==0 || lightDesc.OverSampling==2 || lightDesc.OverSampling==4 +00315 || lightDesc.OverSampling==8 || lightDesc.OverSampling==16); +00316 +00317 <span class="comment">// Setup.</span> +00318 <span class="comment">//========</span> +00319 +00320 <span class="comment">// Prepare IGSurfaceLight lighting</span> +00321 <span class="comment">//-----------</span> +00322 <span class="comment">// Bkup SurfaceLightBuild to know if must light the surfaces, in differents part of the process.</span> +00323 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>= igSurfaceLightBuild; +00324 <span class="comment">// Prepare _IGRetrieverGridMap.</span> +00325 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.clear(); +00326 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>) +00327 { +00328 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_18">_TotalCellNumber</a>= 0; +00329 CIGSurfaceLightBuild::ItRetrieverGridMap itSrc; +00330 itSrc= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.begin(); +00331 <span class="comment">// For all retrievers Infos in _IGSurfaceLightBuild</span> +00332 <span class="keywordflow">while</span>(itSrc!=<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.end()) +00333 { +00334 <a class="code" href="a04558.html#a15">uint</a> numSurfaces= itSrc->second.Grids.size(); +00335 <span class="comment">// If !empty retriever.</span> +00336 <span class="keywordflow">if</span>(numSurfaces>0) +00337 { +00338 <span class="comment">// Add it to the map, </span> +00339 CIGSurfaceLight::CRetrieverLightGrid &rlgDst= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>[itSrc->first]; +00340 <span class="comment">// resize Array of surfaces.</span> +00341 rlgDst.Grids.resize(numSurfaces); +00342 <span class="comment">// For all surfaces, init them in rlgDst.</span> +00343 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<numSurfaces; i++) +00344 { +00345 CIGSurfaceLightBuild::CSurface &surfSrc= itSrc->second.Grids[i]; +00346 CSurfaceLightGrid &surfDst= rlgDst.Grids[i]; +00347 <span class="comment">// Init Cells with a default CellCorner</span> +00348 CSurfaceLightGrid::CCellCorner defaultCellCorner; +00349 defaultCellCorner.SunContribution= 0; +00350 defaultCellCorner.Light[0]= 0xFF; +00351 defaultCellCorner.LocalAmbientId= 0xFF; +00352 +00353 <span class="comment">// Init the grid.</span> +00354 surfDst.Origin= surfSrc.Origin; +00355 surfDst.Width= surfSrc.Width; +00356 surfDst.Height= surfSrc.Height; +00357 surfDst.Cells.resize(surfSrc.Cells.size()); +00358 surfDst.Cells.fill(defaultCellCorner); +00359 <span class="comment">// The grid must be valid an not empty</span> +00360 <a class="code" href="a04199.html#a6">nlassert</a>( surfDst.Cells.size() == surfDst.Width*surfDst.Height ); +00361 <a class="code" href="a04199.html#a6">nlassert</a>( surfDst.Width>= 2 ); +00362 <a class="code" href="a04199.html#a6">nlassert</a>( surfDst.Height>= 2 ); +00363 +00364 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_18">_TotalCellNumber</a>+= surfDst.Cells.size(); +00365 } +00366 } +00367 +00368 <span class="comment">// Next localRetriever info.</span> +00369 itSrc++; +00370 } +00371 } +00372 <span class="comment">// Reset cell iteration.</span> +00373 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">true</span>; +00374 +00375 +00376 <span class="comment">// Retrieve info from igIn.</span> +00377 <span class="comment">//-----------</span> +00378 igIn.retrieve (outGlobalPos, _Instances, outClusters, outPortals, pointLightList); +00379 +00380 +00381 <span class="comment">// set All Instances StaticLightEnabled= true, and Build _InstanceInfos.</span> +00382 <span class="comment">//-----------</span> +00383 <span class="comment">// Map of shape</span> +00384 std::map<string, IShape*> shapeMap; +00385 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>.resize(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size()); +00386 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size();i++) +00387 { +00388 <span class="comment">// Avoid StaticLight precomputing??</span> +00389 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].AvoidStaticLightPreCompute) +00390 { +00391 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled= <span class="keyword">false</span>; +00392 <span class="comment">// Next instance.</span> +00393 <span class="keywordflow">continue</span>; +00394 } +00395 +00396 <span class="comment">// Else let's do it.</span> +00397 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled= <span class="keyword">true</span>; +00398 +00399 +00400 <span class="comment">// Get the shape centerPos;</span> +00401 <span class="comment">//------------</span> +00402 CVector shapeCenterPos; +00403 CVector overSamples[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterw0NL3D_1_1CInstanceLighterw1">MaxOverSamples</a>]; +00404 +00405 <span class="comment">// Get the instance shape name</span> +00406 string name= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].Name; +00407 <span class="keywordtype">bool</span> shapeFound= <span class="keyword">true</span>; +00408 +00409 <span class="comment">// Try to find the shape in the UseShapeMap.</span> +00410 std::map<string, IShape*>::const_iterator iteMap= lightDesc.UserShapeMap.find (name); +00411 +00412 <span class="comment">// If not found in userShape map, try to load it from the temp loaded ShapeBank.</span> +00413 <span class="keywordflow">if</span>( iteMap == lightDesc.UserShapeMap.end() ) +00414 { +00415 <span class="comment">// Add a .shape at the end ?</span> +00416 <span class="keywordflow">if</span> (name.find(<span class="charliteral">'.'</span>) == std::string::npos) +00417 name += <span class="stringliteral">".shape"</span>; +00418 +00419 <span class="comment">// Get the instance shape name</span> +00420 string nameLookup = CPath::lookup (name, <span class="keyword">false</span>, <span class="keyword">false</span>); +00421 <span class="keywordflow">if</span> (!nameLookup.empty()) +00422 name = nameLookup; +00423 +00424 <span class="comment">// Find the shape in the bank</span> +00425 iteMap= shapeMap.find (name); +00426 <span class="keywordflow">if</span> (iteMap==shapeMap.end()) +00427 { +00428 <span class="comment">// Input file</span> +00429 <a class="code" href="a02653.html">CIFile</a> inputFile; +00430 +00431 <span class="keywordflow">if</span> (!name.empty() && inputFile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea12">open</a> (name)) +00432 { +00433 <span class="comment">// Load it</span> +00434 CShapeStream stream; +00435 stream.serial (inputFile); +00436 +00437 <span class="comment">// Get the pointer</span> +00438 iteMap=shapeMap.insert (std::map<string, IShape*>::value_type (name, stream.getShapePointer ())).first; +00439 } +00440 <span class="keywordflow">else</span> +00441 { +00442 <span class="comment">// Error</span> +00443 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"WARNING can't load shape %s\n"</span>, name.c_str()); +00444 shapeFound= <span class="keyword">false</span>; +00445 } +00446 } +00447 } +00448 +00449 +00450 <span class="comment">// Last chance to skip it: fully LightMapped ??</span> +00451 <span class="comment">//-----------</span> +00452 <span class="keywordflow">if</span>(shapeFound) +00453 { +00454 CMeshBase *mesh= dynamic_cast<CMeshBase*>(iteMap->second); +00455 <span class="keywordflow">if</span>(mesh) +00456 { +00457 <span class="comment">// If this mesh is not lightable (fully lightMapped)</span> +00458 <span class="keywordflow">if</span>(!mesh->isLightable()) +00459 { +00460 <span class="comment">// Force Avoid StaticLight precomputing</span> +00461 _Instances[i].AvoidStaticLightPreCompute= <span class="keyword">true</span>; +00462 <span class="comment">// Disable static lighting.</span> +00463 _Instances[i].StaticLightEnabled= <span class="keyword">false</span>; +00464 <span class="comment">// Next instance.</span> +00465 <span class="keywordflow">continue</span>; +00466 } +00467 } +00468 } +00469 +00470 +00471 <span class="comment">// Compute pos and OverSamples</span> +00472 <span class="comment">//-----------</span> +00473 { +00474 <span class="comment">// Compute bbox, or default bbox</span> +00475 CAABBox bbox; +00476 <span class="keywordflow">if</span>(!shapeFound) +00477 { +00478 bbox.setCenter(CVector::Null); +00479 bbox.setHalfSize(CVector::Null); +00480 } +00481 <span class="keywordflow">else</span> +00482 { +00483 iteMap->second->getAABBox(bbox); +00484 } +00485 <span class="comment">// get pos</span> +00486 shapeCenterPos= bbox.getCenter(); +00487 +00488 +00489 <span class="comment">// Compute overSamples</span> +00490 <span class="keywordtype">float</span> qx= bbox.getHalfSize().x/2; +00491 <span class="keywordtype">float</span> qy= bbox.getHalfSize().y/2; +00492 <span class="keywordtype">float</span> qz= bbox.getHalfSize().z/2; +00493 <span class="comment">// No OverSampling => just copy.</span> +00494 <span class="keywordflow">if</span>(lightDesc.OverSampling==0) +00495 overSamples[0]= shapeCenterPos; +00496 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(lightDesc.OverSampling==2) +00497 { +00498 <span class="comment">// Prefer Z Axis.</span> +00499 overSamples[0]= shapeCenterPos + CVector(0, 0, qz); +00500 overSamples[1]= shapeCenterPos - CVector(0, 0, qz); +00501 } +00502 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(lightDesc.OverSampling==4) +00503 { +00504 <span class="comment">// Apply an overSampling such that we see 4 points if we look on each side of the bbox.</span> +00505 overSamples[0]= shapeCenterPos + CVector(-qx, -qy, -qz); +00506 overSamples[1]= shapeCenterPos + CVector(+qx, -qy, +qz); +00507 overSamples[2]= shapeCenterPos + CVector(-qx, +qy, +qz); +00508 overSamples[3]= shapeCenterPos + CVector(+qx, +qy, -qz); +00509 } +00510 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(lightDesc.OverSampling==8 || lightDesc.OverSampling==16) +00511 { +00512 <span class="comment">// 8x is the best overSampling shceme for bbox</span> +00513 overSamples[0]= shapeCenterPos + CVector(-qx, -qy, -qz); +00514 overSamples[1]= shapeCenterPos + CVector(+qx, -qy, -qz); +00515 overSamples[2]= shapeCenterPos + CVector(-qx, +qy, -qz); +00516 overSamples[3]= shapeCenterPos + CVector(+qx, +qy, -qz); +00517 overSamples[4]= shapeCenterPos + CVector(-qx, -qy, +qz); +00518 overSamples[5]= shapeCenterPos + CVector(+qx, -qy, +qz); +00519 overSamples[6]= shapeCenterPos + CVector(-qx, +qy, +qz); +00520 overSamples[7]= shapeCenterPos + CVector(+qx, +qy, +qz); +00521 +00522 <span class="comment">// 16x => use this setup, and decal from 1/8</span> +00523 <span class="keywordflow">if</span>(lightDesc.OverSampling==16) +00524 { +00525 CVector decal(qx/2, qy/2, qz/2); +00526 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> sample=0; sample<8; sample++) +00527 { +00528 <span class="comment">// Copy and decal</span> +00529 overSamples[sample+8]= overSamples[sample] + decal; +00530 <span class="comment">// neg decal me</span> +00531 overSamples[sample]-= decal; +00532 } +00533 } +00534 } +00535 } +00536 +00537 +00538 <span class="comment">// Compute pos of the instance</span> +00539 <span class="comment">//------------</span> +00540 CMatrix matInst; +00541 matInst.setPos(_Instances[i].Pos); +00542 matInst.setRot(_Instances[i].Rot); +00543 matInst.scale(_Instances[i].Scale); +00544 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].CenterPos= matInst * shapeCenterPos; +00545 <span class="comment">// Apply matInst to samples.</span> +00546 <a class="code" href="a04558.html#a15">uint</a> nSamples= max(1U, lightDesc.OverSampling); +00547 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> sample=0; sample<nSamples; sample++) +00548 { +00549 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].OverSamples[sample]= matInst * overSamples[sample]; +00550 } +00551 } +00552 +00553 <span class="comment">// Clean Up shapes.</span> +00554 <span class="comment">//-----------</span> +00555 std::map<string, IShape*>::iterator iteMap; +00556 iteMap= shapeMap.begin(); +00557 <span class="keywordflow">while</span>(iteMap!= shapeMap.end()) +00558 { +00559 <span class="comment">// delte shape</span> +00560 <span class="keyword">delete</span> iteMap->second; +00561 <span class="comment">// delete entry in map</span> +00562 shapeMap.erase(iteMap); +00563 <span class="comment">// next</span> +00564 iteMap= shapeMap.begin(); +00565 } +00566 +00567 <span class="comment">// Build all obstacles plane.</span> +00568 <span class="comment">//-----------</span> +00569 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)obstacles.size();i++) +00570 { +00571 CInstanceLighter::CTriangle& triangle=obstacles[i]; +00572 <span class="comment">// Calc the plane</span> +00573 triangle.Plane.make (triangle.Triangle.V0, triangle.Triangle.V1, triangle.Triangle.V2); +00574 } +00575 +00576 +00577 <span class="comment">// Lighting</span> +00578 <span class="comment">//========</span> +00579 <span class="comment">// Light With Sun: build the grid, and do it on all _Instances, using _InstanceInfos</span> +00580 <span class="comment">// Compute also Lighting on surface.</span> +00581 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterd1">computeSunContribution</a>(lightDesc, obstacles, landscape); +00582 +00583 <span class="comment">// Light With PointLights</span> +00584 <span class="comment">// build the cubeGrids</span> +00585 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterd0">compilePointLightRT</a>(lightDesc.GridSize, lightDesc.GridCellSize, obstacles, lightDesc.Shadow); +00586 <span class="comment">// kill pointLightList, because will use mine.</span> +00587 pointLightList.clear(); +00588 <span class="comment">// Light for all _Instances, using _InstanceInfos</span> +00589 <span class="comment">// Compute also Lighting on surface.</span> +00590 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterd3">processIGPointLightRT</a>(pointLightList); +00591 +00592 <span class="comment">// If _IGSurfaceLightBuild, then dilate lighting</span> +00593 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>) +00594 { +00595 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterd2">dilateLightingOnSurfaceCells</a>(); +00596 } +00597 +00598 +00599 <span class="comment">// Build result.</span> +00600 <span class="comment">//========</span> +00601 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>) +00602 { +00603 <span class="comment">// build with IGSurfaceLight lighting</span> +00604 igOut.build(outGlobalPos, _Instances, outClusters, outPortals, pointLightList, +00605 &_IGRetrieverGridMap, <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->CellSize); +00606 } +00607 <span class="keywordflow">else</span> +00608 { +00609 <span class="comment">// build without IGSurfaceLight lighting</span> +00610 igOut.build(outGlobalPos, _Instances, outClusters, outPortals, pointLightList); +00611 } +00612 +00613 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLightere2" doxytag="NL3D::CInstanceLighter::lightIgSimple" ></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::CInstanceLighter::lightIgSimple </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02675.html">CInstanceLighter</a> & </td> + <td class="mdname" nowrap> <em>instLighter</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02671.html">CInstanceGroup</a> & </td> + <td class="mdname" nowrap> <em>igIn</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02671.html">CInstanceGroup</a> & </td> + <td class="mdname" nowrap> <em>igOut</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02677.html">CLightDesc</a> & </td> + <td class="mdname" nowrap> <em>lightDesc</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const char * </td> + <td class="mdname" nowrap> <em>igName</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Tool method which take a single IG, and do all the god job to light this one, with no other dependencies NB: it uses instLighter passed, <a class="el" href="a02675.html#NL3D_1_1CInstanceLightera1">init()</a> ing it. It use lightDesc.UserShapeMap or it load Shape in directory lightDesc.ShapePath +<p> +Definition at line <a class="el" href="a05824.html#l01502">1502</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05824.html#l00999">addStaticPointLight()</a>, <a class="el" href="a06350.html#l00225">NL3D::CInstanceGroup::getInstance()</a>, <a class="el" href="a06350.html#l00181">NL3D::CInstanceGroup::getInstancePos()</a>, <a class="el" href="a06350.html#l00189">NL3D::CInstanceGroup::getInstanceRot()</a>, <a class="el" href="a06350.html#l00197">NL3D::CInstanceGroup::getInstanceScale()</a>, <a class="el" href="a06350.html#l00158">NL3D::CInstanceGroup::getNumInstance()</a>, <a class="el" href="a06351.html#l00338">NL3D::CInstanceGroup::getPointLightList()</a>, <a class="el" href="a06350.html#l00165">NL3D::CInstanceGroup::getShapeName()</a>, <a class="el" href="a06376.html#l00113">NL3D::CShapeStream::getShapePointer()</a>, <a class="el" href="a05824.html#l00072">init()</a>, <a class="el" href="a05824.html#l00305">light()</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05708.html#l00135">NLMISC::CIFile::open()</a>, <a class="el" href="a05825.html#l00159">progress()</a>, <a class="el" href="a05972.html#l00644">NLMISC::CMatrix::scale()</a>, <a class="el" href="a06376.html#l00120">NL3D::CShapeStream::serial()</a>, <a class="el" href="a05972.html#l00267">NLMISC::CMatrix::setPos()</a>, <a class="el" href="a05972.html#l00209">NLMISC::CMatrix::setRot()</a>, <a class="el" href="a05825.html#l00083">NL3D::CInstanceLighter::CLightDesc::Shadow</a>, <a class="el" href="a05981.html#l00104">sint</a>, and <a class="el" href="a05825.html#l00089">NL3D::CInstanceLighter::CLightDesc::UserShapeMap</a>. +<p> +<div class="fragment"><pre>01503 { +01504 <a class="code" href="a04558.html#a14">sint</a> i; +01505 +01506 +01507 <span class="comment">// Setup.</span> +01508 <span class="comment">//=======</span> +01509 <span class="comment">// Init</span> +01510 instLighter.init(); +01511 +01512 <span class="comment">// Add obstacles.</span> +01513 std::vector<CInstanceLighter::CTriangle> obstacles; +01514 <span class="comment">// only if Shadowing On.</span> +01515 <span class="keywordflow">if</span>(lightDesc.Shadow) +01516 { +01517 <span class="comment">// Map of shape to load</span> +01518 std::map<string, IShape*> shapeMap; +01519 +01520 <span class="comment">// For all instances of igIn.</span> +01521 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)igIn.getNumInstance();i++) +01522 { +01523 <span class="comment">// progress</span> +01524 instLighter.progress(<span class="stringliteral">"Loading Shapes obstacles"</span>, <span class="keywordtype">float</span>(i)/igIn.getNumInstance()); +01525 +01526 <span class="comment">// Skip it??</span> +01527 <span class="keywordflow">if</span>(igIn.getInstance(i).DontCastShadow) +01528 <span class="keywordflow">continue</span>; +01529 +01530 <span class="comment">// Get the instance shape name</span> +01531 string name= igIn.getShapeName(i); +01532 <span class="keywordtype">bool</span> shapeFound= <span class="keyword">true</span>; +01533 +01534 <span class="comment">// Try to find the shape in the UseShapeMap.</span> +01535 std::map<string, IShape*>::const_iterator iteMap= lightDesc.UserShapeMap.find (name); +01536 +01537 <span class="comment">// If not found in userShape map, try to load it from the temp loaded ShapeBank.</span> +01538 <span class="keywordflow">if</span>( iteMap == lightDesc.UserShapeMap.end() ) +01539 { +01540 <span class="comment">// Add a .shape at the end ?</span> +01541 <span class="keywordflow">if</span> (name.find(<span class="charliteral">'.'</span>) == std::string::npos) +01542 name += <span class="stringliteral">".shape"</span>; +01543 +01544 <span class="comment">// Get the instance shape name</span> +01545 string nameLookup = CPath::lookup (name, <span class="keyword">false</span>, <span class="keyword">false</span>); +01546 <span class="keywordflow">if</span> (!nameLookup.empty()) +01547 name = nameLookup; +01548 +01549 <span class="comment">// Find the shape in the bank</span> +01550 iteMap= shapeMap.find (name); +01551 <span class="keywordflow">if</span> (iteMap==shapeMap.end()) +01552 { +01553 <span class="comment">// Input file</span> +01554 <a class="code" href="a02653.html">CIFile</a> inputFile; +01555 +01556 <span class="keywordflow">if</span> (!name.empty() && inputFile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea12">open</a> (name)) +01557 { +01558 <span class="comment">// Load it</span> +01559 CShapeStream stream; +01560 stream.serial (inputFile); +01561 +01562 <span class="comment">// Get the pointer</span> +01563 iteMap=shapeMap.insert (std::map<string, IShape*>::value_type (name, stream.getShapePointer ())).first; +01564 } +01565 <span class="keywordflow">else</span> +01566 { +01567 <span class="comment">// Error</span> +01568 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"WARNING can't load shape %s\n"</span>, name.c_str()); +01569 shapeFound= <span class="keyword">false</span>; +01570 } +01571 } +01572 } +01573 +01574 <span class="keywordflow">if</span>(shapeFound) +01575 { +01576 CMatrix matInst; +01577 matInst.setPos(igIn.getInstancePos(i)); +01578 matInst.setRot(igIn.getInstanceRot(i)); +01579 matInst.scale(igIn.getInstanceScale(i)); +01580 <span class="comment">// Add triangles of this shape</span> +01581 CInstanceLighter::addTriangles(*iteMap->second, matInst, obstacles, i); +01582 } +01583 +01584 } +01585 +01586 <span class="comment">// Clean Up shapes.</span> +01587 <span class="comment">//-----------</span> +01588 std::map<string, IShape*>::iterator iteMap; +01589 iteMap= shapeMap.begin(); +01590 <span class="keywordflow">while</span>(iteMap!= shapeMap.end()) +01591 { +01592 <span class="comment">// delte shape</span> +01593 <span class="keyword">delete</span> iteMap->second; +01594 <span class="comment">// delete entry in map</span> +01595 shapeMap.erase(iteMap); +01596 <span class="comment">// next</span> +01597 iteMap= shapeMap.begin(); +01598 } +01599 } +01600 +01601 <span class="comment">// Add pointLights of the IG.</span> +01602 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)igIn.getPointLightList().size();i++) +01603 { +01604 instLighter.addStaticPointLight( igIn.getPointLightList()[i], igName ); +01605 } +01606 +01607 +01608 <span class="comment">// Run.</span> +01609 <span class="comment">//=======</span> +01610 instLighter.light(igIn, igOut, lightDesc, obstacles); +01611 +01612 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_9" doxytag="NL3D::CInstanceLighter::nextCell" ></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::CInstanceLighter::nextCell </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01663">1663</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00214">_IGRetrieverGridMap</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00293">_IsEndCell</a>, <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00294">_ItCurrentCellNumber</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05809.html#l00112">NL3D::CIGSurfaceLightBuild::RetrieverGridMap</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. +<p> +<div class="fragment"><pre>01664 { +01665 <a class="code" href="a04199.html#a6">nlassert</a>(!<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>()); +01666 +01667 <span class="comment">// Next Cell.</span> +01668 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>++; +01669 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_13">_ItCurrentCellNumber</a>++; +01670 +01671 <span class="comment">// If end of Cells, next surface.</span> +01672 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a> >= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>].Cells.size() ) +01673 { +01674 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>= 0; +01675 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a> ++; +01676 } +01677 +01678 <span class="comment">// If end of surface, next retriever.</span> +01679 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a> >= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids.size() ) +01680 { +01681 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>= 0; +01682 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>++; +01683 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a> != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.end()) +01684 { +01685 <span class="comment">// Get info.</span> +01686 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.find(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->first); +01687 <a class="code" href="a04199.html#a6">nlassert</a>(_ItRetrieverInfo != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.end() ); +01688 } +01689 } +01690 +01691 <span class="comment">// If end of retreiver, End.</span> +01692 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a> == <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.end()) +01693 { +01694 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">true</span>; +01695 } +01696 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterd3" doxytag="NL3D::CInstanceLighter::processIGPointLightRT" ></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::CInstanceLighter::processIGPointLightRT </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">std::vector< <a class="el" href="a03094.html">CPointLightNamed</a> > & </td> + <td class="mdname1" valign="top" nowrap> <em>listPointLight</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Process the IG, ie process _InstanceInfos. Also process SurfaceLightGrid MultiCPU: not done for now. Be aware of <a class="el" href="a02678.html#NL3D_1_1CInstanceLighter_1_1CPointLightRTo5">CPointLightRT::RefCount</a>!!!! +<p> +Definition at line <a class="el" href="a05824.html#l01161">1161</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00210">_CurrentInstanceComputed</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00208">_InstanceInfos</a>, <a class="el" href="a05825.html#l00255">_StaticPointLightQuadGrid</a>, <a class="el" href="a05825.html#l00253">_StaticPointLights</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_0">NL3D::CQuadGrid< CPointLightRT * >::begin()</a>, <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05825.html#l00223">NL3D::CInstanceLighter::CPointLightRT::BSphere</a>, <a class="el" href="a05505.html#l00048">NLMISC::CBSphere::Center</a>, <a class="el" href="a05809.html#l00068">NL3D::CIGSurfaceLightBuild::CCellCorner::CenterPos</a>, <a class="el" href="a05825.html#l00193">NL3D::CInstanceLighter::CInstanceInfo::CenterPos</a>, <a class="el" href="a05825.html#l00230">NL3D::CInstanceLighter::CPointLightRT::DstId</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_2">NL3D::CQuadGrid< CPointLightRT * >::end()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a06179.html#l00138">NL3D::CPointLight::getType()</a>, <a class="el" href="a05809.html#l00059">NL3D::CIGSurfaceLightBuild::CCellCorner::InSurface</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a06476.html#l00070">NL3D::CSurfaceLightGrid::CCellCorner::Light</a>, <a class="el" href="a06351.html#l00115">NL3D::CInstanceGroup::CInstance::Light</a>, <a class="el" href="a05825.html#l00199">NL3D::CInstanceLighter::CInstanceInfo::Light</a>, <a class="el" href="a05809.html#l00078">NL3D::CIGSurfaceLightBuild::CCellCorner::LightInfo</a>, <a class="el" href="a06476.html#l00074">NL3D::CSurfaceLightGrid::CCellCorner::LocalAmbientId</a>, <a class="el" href="a06351.html#l00119">NL3D::CInstanceGroup::CInstance::LocalAmbientId</a>, <a class="el" href="a05809.html#l00079">NL3D::CIGSurfaceLightBuild::CCellCorner::LocalAmbientLight</a>, <a class="el" href="a05825.html#l00202">NL3D::CInstanceLighter::CInstanceInfo::LocalAmbientLight</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, <a class="el" href="a05622.html#l00541">nlctassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05825.html#l00246">NL3D::CInstanceLighter::CPredPointLightToPoint::Point</a>, <a class="el" href="a05825.html#l00220">NL3D::CInstanceLighter::CPointLightRT::PointLight</a>, <a class="el" href="a05825.html#l00159">progress()</a>, <a class="el" href="a05824.html#l01623">progressCell()</a>, <a class="el" href="a05505.html#l00049">NLMISC::CBSphere::Radius</a>, <a class="el" href="a05825.html#l00228">NL3D::CInstanceLighter::CPointLightRT::RefCount</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_3">NL3D::CQuadGrid< CPointLightRT * >::select()</a>, <a class="el" href="a05824.html#l00954">NL3D::CInstanceLighter::CPointLightRT::testRaytrace()</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00305">light()</a>. +<p> +<div class="fragment"><pre>01162 { +01163 <a class="code" href="a04558.html#a15">uint</a> i; +01164 vector<CPointLightRT*> lightInfs; +01165 lightInfs.reserve(1024); +01166 +01167 <span class="comment">// clear result list</span> +01168 listPointLight.clear(); +01169 +01170 +01171 <span class="comment">// Compute each Instance</span> +01172 <span class="comment">//===========</span> +01173 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>.size(); i++) +01174 { +01175 <span class="comment">// If staticLight not enabled, skip.</span> +01176 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled ) +01177 <span class="keywordflow">continue</span>; +01178 +01179 CInstanceInfo &inst= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i]; +01180 <span class="comment">// Avoid autoShadowing</span> +01181 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr0">_CurrentInstanceComputed</a>= i; +01182 +01183 <span class="comment">// progress</span> +01184 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute Influences of PointLights 2/2"</span>, i / (<span class="keywordtype">float</span>)_InstanceInfos.size()); +01185 +01186 <span class="comment">// get the point of the instance.</span> +01187 CVector pos= inst.CenterPos; +01188 +01189 <span class="comment">// Default: takes no LocalAmbientLight;</span> +01190 inst.LocalAmbientLight= NULL; +01191 <span class="keywordtype">float</span> furtherAmbLight= 0; +01192 +01193 <span class="comment">// Compute Which light influences him.</span> +01194 <span class="comment">//---------</span> +01195 lightInfs.clear(); +01196 <span class="comment">// Search possible lights around the position.</span> +01197 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.select(pos, pos); +01198 <span class="comment">// For all of them, get the ones which touch this point.</span> +01199 CQuadGrid<CPointLightRT*>::CIterator it= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.begin(); +01200 <span class="keywordflow">while</span>(it != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.end()) +01201 { +01202 CPointLightRT *pl= *it; +01203 +01204 <span class="comment">// Test if really in the radius of the light, no occlusion, not an ambient, and in Spot Angle setup</span> +01205 <span class="keywordflow">if</span>( pl->testRaytrace(pos, _CurrentInstanceComputed) ) +01206 { +01207 <span class="comment">// Ok, add the light to the lights which influence the instance</span> +01208 lightInfs.push_back(pl); +01209 } +01210 +01211 <span class="comment">// Ambient Light ??</span> +01212 <span class="keywordflow">if</span>( pl->PointLight.getType() == CPointLight::AmbientLight ) +01213 { +01214 <span class="comment">// If the instance is in radius of the ambiant light.</span> +01215 <span class="keywordtype">float</span> dRadius= pl->BSphere.Radius - (pl->BSphere.Center - pos).norm(); +01216 <span class="keywordflow">if</span>(dRadius>0) +01217 { +01218 <span class="comment">// Take the best ambient light: the one which is further from the circumference</span> +01219 <span class="keywordflow">if</span>(dRadius > furtherAmbLight) +01220 { +01221 furtherAmbLight= dRadius; +01222 inst.LocalAmbientLight= pl; +01223 } +01224 } +01225 } +01226 +01227 <span class="comment">// next</span> +01228 it++; +01229 } +01230 +01231 <span class="comment">// If ambientLight chosen, inc Ref count of it</span> +01232 <span class="keywordflow">if</span>(inst.LocalAmbientLight) +01233 inst.LocalAmbientLight->RefCount++; +01234 +01235 <span class="comment">// Choose the Best ones.</span> +01236 <span class="comment">//---------</span> +01237 CPredPointLightToPoint predPLTP; +01238 predPLTP.Point= pos; +01239 <span class="comment">// sort.</span> +01240 sort(lightInfs.begin(), lightInfs.end(), predPLTP); +01241 <span class="comment">// truncate.</span> +01242 lightInfs.resize( <a class="code" href="a04061.html#a0">min</a>((<a class="code" href="a04558.html#a15">uint</a>)lightInfs.size(), (<a class="code" href="a04558.html#a15">uint</a>)CInstanceGroup::NumStaticLightPerInstance) ); +01243 +01244 +01245 <span class="comment">// For each of them, fill instance</span> +01246 <span class="comment">//---------</span> +01247 <a class="code" href="a04558.html#a15">uint</a> lightInfId; +01248 <span class="keywordflow">for</span>(lightInfId=0; lightInfId<lightInfs.size(); lightInfId++) +01249 { +01250 CPointLightRT *pl= lightInfs[lightInfId]; +01251 +01252 <span class="comment">// copy light.</span> +01253 inst.Light[lightInfId]= pl; +01254 +01255 <span class="comment">// Inc RefCount of the light.</span> +01256 pl->RefCount++; +01257 } +01258 <span class="comment">// Reset any empty slot to NULL.</span> +01259 <span class="keywordflow">for</span>(; lightInfId<CInstanceGroup::NumStaticLightPerInstance; lightInfId++) +01260 { +01261 inst.Light[lightInfId]= NULL; +01262 } +01263 +01264 } +01265 +01266 +01267 <span class="comment">// Compute Lighting on SurfaceLightGrid</span> +01268 <span class="comment">//===========</span> +01269 <span class="comment">// Must do it before compression !!</span> +01270 <span class="comment">// NB: big copy/Past from above</span> +01271 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>) +01272 { +01273 <span class="comment">// No instance currenlty computed, since we compute surface cells.</span> +01274 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr0">_CurrentInstanceComputed</a>= -1; +01275 +01276 <span class="comment">// Begin cell iteration</span> +01277 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>(); +01278 <span class="comment">// For all surface cell corners</span> +01279 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() ) +01280 { +01281 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a>(<span class="stringliteral">"Compute PointLights on Surfaces"</span>); +01282 +01283 <span class="comment">// get the current cellInfo iterated.</span> +01284 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>(); +01285 +01286 <span class="comment">// if the cell corner lies in the polygon surface.</span> +01287 <span class="keywordflow">if</span>(cellInfo.InSurface) +01288 { +01289 <span class="comment">// get the point of the cell.</span> +01290 CVector pos= cellInfo.CenterPos; +01291 +01292 <span class="comment">// Default: takes no LocalAmbientLight;</span> +01293 cellInfo.LocalAmbientLight= NULL; +01294 <span class="keywordtype">float</span> furtherAmbLight= 0; +01295 +01296 <span class="comment">// Compute Which light influences him.</span> +01297 <span class="comment">//---------</span> +01298 lightInfs.clear(); +01299 <span class="comment">// Search possible lights around the position.</span> +01300 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.select(pos, pos); +01301 <span class="comment">// For all of them, get the ones which touch this point.</span> +01302 CQuadGrid<CPointLightRT*>::CIterator it= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.begin(); +01303 <span class="keywordflow">while</span>(it != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.end()) +01304 { +01305 CPointLightRT *pl= *it; +01306 +01307 <span class="comment">// Test if really in the radius of the light, no occlusion, not an ambient, and in Spot Angle setup</span> +01308 <span class="keywordflow">if</span>( pl->testRaytrace(pos, _CurrentInstanceComputed) ) +01309 { +01310 <span class="comment">// Ok, add the light to the lights which influence the cell</span> +01311 lightInfs.push_back(pl); +01312 } +01313 +01314 <span class="comment">// Ambient Light ??</span> +01315 <span class="keywordflow">if</span>( pl->PointLight.getType() == CPointLight::AmbientLight ) +01316 { +01317 <span class="comment">// If the instance is in radius of the ambiant light.</span> +01318 <span class="keywordtype">float</span> dRadius= pl->BSphere.Radius - (pl->BSphere.Center - pos).norm(); +01319 <span class="keywordflow">if</span>(dRadius>0) +01320 { +01321 <span class="comment">// Take the best ambient light: the one which is further from the circumference</span> +01322 <span class="keywordflow">if</span>(dRadius > furtherAmbLight) +01323 { +01324 furtherAmbLight= dRadius; +01325 cellInfo.LocalAmbientLight= pl; +01326 } +01327 } +01328 } +01329 +01330 <span class="comment">// next</span> +01331 it++; +01332 } +01333 +01334 <span class="comment">// If ambientLight chosen, inc Ref count of it</span> +01335 <span class="keywordflow">if</span>(cellInfo.LocalAmbientLight) +01336 ((CPointLightRT*)cellInfo.LocalAmbientLight)->RefCount++; +01337 +01338 +01339 <span class="comment">// Choose the Best ones.</span> +01340 <span class="comment">//---------</span> +01341 CPredPointLightToPoint predPLTP; +01342 predPLTP.Point= pos; +01343 <span class="comment">// sort.</span> +01344 sort(lightInfs.begin(), lightInfs.end(), predPLTP); +01345 <span class="comment">// truncate.</span> +01346 lightInfs.resize( <a class="code" href="a04061.html#a0">min</a>((<a class="code" href="a04558.html#a15">uint</a>)lightInfs.size(), (<a class="code" href="a04558.html#a15">uint</a>)CSurfaceLightGrid::NumLightPerCorner) ); +01347 +01348 +01349 <span class="comment">// For each of them, fill cellInfo</span> +01350 <span class="comment">//---------</span> +01351 <a class="code" href="a04558.html#a15">uint</a> lightInfId; +01352 <span class="keywordflow">for</span>(lightInfId=0; lightInfId<lightInfs.size(); lightInfId++) +01353 { +01354 CPointLightRT *pl= lightInfs[lightInfId]; +01355 +01356 <span class="comment">// copy light.</span> +01357 cellInfo.LightInfo[lightInfId]= pl; +01358 +01359 <span class="comment">// Inc RefCount of the light.</span> +01360 pl->RefCount++; +01361 } +01362 <span class="comment">// Reset any empty slot to NULL.</span> +01363 <span class="keywordflow">for</span>(; lightInfId<CSurfaceLightGrid::NumLightPerCorner; lightInfId++) +01364 { +01365 cellInfo.LightInfo[lightInfId]= NULL; +01366 } +01367 +01368 } +01369 +01370 <span class="comment">// next cell</span> +01371 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>(); +01372 } +01373 } +01374 +01375 +01376 +01377 <span class="comment">// Compress and setup _Instances with compressed data.</span> +01378 <span class="comment">//===========</span> +01379 <a class="code" href="a04558.html#a15">uint</a> plId= 0; +01380 <span class="comment">// Process each pointLights</span> +01381 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>.size(); i++) +01382 { +01383 CPointLightRT &plRT= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>[i]; +01384 <span class="comment">// If this light is used.</span> +01385 <span class="keywordflow">if</span>(plRT.RefCount > 0) +01386 { +01387 <span class="comment">// Valid light ?</span> +01388 <span class="keywordflow">if</span> (plId <=0xFF) +01389 { +01390 <span class="comment">// Must Copy it into Ig.</span> +01391 listPointLight.push_back(plRT.PointLight); +01392 plRT.DstId= plId++; +01393 <span class="comment">// If index >= 255, too many lights (NB: => because 255 is a NULL code).</span> +01394 } +01395 <span class="keywordflow">else</span> +01396 { +01397 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"ERROR: Too many Static Point Lights influence the IG!!"</span>); +01398 <span class="comment">// Set 0xFF. Special code indicating that the light CAN'T BE USED => any instance using </span> +01399 <span class="comment">// it is buggy (won't be lighted by this light).</span> +01400 plRT.DstId= plId++; +01401 } +01402 } +01403 } +01404 +01405 <span class="comment">// For each instance, compress Point light info</span> +01406 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size(); i++) +01407 { +01408 <span class="comment">// If staticLight not enabled, skip.</span> +01409 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled ) +01410 <span class="keywordflow">continue</span>; +01411 +01412 CInstanceInfo &instSrc= _InstanceInfos[i]; +01413 CInstanceGroup::CInstance &instDst= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i]; +01414 +01415 <span class="comment">// Do it for PointLights</span> +01416 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> lightId= 0; lightId<CInstanceGroup::NumStaticLightPerInstance; lightId++) +01417 { +01418 <span class="keywordflow">if</span>(instSrc.Light[lightId] == NULL) +01419 { +01420 <span class="comment">// Mark as unused.</span> +01421 instDst.Light[lightId]= 0xFF; +01422 } +01423 <span class="keywordflow">else</span> +01424 { +01425 <span class="comment">// Get index. NB: may still be 0xFF if 'Too many static light' bug.</span> +01426 instDst.Light[lightId]= instSrc.Light[lightId]->DstId; +01427 } +01428 } +01429 +01430 <span class="comment">// Ensure that all FF are at end of the list (possible because of the TooManyStaticLight bug).</span> +01431 <span class="comment">// But don't do a full sort, to preserve order due to influence...</span> +01432 <a class="code" href="a04199.html#a16">nlctassert</a>(CInstanceGroup::NumStaticLightPerInstance==2); +01433 <span class="keywordflow">if</span>(instDst.Light[0] == 0xFF) swap(instDst.Light[0], instDst.Light[1]); +01434 +01435 <span class="comment">// Do it for Ambientlight</span> +01436 <span class="keywordflow">if</span>(instSrc.LocalAmbientLight == NULL) +01437 instDst.LocalAmbientId= 0xFF; +01438 <span class="keywordflow">else</span> +01439 <span class="comment">// NB: may still be 0xFF if 'Too many static light' bug.</span> +01440 instDst.LocalAmbientId= instSrc.LocalAmbientLight->DstId; +01441 } +01442 +01443 <span class="comment">// For each cell, compress Point light info</span> +01444 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>) +01445 { +01446 <span class="comment">// Begin cell iteration</span> +01447 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>(); +01448 <span class="comment">// For all surface cell corners</span> +01449 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() ) +01450 { +01451 <span class="comment">// get the current cell and cellInfo iterated.</span> +01452 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>(); +01453 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>(); +01454 +01455 <span class="keywordflow">if</span>(cellInfo.InSurface) +01456 { +01457 <span class="comment">// Do it for PointLights</span> +01458 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> lightId= 0; lightId<CSurfaceLightGrid::NumLightPerCorner; lightId++) +01459 { +01460 <span class="keywordflow">if</span>(cellInfo.LightInfo[lightId] == NULL) +01461 { +01462 <span class="comment">// Mark as unused.</span> +01463 cell.Light[lightId]= 0xFF; +01464 } +01465 <span class="keywordflow">else</span> +01466 { +01467 <span class="comment">// Get index. NB: may still be 0xFF if 'Too many static light' bug.</span> +01468 cell.Light[lightId]= reinterpret_cast<CPointLightRT*>(cellInfo.LightInfo[lightId])->DstId; +01469 } +01470 } +01471 +01472 <span class="comment">// Ensure that all FF are at end of the list (possible because of the TooManyStaticLight bug).</span> +01473 <span class="comment">// But don't do a full sort, to preserve order due to influence...</span> +01474 <a class="code" href="a04199.html#a16">nlctassert</a>(CInstanceGroup::NumStaticLightPerInstance==2); +01475 <span class="keywordflow">if</span>(cell.Light[0] == 0xFF) swap(cell.Light[0], cell.Light[1]); +01476 +01477 <span class="comment">// Do it for Ambientlight</span> +01478 <span class="keywordflow">if</span>(cellInfo.LocalAmbientLight == NULL) +01479 cell.LocalAmbientId= 0xFF; +01480 <span class="keywordflow">else</span> +01481 <span class="comment">// NB: may still be 0xFF if 'Too many static light' bug.</span> +01482 cell.LocalAmbientId= ((CPointLightRT*)cellInfo.LocalAmbientLight)->DstId; +01483 } +01484 +01485 <span class="comment">// next cell</span> +01486 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>(); +01487 } +01488 } +01489 +01490 +01491 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLightera3" doxytag="NL3D::CInstanceLighter::progress" ></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"> virtual void NL3D::CInstanceLighter::progress </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const char * </td> + <td class="mdname" nowrap> <em>message</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>progress</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00159">159</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01023">compilePointLightRT()</a>, <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01502">lightIgSimple()</a>, <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>, and <a class="el" href="a05824.html#l01623">progressCell()</a>. +<p> +<div class="fragment"><pre>00159 {}; +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_10" doxytag="NL3D::CInstanceLighter::progressCell" ></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::CInstanceLighter::progressCell </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const char * </td> + <td class="mdname1" valign="top" nowrap> <em>message</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05824.html#l01623">1623</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>. +<p> +References <a class="el" href="a05825.html#l00296">_LastCellProgress</a>, <a class="el" href="a05825.html#l00284">getCurrentCellNumber()</a>, <a class="el" href="a05825.html#l00285">getTotalCellNumber()</a>, and <a class="el" href="a05825.html#l00159">progress()</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. +<p> +<div class="fragment"><pre>01624 { +01625 <span class="keywordtype">float</span> cp= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_3">getCurrentCellNumber</a>() / float(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_6">getTotalCellNumber</a>()); +01626 <span class="keywordflow">if</span>( cp > <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_17">_LastCellProgress</a>+0.05f) +01627 { +01628 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a>(message, cp); +01629 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_17">_LastCellProgress</a>= cp; +01630 } +01631 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NL3D_1_1CInstanceLighterr0" doxytag="NL3D::CInstanceLighter::_CurrentInstanceComputed" ></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#a14">sint</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr0">NL3D::CInstanceLighter::_CurrentInstanceComputed</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00210">210</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterr1" doxytag="NL3D::CInstanceLighter::_IGRetrieverGridMap" ></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="a02654.html#NL3D_1_1CIGSurfaceLightw1">CIGSurfaceLight::TRetrieverGridMap</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr1">NL3D::CInstanceLighter::_IGRetrieverGridMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00214">214</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l00305">light()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterr2" doxytag="NL3D::CInstanceLighter::_IGSurfaceLightBuild" ></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="a02656.html">CIGSurfaceLightBuild</a>* <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr2">NL3D::CInstanceLighter::_IGSurfaceLightBuild</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00212">212</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l00066">CInstanceLighter()</a>, <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l00305">light()</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterr3" doxytag="NL3D::CInstanceLighter::_InstanceInfos" ></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<<a class="el" href="a02676.html">CInstanceInfo</a>> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr3">NL3D::CInstanceLighter::_InstanceInfos</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00208">208</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l00305">light()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterr4" doxytag="NL3D::CInstanceLighter::_Instances" ></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<<a class="el" href="a02672.html">CInstanceGroup::CInstance</a>> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr4">NL3D::CInstanceLighter::_Instances</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00206">206</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_11" doxytag="NL3D::CInstanceLighter::_IsEndCell" ></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"> bool <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">NL3D::CInstanceLighter::_IsEndCell</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00293">293</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a05824.html#l00305">light()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_12" doxytag="NL3D::CInstanceLighter::_ItCellId" ></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="a02675.html#NL3D_1_1CInstanceLighterz209_12">NL3D::CInstanceLighter::_ItCellId</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00292">292</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_13" doxytag="NL3D::CInstanceLighter::_ItCurrentCellNumber" ></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="a02675.html#NL3D_1_1CInstanceLighterz209_13">NL3D::CInstanceLighter::_ItCurrentCellNumber</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00294">294</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05825.html#l00284">getCurrentCellNumber()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_14" doxytag="NL3D::CInstanceLighter::_ItRetriever" ></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="a02654.html#NL3D_1_1CIGSurfaceLightw0">CIGSurfaceLight::ItRetrieverGridMap</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">NL3D::CInstanceLighter::_ItRetriever</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00289">289</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_15" doxytag="NL3D::CInstanceLighter::_ItRetrieverInfo" ></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="a02656.html#NL3D_1_1CIGSurfaceLightBuildw1">CIGSurfaceLightBuild::ItRetrieverGridMap</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">NL3D::CInstanceLighter::_ItRetrieverInfo</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00290">290</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_16" doxytag="NL3D::CInstanceLighter::_ItSurfId" ></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="a02675.html#NL3D_1_1CInstanceLighterz209_16">NL3D::CInstanceLighter::_ItSurfId</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00291">291</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_17" doxytag="NL3D::CInstanceLighter::_LastCellProgress" ></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="a02675.html#NL3D_1_1CInstanceLighterz209_17">NL3D::CInstanceLighter::_LastCellProgress</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00296">296</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, and <a class="el" href="a05824.html#l01623">progressCell()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterr5" doxytag="NL3D::CInstanceLighter::_StaticPointLightQuadGrid" ></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><<a class="el" href="a02678.html">CPointLightRT</a>*> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr5">NL3D::CInstanceLighter::_StaticPointLightQuadGrid</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +QuadGrid of PointLights. Builded from _StaticPointLights. +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00255">255</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l01023">compilePointLightRT()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterr6" doxytag="NL3D::CInstanceLighter::_StaticPointLights" ></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<<a class="el" href="a02678.html">CPointLightRT</a>> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr6">NL3D::CInstanceLighter::_StaticPointLights</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +List of PointLights. +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00253">253</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05824.html#l00999">addStaticPointLight()</a>, <a class="el" href="a05824.html#l01023">compilePointLightRT()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CInstanceLighterz209_18" doxytag="NL3D::CInstanceLighter::_TotalCellNumber" ></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="a02675.html#NL3D_1_1CInstanceLighterz209_18">NL3D::CInstanceLighter::_TotalCellNumber</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05825.html#l00295">295</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. +<p> +Referenced by <a class="el" href="a05825.html#l00285">getTotalCellNumber()</a>, and <a class="el" href="a05824.html#l00305">light()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05825.html">instance_lighter.h</a><li><a class="el" href="a05824.html">instance_lighter.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:47:40 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> |