aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a02656.html
blob: 34591ce334b3f601cc6188aecb9f5378a7bfb77f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
<!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::CIGSurfaceLightBuild class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NL3D::CIGSurfaceLightBuild Class Reference</h1><code>#include &lt;<a class="el" href="a05809.html">ig_surface_light_build.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Class used by <a class="el" href="a02675.html">NL3D::CInstanceLighter</a> to build <a class="el" href="a02654.html">CIGSurfaceLight</a> with PACS surfaces <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2002 </dd></dl>

<p>

<p>
Definition at line <a class="el" href="a05809.html#l00046">46</a> of file <a class="el" href="a05809.html">ig_surface_light_build.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom>{ <a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw0NL3D_1_1CIGSurfaceLightBuildw2">MaxOverSamples</a> =  16
 }</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TRetrieverGridMap::iterator&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw1">ItRetrieverGridMap</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map&lt; <a class="el" href="a04558.html#a15">uint</a>, <a class="el" href="a02658.html">CRetrieverLightGrid</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw3">TRetrieverGridMap</a></td></tr>

<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuilda0">buildPLDebugMesh</a> (<a class="el" href="a02864.html">CMesh::CMeshBuild</a> &amp;meshBuild, <a class="el" href="a02872.html">CMeshBase::CMeshBaseBuild</a> &amp;meshBaseBuild, const <a class="el" href="a03128.html">CVector</a> &amp;deltaPos, const <a class="el" href="a02671.html">CInstanceGroup</a> &amp;igOut)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Debug: build a colored Grid mesh of PointLight. R= pointLight1 id. G= PointLight2 id. B= The multiplier used to show Ids.  <a href="#NL3D_1_1CIGSurfaceLightBuilda0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuilda1">buildSunDebugMesh</a> (<a class="el" href="a02864.html">CMesh::CMeshBuild</a> &amp;meshBuild, <a class="el" href="a02872.html">CMeshBase::CMeshBaseBuild</a> &amp;meshBaseBuild, const <a class="el" href="a03128.html">CVector</a> &amp;deltaPos=<a class="el" href="a03128.html#NLMISC_1_1CVectors3">CVector::Null</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Debug: build a colored Grid mesh of SunContribution.  <a href="#NL3D_1_1CIGSurfaceLightBuilda1"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildo0">CellSize</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw3">TRetrieverGridMap</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildo1">RetrieverGridMap</a></td></tr>

<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildd0">addDebugMeshFaces</a> (<a class="el" href="a02864.html">CMesh::CMeshBuild</a> &amp;meshBuild, <a class="el" href="a02659.html">CSurface</a> &amp;surface, <a class="el" href="a04558.html#a15">uint</a> vId0, const std::vector&lt; <a class="el" href="a03337.html">CRGBA</a> &gt; &amp;colors)</td></tr>

</table>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="NL3D_1_1CIGSurfaceLightBuildw1" doxytag="NL3D::CIGSurfaceLightBuild::ItRetrieverGridMap" ></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"> typedef TRetrieverGridMap::iterator <a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw1">NL3D::CIGSurfaceLightBuild::ItRetrieverGridMap</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05809.html#l00106">106</a> of file <a class="el" href="a05809.html">ig_surface_light_build.h</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CIGSurfaceLightBuildw3" doxytag="NL3D::CIGSurfaceLightBuild::TRetrieverGridMap" ></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"> typedef std::map&lt;<a class="el" href="a04558.html#a15">uint</a>, <a class="el" href="a02658.html">CRetrieverLightGrid</a>&gt; <a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw3">NL3D::CIGSurfaceLightBuild::TRetrieverGridMap</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05809.html#l00105">105</a> of file <a class="el" href="a05809.html">ig_surface_light_build.h</a>.    </td>
  </tr>
</table>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="NL3D_1_1CIGSurfaceLightBuildw0" doxytag="NL3D::CIGSurfaceLightBuild::@13" ></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>
      &nbsp;
    </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_1CIGSurfaceLightBuildw0NL3D_1_1CIGSurfaceLightBuildw2" doxytag="MaxOverSamples" ></a>MaxOverSamples</em>&nbsp;</td><td>
</td></tr>
</table>
</dl>

<p>
Definition at line <a class="el" href="a05809.html#l00050">50</a> of file <a class="el" href="a05809.html">ig_surface_light_build.h</a>.
<p>
<div class="fragment"><pre>00050 {<a class="code" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw0NL3D_1_1CIGSurfaceLightBuildw2">MaxOverSamples</a>= 16};
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CIGSurfaceLightBuildd0" doxytag="NL3D::CIGSurfaceLightBuild::addDebugMeshFaces" ></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::CIGSurfaceLightBuild::addDebugMeshFaces </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02864.html">CMesh::CMeshBuild</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>meshBuild</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a02659.html">CSurface</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>surface</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>&nbsp;</td>
          <td class="mdname" nowrap> <em>vId0</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const std::vector&lt; <a class="el" href="a03337.html">CRGBA</a> &gt; &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>colors</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05808.html#l00191">191</a> of file <a class="el" href="a05808.html">ig_surface_light_build.cpp</a>.
<p>
References <a class="el" href="a05809.html#l00093">NL3D::CIGSurfaceLightBuild::CSurface::Cells</a>, <a class="el" href="a05990.html#l00103">NL3D::CMesh::CFace::Corner</a>, <a class="el" href="a05990.html#l00193">NL3D::CMesh::CMeshBuild::Faces</a>, <a class="el" href="a05809.html#l00091">NL3D::CIGSurfaceLightBuild::CSurface::Height</a>, <a class="el" href="a05990.html#l00104">NL3D::CMesh::CFace::MaterialId</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05809.html#l00090">NL3D::CIGSurfaceLightBuild::CSurface::Width</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>.
<p>
Referenced by <a class="el" href="a05808.html#l00100">buildPLDebugMesh()</a>, and <a class="el" href="a05808.html#l00040">buildSunDebugMesh()</a>.
<p>
<div class="fragment"><pre>00193 {
00194         <span class="comment">// Resize faces.</span>
00195         <a class="code" href="a04558.html#a15">uint</a>    wVert= surface.Width;
00196         <a class="code" href="a04558.html#a15">uint</a>    hVert= surface.Height;
00197         <a class="code" href="a04558.html#a15">uint</a>    wCell= wVert-1;
00198         <a class="code" href="a04558.html#a15">uint</a>    hCell= hVert-1;
00199         <span class="comment">// Allocate enough space for faces.</span>
00200         meshBuild.Faces.reserve(meshBuild.Faces.size() + wCell*hCell *2);
00201 
00202         <span class="comment">// Build faces</span>
00203         <a class="code" href="a04558.html#a15">uint</a>    <a class="code" href="a04223.html#a572">x</a>,<a class="code" href="a04223.html#a573">y</a>;
00204         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0;<a class="code" href="a04223.html#a573">y</a>&lt;hCell; <a class="code" href="a04223.html#a573">y</a>++)
00205         {
00206                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0;<a class="code" href="a04223.html#a572">x</a>&lt;wCell; <a class="code" href="a04223.html#a572">x</a>++)
00207                 {
00208                         <a class="code" href="a04558.html#a15">uint</a>    v00= <a class="code" href="a04223.html#a573">y</a>*wVert + <a class="code" href="a04223.html#a572">x</a>;
00209                         <a class="code" href="a04558.html#a15">uint</a>    v10= <a class="code" href="a04223.html#a573">y</a>*wVert + <a class="code" href="a04223.html#a572">x</a>+1;
00210                         <a class="code" href="a04558.html#a15">uint</a>    v01= (<a class="code" href="a04223.html#a573">y</a>+1)*wVert + <a class="code" href="a04223.html#a572">x</a>;
00211                         <a class="code" href="a04558.html#a15">uint</a>    v11= (<a class="code" href="a04223.html#a573">y</a>+1)*wVert + <a class="code" href="a04223.html#a572">x</a>+1;
00212 
00213                         <span class="comment">// Skip this cell??</span>
00214                         <span class="keywordtype">bool</span>    skip= <span class="keyword">false</span>;
00215                         <span class="keywordflow">if</span>(!surface.Cells[v00].InSurface &amp;&amp; !surface.Cells[v00].Dilated)        skip= <span class="keyword">true</span>;
00216                         <span class="keywordflow">if</span>(!surface.Cells[v10].InSurface &amp;&amp; !surface.Cells[v10].Dilated)        skip= <span class="keyword">true</span>;
00217                         <span class="keywordflow">if</span>(!surface.Cells[v01].InSurface &amp;&amp; !surface.Cells[v01].Dilated)        skip= <span class="keyword">true</span>;
00218                         <span class="keywordflow">if</span>(!surface.Cells[v11].InSurface &amp;&amp; !surface.Cells[v11].Dilated)        skip= <span class="keyword">true</span>;
00219 
00220 
00221                         <span class="keywordflow">if</span>(!skip)
00222                         {
00223                                 <span class="comment">// 1st triangle.</span>
00224                                 CMesh::CFace    face0;
00225                                 face0.MaterialId= 0;
00226                                 face0.Corner[0].Vertex= vId0+ v00;
00227                                 face0.Corner[0].Color= colors[v00];
00228                                 face0.Corner[1].Vertex= vId0+ v10;
00229                                 face0.Corner[1].Color= colors[v10];
00230                                 face0.Corner[2].Vertex= vId0+ v01;
00231                                 face0.Corner[2].Color= colors[v01];
00232 
00233                                 <span class="comment">// 2nd triangle.</span>
00234                                 CMesh::CFace    face1;
00235                                 face1.MaterialId= 0;
00236                                 face1.Corner[0].Vertex= vId0+ v10;
00237                                 face1.Corner[0].Color= colors[v10];
00238                                 face1.Corner[1].Vertex= vId0+ v11;
00239                                 face1.Corner[1].Color= colors[v11];
00240                                 face1.Corner[2].Vertex= vId0+ v01;
00241                                 face1.Corner[2].Color= colors[v01];
00242 
00243                                 <span class="comment">// Add 2 triangles</span>
00244                                 meshBuild.Faces.push_back(face0);
00245                                 meshBuild.Faces.push_back(face1);
00246                         }
00247                 }
00248         }
00249 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CIGSurfaceLightBuilda0" doxytag="NL3D::CIGSurfaceLightBuild::buildPLDebugMesh" ></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::CIGSurfaceLightBuild::buildPLDebugMesh </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02864.html">CMesh::CMeshBuild</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>meshBuild</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a02872.html">CMeshBase::CMeshBaseBuild</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>meshBaseBuild</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>deltaPos</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> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>igOut</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Debug: build a colored Grid mesh of PointLight. R= pointLight1 id. G= PointLight2 id. B= The multiplier used to show Ids. 
<p>

<p>
Definition at line <a class="el" href="a05808.html#l00100">100</a> of file <a class="el" href="a05808.html">ig_surface_light_build.cpp</a>.
<p>
References <a class="el" href="a05808.html#l00191">addDebugMeshFaces()</a>, <a class="el" href="a06476.html#l00101">NL3D::CSurfaceLightGrid::Cells</a>, <a class="el" href="a05809.html#l00093">NL3D::CIGSurfaceLightBuild::CSurface::Cells</a>, <a class="el" href="a06340.html#l00336">NLMISC::CRGBA::G</a>, <a class="el" href="a06351.html#l00361">NL3D::CInstanceGroup::getIGSurfaceLight()</a>, <a class="el" href="a06351.html#l00338">NL3D::CInstanceGroup::getPointLightList()</a>, <a class="el" href="a05807.html#l00102">NL3D::CIGSurfaceLight::getRetrieverGridMap()</a>, <a class="el" href="a05809.html#l00091">NL3D::CIGSurfaceLightBuild::CSurface::Height</a>, <a class="el" href="a05992.html#l00128">NL3D::CMeshBase::CMeshBaseBuild::Materials</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a06340.html#l00334">NLMISC::CRGBA::R</a>, <a class="el" href="a05586.html#l00349">NLMISC::raiseToNextPowerOf2()</a>, <a class="el" href="a05809.html#l00112">RetrieverGridMap</a>, <a class="el" href="a06339.html#l00066">NLMISC::CRGBA::set()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05646.html#l00237">v</a>, <a class="el" href="a05990.html#l00179">NL3D::CMesh::CMeshBuild::VertexFlags</a>, <a class="el" href="a05990.html#l00184">NL3D::CMesh::CMeshBuild::Vertices</a>, <a class="el" href="a05809.html#l00090">NL3D::CIGSurfaceLightBuild::CSurface::Width</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>.
<p>
<div class="fragment"><pre>00101 {
00102         <a class="code" href="a05378.html#a381">contReset</a>(meshBuild);
00103         <a class="code" href="a05378.html#a381">contReset</a>(meshBaseBuild);
00104         meshBaseBuild.Materials.resize(1);
00105         meshBaseBuild.Materials[0].initUnlit();
00106 
00107         meshBuild.VertexFlags= CVertexBuffer::PositionFlag | CVertexBuffer::PrimaryColorFlag;
00108 
00109         <span class="comment">// Get the number of lights in Ig.</span>
00110         <a class="code" href="a04558.html#a15">uint</a>    numLight= igOut.getPointLightList().size();
00111         numLight= <a class="code" href="a05378.html#a262">raiseToNextPowerOf2</a>(numLight);
00112         <a class="code" href="a04558.html#a15">uint</a>    idMultiplier= 256/ numLight;
00113 
00114         <span class="comment">// For all grids.</span>
00115         <a class="code" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw1">ItRetrieverGridMap</a>      it;
00116         <span class="keywordflow">for</span>(it= <a class="code" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildo1">RetrieverGridMap</a>.begin(); it!= <a class="code" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildo1">RetrieverGridMap</a>.end(); it++)
00117         {
00118                 <span class="comment">// get the final surface</span>
00119                 CIGSurfaceLight::TRetrieverGridMap::const_iterator      itIg= 
00120                         igOut.getIGSurfaceLight().getRetrieverGridMap().find(it-&gt;first);
00121 
00122                 <span class="comment">// If not found, abort</span>
00123                 <span class="keywordflow">if</span>( itIg== igOut.getIGSurfaceLight().getRetrieverGridMap().end() )
00124                 {
00125                         <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"buildPLDebugMesh fails to find retriever '%d' in igOut"</span>, it-&gt;first);
00126                         <span class="keywordflow">continue</span>;
00127                 }
00128                 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( it-&gt;second.Grids.size()!=itIg-&gt;second.Grids.size() )
00129                 {
00130                         <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"buildPLDebugMesh find retriever '%d' in igOut, but with bad size: excepting: %d, get: %d"</span>, 
00131                                 it-&gt;first, it-&gt;second.Grids.size(), itIg-&gt;second.Grids.size() );
00132                         <span class="keywordflow">continue</span>;
00133                 }
00134 
00135                 <span class="comment">// For all surface of the retriever.</span>
00136                 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> iSurf= 0; iSurf&lt;it-&gt;second.Grids.size(); iSurf++)
00137                 {
00138                         CSurface                                        &amp;surface= it-&gt;second.Grids[iSurf];
00139                         <span class="keyword">const</span> CSurfaceLightGrid         &amp;igSurface= itIg-&gt;second.Grids[iSurf];
00140 
00141                         <span class="comment">// Resize vector.</span>
00142                         <a class="code" href="a04558.html#a15">uint</a>    wVert= surface.Width;
00143                         <a class="code" href="a04558.html#a15">uint</a>    hVert= surface.Height;
00144                         <a class="code" href="a04558.html#a15">uint</a>    vId0= meshBuild.Vertices.size();
00145                         <span class="comment">// Allocate vertices / colors</span>
00146                         meshBuild.Vertices.resize(vId0 + wVert*hVert);
00147                         vector&lt;CRGBA&gt;   colors;
00148                         colors.resize(wVert*hVert);
00149 
00150                         <span class="comment">// Build vertices pos and colors.</span>
00151                         <a class="code" href="a04558.html#a15">uint</a>    <a class="code" href="a04223.html#a572">x</a>, <a class="code" href="a04223.html#a573">y</a>;
00152                         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0;<a class="code" href="a04223.html#a573">y</a>&lt;hVert; <a class="code" href="a04223.html#a573">y</a>++)
00153                         {
00154                                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0;<a class="code" href="a04223.html#a572">x</a>&lt;wVert; <a class="code" href="a04223.html#a572">x</a>++)
00155                                 {
00156                                         <a class="code" href="a04558.html#a15">uint</a>    vId= <a class="code" href="a04223.html#a573">y</a>*wVert + <a class="code" href="a04223.html#a572">x</a>;
00157                                         <span class="comment">// Copy Pos.</span>
00158                                         meshBuild.Vertices[vId0 + vId]= surface.Cells[vId].CenterPos + deltaPos;
00159                                         <span class="comment">// init Color with idMultiplier in Blue (info!).</span>
00160                                         <a class="code" href="a03337.html">CRGBA</a>   &amp;col= colors[vId];
00161                                         col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAa14">set</a>(0,0, idMultiplier, 255);
00162                                         <span class="comment">// store the compressed id of the light found in igOut.</span>
00163                                         <a class="code" href="a04199.html#a6">nlassert</a>( CSurfaceLightGrid::NumLightPerCorner&gt;=2 );
00164                                         <a class="code" href="a04558.html#a15">uint</a>    idLight0= igSurface.Cells[vId].Light[0];
00165                                         <a class="code" href="a04558.html#a15">uint</a>    idLight1= igSurface.Cells[vId].Light[1];
00166                                         <span class="comment">// 255 means no light. If at least one light</span>
00167                                         <span class="keywordflow">if</span>(idLight0&lt;255)
00168                                         {
00169                                                 <a class="code" href="a04558.html#a15">uint</a>    <a class="code" href="a04223.html#a576">v</a>= (idLight0+1)*idMultiplier;
00170                                                 col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>= <a class="code" href="a04061.html#a0">min</a>(v, 255U);
00171                                                 <span class="comment">// if second light</span>
00172                                                 <span class="keywordflow">if</span>(idLight1&lt;255)
00173                                                 {
00174                                                         <a class="code" href="a04223.html#a576">v</a>= (idLight1+1)*idMultiplier;
00175                                                         col.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>= <a class="code" href="a04061.html#a0">min</a>(v, 255U);
00176                                                 }
00177                                         }
00178                                 }
00179                         }
00180 
00181                         <span class="comment">// Build faces</span>
00182                         <a class="code" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildd0">addDebugMeshFaces</a>(meshBuild, surface, vId0, colors);
00183 
00184                 }
00185         }
00186 
00187 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CIGSurfaceLightBuilda1" doxytag="NL3D::CIGSurfaceLightBuild::buildSunDebugMesh" ></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::CIGSurfaceLightBuild::buildSunDebugMesh </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02864.html">CMesh::CMeshBuild</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>meshBuild</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a02872.html">CMeshBase::CMeshBaseBuild</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>meshBaseBuild</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>deltaPos</em> = <a class="el" href="a03128.html#NLMISC_1_1CVectors3">CVector::Null</a></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Debug: build a colored Grid mesh of SunContribution. 
<p>

<p>
Definition at line <a class="el" href="a05808.html#l00040">40</a> of file <a class="el" href="a05808.html">ig_surface_light_build.cpp</a>.
<p>
References <a class="el" href="a05808.html#l00191">addDebugMeshFaces()</a>, <a class="el" href="a05809.html#l00093">NL3D::CIGSurfaceLightBuild::CSurface::Cells</a>, <a class="el" href="a05809.html#l00091">NL3D::CIGSurfaceLightBuild::CSurface::Height</a>, <a class="el" href="a05992.html#l00128">NL3D::CMeshBase::CMeshBaseBuild::Materials</a>, <a class="el" href="a05809.html#l00112">RetrieverGridMap</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05990.html#l00179">NL3D::CMesh::CMeshBuild::VertexFlags</a>, <a class="el" href="a05990.html#l00184">NL3D::CMesh::CMeshBuild::Vertices</a>, <a class="el" href="a05809.html#l00090">NL3D::CIGSurfaceLightBuild::CSurface::Width</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>.
<p>
<div class="fragment"><pre>00042 {
00043         <a class="code" href="a05378.html#a381">contReset</a>(meshBuild);
00044         <a class="code" href="a05378.html#a381">contReset</a>(meshBaseBuild);
00045         meshBaseBuild.Materials.resize(1);
00046         meshBaseBuild.Materials[0].initUnlit();
00047         meshBaseBuild.Materials[0].setBlend(<span class="keyword">true</span>);
00048         meshBaseBuild.Materials[0].setBlendFunc(CMaterial::srcalpha, CMaterial::invsrcalpha);
00049 
00050         meshBuild.VertexFlags= CVertexBuffer::PositionFlag | CVertexBuffer::PrimaryColorFlag;
00051 
00052         <span class="comment">// For all grids.</span>
00053         <a class="code" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw1">ItRetrieverGridMap</a>      it;
00054         <span class="keywordflow">for</span>(it= <a class="code" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildo1">RetrieverGridMap</a>.begin(); it!= <a class="code" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildo1">RetrieverGridMap</a>.end(); it++)
00055         {
00056                 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> iSurf= 0; iSurf&lt;it-&gt;second.Grids.size(); iSurf++)
00057                 {
00058                         CSurface        &amp;surface= it-&gt;second.Grids[iSurf];
00059 
00060                         <span class="comment">// Resize vector.</span>
00061                         <a class="code" href="a04558.html#a15">uint</a>    wVert= surface.Width;
00062                         <a class="code" href="a04558.html#a15">uint</a>    hVert= surface.Height;
00063                         <a class="code" href="a04558.html#a15">uint</a>    vId0= meshBuild.Vertices.size();
00064                         <span class="comment">// Allocate vertices / colors</span>
00065                         meshBuild.Vertices.resize(vId0 + wVert*hVert);
00066                         vector&lt;CRGBA&gt;   colors;
00067                         colors.resize(wVert*hVert);
00068 
00069                         <span class="comment">// Build vertices pos and colors.</span>
00070                         <a class="code" href="a04558.html#a15">uint</a>    <a class="code" href="a04223.html#a572">x</a>, <a class="code" href="a04223.html#a573">y</a>;
00071                         <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0;<a class="code" href="a04223.html#a573">y</a>&lt;hVert; <a class="code" href="a04223.html#a573">y</a>++)
00072                         {
00073                                 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0;<a class="code" href="a04223.html#a572">x</a>&lt;wVert; <a class="code" href="a04223.html#a572">x</a>++)
00074                                 {
00075                                         <a class="code" href="a04558.html#a15">uint</a>    vId= <a class="code" href="a04223.html#a573">y</a>*wVert + <a class="code" href="a04223.html#a572">x</a>;
00076                                         <span class="comment">// Copy Pos.</span>
00077                                         meshBuild.Vertices[vId0 + vId]= surface.Cells[vId].CenterPos + deltaPos;
00078                                         <span class="comment">// Copy Color.</span>
00079                                         <a class="code" href="a04558.html#a7">uint8</a>   col= surface.Cells[vId].SunContribution;
00080                                         colors[vId].set(col, col, col, 128);
00081                                         <span class="comment">// Force Blue color, to simulate ambiant.</span>
00082                                         colors[vId].B= 128 + colors[vId].B/2;
00083                                         <span class="comment">// OutSurface =&gt; green is 128.</span>
00084                                         <span class="keywordflow">if</span>(!surface.Cells[vId].InSurface)
00085                                                 colors[vId].G= 128;
00086 
00087                                 }
00088                         }
00089 
00090                         <span class="comment">// Build faces</span>
00091                         <a class="code" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildd0">addDebugMeshFaces</a>(meshBuild, surface, vId0, colors);
00092 
00093                 }
00094         }
00095 
00096 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CIGSurfaceLightBuildo0" doxytag="NL3D::CIGSurfaceLightBuild::CellSize" ></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="a02656.html#NL3D_1_1CIGSurfaceLightBuildo0">NL3D::CIGSurfaceLightBuild::CellSize</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05809.html#l00110">110</a> of file <a class="el" href="a05809.html">ig_surface_light_build.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00305">NL3D::CInstanceLighter::light()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CIGSurfaceLightBuildo1" doxytag="NL3D::CIGSurfaceLightBuild::RetrieverGridMap" ></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_1CIGSurfaceLightBuildw3">TRetrieverGridMap</a> <a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildo1">NL3D::CIGSurfaceLightBuild::RetrieverGridMap</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05809.html#l00112">112</a> of file <a class="el" href="a05809.html">ig_surface_light_build.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">NL3D::CInstanceLighter::beginCell()</a>, <a class="el" href="a05808.html#l00100">buildPLDebugMesh()</a>, <a class="el" href="a05808.html#l00040">buildSunDebugMesh()</a>, <a class="el" href="a05824.html#l00305">NL3D::CInstanceLighter::light()</a>, and <a class="el" href="a05824.html#l01663">NL3D::CInstanceLighter::nextCell()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a05809.html">ig_surface_light_build.h</a><li><a class="el" href="a05808.html">ig_surface_light_build.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:47:13 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>