aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a02747.html
blob: b4f5882e3324404388a6f26e08e3c72a09b92db9 (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
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: NL3D::CLightingManager class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NL3D::CLightingManager Class Reference</h1><code>#include &lt;<a class="el" href="a05902.html">lighting_manager.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Owned by CLightingTrav. This class compute modelContributions. It gets which dynamic light may influence a model, ask to <a class="el" href="a03863.html">ILogicInfo</a> the contribution of staticLights then decides which light are best suitable to influence the model.<p>
<dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl>

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00060">60</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagera0">CLightingManager</a> (bool bSmallScene)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor (bSmallScene is used to setup size of the grids).  <a href="#NL3D_1_1CLightingManagera0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagera1">computeModelLightContributions</a> (<a class="el" href="a02316.html">CTransform</a> *model, <a class="el" href="a02744.html">CLightContribution</a> &amp;lightContrib, <a class="el" href="a03863.html">ILogicInfo</a> *logicInfo=NULL)</td></tr>

<tr><td colspan="2"><div class="groupHeader">Dynamic Lights localisation.</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz334_0">addDynamicLight</a> (<a class="el" href="a03091.html">CPointLight</a> *light)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz334_1">clearDynamicLights</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">clear for the pass all the lights.  <a href="#NL3D_1_1CLightingManagerz334_1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const std::vector&lt; <a class="el" href="a03091.html">CPointLight</a> * &gt; &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz334_2">getAllDynamicLightList</a> () const </td></tr>

<tr><td colspan="2"><div class="groupHeader">Static Lighted Objects Localisation. Used for lights to touch nearest static models.</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02749.html">CQGItLightedModel</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz336_0">eraseStaticLightedModel</a> (<a class="el" href="a02749.html">CQGItLightedModel</a> ite)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02749.html">CQGItLightedModel</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz336_1">insertStaticLightedModel</a> (<a class="el" href="a02316.html">CTransform</a> *model)</td></tr>

<tr><td colspan="2"><div class="groupHeader">Parameters</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_0">getLightTransitionThreshold</a> () const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_1">getMaxLightContribution</a> () const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_2">getNoAttLightRadius</a> () const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_3">getOutOfAttLightInfFactor</a> () const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_4">setLightTransitionThreshold</a> (float lightTransitionThreshold)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_5">setMaxLightContribution</a> (<a class="el" href="a04558.html#a15">uint</a> nlights)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_6">setNoAttLightRadius</a> (float noAttLightRadius)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz332_7">setOutOfAttLightInfFactor</a> (float outOfAttLightInfFactor)</td></tr>

<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerd0">getDynamicPointLightList</a> (const <a class="el" href="a03128.html">CVector</a> &amp;worldPos, std::vector&lt; <a class="el" href="a03092.html">CPointLightInfluence</a> &gt; &amp;lightList)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">get the list of dynamic light viewed from a position. append to lightList  <a href="#NL3D_1_1CLightingManagerd0"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a03091.html">CPointLight</a> * &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerr0">_DynamicLightList</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03273.html">CQuadGrid</a>&lt; <a class="el" href="a02748.html">CPointLightInfo</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a> [4]</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerr2">_LightQuadGridRadiusLimit</a> [4]</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03273.html">CQuadGrid</a>&lt; <a class="el" href="a02316.html">CTransform</a> * &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a> [4]</td></tr>

<tr><td colspan="2"><div class="groupHeader">Parameters.</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a></td></tr>

</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CLightingManagera0" doxytag="NL3D::CLightingManager::CLightingManager" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> NL3D::CLightingManager::CLightingManager </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">bool&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>bSmallScene</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
Constructor (bSmallScene is used to setup size of the grids). 
<p>

<p>
Definition at line <a class="el" href="a05901.html#l00064">64</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00177">_LightQuadGrid</a>, <a class="el" href="a05902.html#l00179">_LightQuadGridRadiusLimit</a>, <a class="el" href="a05902.html#l00188">_LightTransitionThreshold</a>, <a class="el" href="a05902.html#l00186">_NoAttLightRadius</a>, <a class="el" href="a05902.html#l00187">_OutOfAttLightInfFactor</a>, <a class="el" href="a05902.html#l00176">_StaticLightedModelQuadGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz772_1">NL3D::CQuadGrid&lt; CTransform * &gt;::create()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz772_1">NL3D::CQuadGrid&lt; CPointLightInfo &gt;::create()</a>, <a class="el" href="a05901.html#l00060">NL3D_DEFAULT_LIGHT_TRANSITION_THRESHOLD</a>, <a class="el" href="a05901.html#l00056">NL3D_DEFAULT_NOATT_LIGHT_RADIUS</a>, <a class="el" href="a05901.html#l00058">NL3D_DEFAULT_OUT_OF_ATT_LIGHT_INF_FACTOR</a>, <a class="el" href="a05901.html#l00049">NL3D_LIGHT_QUAD_GRID_ELTSIZE</a>, <a class="el" href="a05901.html#l00052">NL3D_LIGHT_QUAD_GRID_FACTOR</a>, <a class="el" href="a05901.html#l00050">NL3D_LIGHT_QUAD_GRID_RADIUS_LIMIT</a>, <a class="el" href="a05901.html#l00048">NL3D_LIGHT_QUAD_GRID_SIZE</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a05901.html#l00105">setMaxLightContribution()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00065 {
00066         <span class="comment">// Init the lightQuadGrids and StaticLightedModelQuadGrid</span>
00067         <span class="comment">// finer level.</span>
00068         <a class="code" href="a04558.html#a15">uint</a>    qgSize= <a class="code" href="a04478.html#a0">NL3D_LIGHT_QUAD_GRID_SIZE</a>;
00069         <span class="keywordtype">float</span>   eltSize= <a class="code" href="a04478.html#a1">NL3D_LIGHT_QUAD_GRID_ELTSIZE</a>;
00070         <span class="keywordtype">float</span>   radiusLimit= <a class="code" href="a04478.html#a2">NL3D_LIGHT_QUAD_GRID_RADIUS_LIMIT</a>;
00071 
00072         <span class="keywordflow">if</span> (bSmallScene)
00073         {
00074                 qgSize = 4;
00075         }
00076 
00077         <span class="comment">// for all levels</span>
00078         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>;i++)
00079         {
00080                 <span class="comment">// init _LightQuadGrid and _StaticLightedModelQuadGrid</span>
00081                 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a>[i].create(qgSize, eltSize);
00082                 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[i].create(qgSize, eltSize);
00083                 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr2">_LightQuadGridRadiusLimit</a>[i]= radiusLimit;
00084 
00085                 <span class="comment">// coarser quadGrid level</span>
00086                 qgSize/= <a class="code" href="a04478.html#a3">NL3D_LIGHT_QUAD_GRID_FACTOR</a>;
00087                 qgSize= max(qgSize, 1U);
00088                 eltSize*= <a class="code" href="a04478.html#a3">NL3D_LIGHT_QUAD_GRID_FACTOR</a>;
00089                 radiusLimit*= <a class="code" href="a04478.html#a3">NL3D_LIGHT_QUAD_GRID_FACTOR</a>;
00090         }
00091 
00092 
00093         <span class="comment">// default paramters</span>
00094         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a>= <a class="code" href="a04478.html#a4">NL3D_DEFAULT_NOATT_LIGHT_RADIUS</a>;
00095         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a>= <a class="code" href="a04478.html#a5">NL3D_DEFAULT_OUT_OF_ATT_LIGHT_INF_FACTOR</a>;
00096         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a>= <a class="code" href="a04478.html#a6">NL3D_DEFAULT_LIGHT_TRANSITION_THRESHOLD</a>;
00097 
00098 
00099         <span class="comment">// Default number of pointLight on an object.</span>
00100         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz332_5">setMaxLightContribution</a>(3);
00101 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CLightingManagerz334_0" doxytag="NL3D::CLightingManager::addDynamicLight" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CLightingManager::addDynamicLight </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a03091.html">CPointLight</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>light</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
temp add a dynamic light to the manager. light is added to the _LightQuadGrid. This method calls <a class="el" href="a02316.html#NL3D_1_1CWaveMakerModelz1024_5">CTransform::resetLighting()</a> for all models around the light.<p>
Additionaly light are added to a list (a vector of pointer), see getDynamicLightList()
<p>
Definition at line <a class="el" href="a05901.html#l00151">151</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00177">_LightQuadGrid</a>, <a class="el" href="a05902.html#l00179">_LightQuadGridRadiusLimit</a>, <a class="el" href="a05902.html#l00186">_NoAttLightRadius</a>, <a class="el" href="a05902.html#l00176">_StaticLightedModelQuadGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_0">NL3D::CQuadGrid&lt; CTransform * &gt;::begin()</a>, <a class="el" href="a05505.html#l00048">NLMISC::CBSphere::Center</a>, <a class="el" href="a06300.html#l00646">NL3D::CQuadGrid&lt; T &gt;::end()</a>, <a class="el" href="a06180.html#l00143">NL3D::CPointLight::getAttenuationEnd()</a>, <a class="el" href="a05973.html#l00198">NLMISC::CMatrix::getPos()</a>, <a class="el" href="a06180.html#l00116">NL3D::CPointLight::getPosition()</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a05504.html#l00063">NLMISC::CBSphere::include()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_2">NL3D::CQuadGrid&lt; CPointLightInfo &gt;::insert()</a>, <a class="el" href="a05902.html#l00169">NL3D::CLightingManager::CPointLightInfo::Light</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a05505.html#l00049">NLMISC::CBSphere::Radius</a>, <a class="el" href="a06568.html#l00988">NL3D::CTransform::resetLighting()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_3">NL3D::CQuadGrid&lt; CTransform * &gt;::select()</a>, <a class="el" href="a05902.html#l00170">NL3D::CLightingManager::CPointLightInfo::Sphere</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06182.html#l00084">NL3D::CPointLightModel::traverseLight()</a>.
<p>
<div class="fragment"><pre>00152 {
00153 
00154         <span class="comment">// Insert the light in the quadGrid.</span>
00155         <span class="comment">//----------</span>
00156         CPointLightInfo         plInfo;
00157         plInfo.Light= light;
00158 
00159         <span class="comment">// build the bounding sphere for this light, with the AttenuationEnd of the light</span>
00160         <span class="keywordtype">float</span>   radius=light-&gt;getAttenuationEnd();
00161         <span class="comment">// if attenuation is disabled (ie getAttenuationEnd() return 0), then have a dummy radius</span>
00162         <span class="keywordflow">if</span>(radius==0)
00163                 radius= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a>;
00164         plInfo.Sphere.Center= light-&gt;getPosition();
00165         plInfo.Sphere.Radius= radius;
00166 
00167         <span class="comment">// build a bbox, so it includes the sphere</span>
00168         CVector bbmin= light-&gt;getPosition();
00169         bbmin-= CVector(radius, radius, radius);
00170         CVector bbmax= light-&gt;getPosition();
00171         bbmax+= CVector(radius, radius, radius);
00172 
00173         <span class="comment">// choose the correct quadgrid according to the radius of the light.</span>
00174         <a class="code" href="a04558.html#a15">uint</a> qgId;
00175         <span class="keywordflow">for</span>(qgId= 0; qgId&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>-1; qgId++)
00176         {
00177                 <span class="comment">// if radius is inferior to the requested radius for this quadGrid, ok!</span>
00178                 <span class="keywordflow">if</span>(radius&lt;<a class="code" href="a02747.html#NL3D_1_1CLightingManagerr2">_LightQuadGridRadiusLimit</a>[qgId])
00179                         <span class="keywordflow">break</span>;
00180         }
00181         <span class="comment">// insert this light in the correct quadgrid.</span>
00182         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a>[qgId].insert(bbmin, bbmax, plInfo);
00183 
00184 
00185         <span class="comment">// touch the objects around the lights.</span>
00186         <span class="comment">//----------</span>
00187 
00188         <span class="comment">// Select the static lightedModels to update around this light.</span>
00189         <span class="comment">// Use the same level of _StaticLightedModelQuadGrid than me to not select too many squares in the quadGrid</span>
00190         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[qgId].select(bbmin, bbmax);
00191         <span class="comment">// For all those models.</span>
00192         CQuadGrid&lt;CTransform*&gt;::CIterator       itModel= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[qgId].begin();
00193         <span class="keywordflow">while</span>(itModel != _StaticLightedModelQuadGrid[qgId].end() )
00194         {
00195                 CTransform      *model= *itModel;
00196                 <span class="keyword">const</span> CVector &amp;modelPos= model-&gt;getWorldMatrix().getPos();
00197 
00198                 <span class="comment">// test first if this model is in the area of the light.</span>
00199                 <span class="keywordflow">if</span>( plInfo.Sphere.include(modelPos) )
00200                 {
00201                         <span class="comment">// yes, then this model must recompute his lighting, because a dynamic light touch him.</span>
00202                         model-&gt;resetLighting();
00203                 }
00204 
00205                 <span class="comment">// next.</span>
00206                 itModel++;
00207         }
00208 
00209 
00210         <span class="comment">// insert the light in the list.</span>
00211         <span class="comment">//----------</span>
00212         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr0">_DynamicLightList</a>.push_back(light);
00213 
00214 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz334_1" doxytag="NL3D::CLightingManager::clearDynamicLights" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CLightingManager::clearDynamicLights </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
clear for the pass all the lights. 
<p>

<p>
Definition at line <a class="el" href="a05901.html#l00137">137</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00177">_LightQuadGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_0">NL3D::CQuadGrid&lt; CPointLightInfo &gt;::clear()</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05897.html#l00068">NL3D::CLightTrav::traverse()</a>.
<p>
<div class="fragment"><pre>00138 {
00139         <span class="comment">// for all levels</span>
00140         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>;i++)
00141         {
00142                 <span class="comment">// clear all the lights in the quadGrid.</span>
00143                 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a>[i].clear();
00144         }
00145 
00146         <span class="comment">// clear the list.</span>
00147         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr0">_DynamicLightList</a>.clear();
00148 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagera1" doxytag="NL3D::CLightingManager::computeModelLightContributions" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CLightingManager::computeModelLightContributions </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02316.html">CTransform</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>model</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a02744.html">CLightContribution</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>lightContrib</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03863.html">ILogicInfo</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>logicInfo</em> = NULL</td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

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

<p>
get the description of nearsest lights viewed for this model. Dynamic lights are parsed to get list of lights, and ILogicInfo-&gt;getStaticLightDesc() is parsed too. Then, maxLights are returned, which may be a blended result of max influence light.<p>
NB: model-&gt;_LightContribution is filled with real contributions of lights. NB: model is append to the _LightedModelList of each contributed light NB: this list is valid until model-&gt;isNeedUpdateLighting() is true.
<p>
Definition at line <a class="el" href="a05901.html#l00256">256</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00188">_LightTransitionThreshold</a>, <a class="el" href="a05902.html#l00185">_MaxLightContribution</a>, <a class="el" href="a05902.html#l00187">_OutOfAttLightInfFactor</a>, <a class="el" href="a06179.html#l00409">NL3D::CPointLight::appendLightedModel()</a>, <a class="el" href="a05894.html#l00073">NL3D::CLightContribution::AttFactor</a>, <a class="el" href="a06340.html#l00338">NLMISC::CRGBA::B</a>, <a class="el" href="a06340.html#l00659">NLMISC::CRGBAF::B</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a06179.html#l00267">NL3D::CPointLight::computeLinearAttenuation()</a>, <a class="el" href="a05894.html#l00071">NL3D::CLightContribution::Factor</a>, <a class="el" href="a05894.html#l00079">NL3D::CLightContribution::FrozenStaticLightSetup</a>, <a class="el" href="a06340.html#l00336">NLMISC::CRGBA::G</a>, <a class="el" href="a06340.html#l00657">NLMISC::CRGBAF::G</a>, <a class="el" href="a06180.html#l00129">NL3D::CPointLight::getAmbient()</a>, <a class="el" href="a06180.html#l00141">NL3D::CPointLight::getAttenuationBegin()</a>, <a class="el" href="a06180.html#l00143">NL3D::CPointLight::getAttenuationEnd()</a>, <a class="el" href="a06180.html#l00131">NL3D::CPointLight::getDiffuse()</a>, <a class="el" href="a05901.html#l00525">getDynamicPointLightList()</a>, <a class="el" href="a06569.html#l00381">NL3D::CTransform::getLightHotSpotInWorld()</a>, <a class="el" href="a06180.html#l00116">NL3D::CPointLight::getPosition()</a>, <a class="el" href="a03863.html#NL3D_1_1ILogicInfoa0">NL3D::ILogicInfo::getStaticLightSetup()</a>, <a class="el" href="a06179.html#l00138">NL3D::CPointLight::getType()</a>, <a class="el" href="a05894.html#l00075">NL3D::CLightContribution::LocalAmbient</a>, <a class="el" href="a05894.html#l00096">NL3D::CLightContribution::MergedPointLight</a>, <a class="el" href="a05894.html#l00042">NL3D_MAX_LIGHT_CONTRIBUTION</a>, <a class="el" href="a05894.html#l00084">NL3D::CLightContribution::NumFrozenStaticLight</a>, <a class="el" href="a05701.html#l00125">NLMISC::OptFastFloor()</a>, <a class="el" href="a05894.html#l00067">NL3D::CLightContribution::PointLight</a>, <a class="el" href="a06340.html#l00334">NLMISC::CRGBA::R</a>, <a class="el" href="a06340.html#l00655">NLMISC::CRGBAF::R</a>, <a class="el" href="a06339.html#l00066">NLMISC::CRGBA::set()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05894.html#l00086">NL3D::CLightContribution::SunContribution</a>, <a class="el" href="a05894.html#l00069">NL3D::CLightContribution::TransformIterator</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05894.html#l00088">NL3D::CLightContribution::UseMergedPointLight</a>, and <a class="el" href="a05646.html#l00237">v</a>.
<p>
Referenced by <a class="el" href="a06568.html#l01080">NL3D::CTransform::traverseLight()</a>.
<p>
<div class="fragment"><pre>00258 {
00259         <a class="code" href="a04558.html#a14">sint</a>    i;
00260 
00261         <span class="comment">// This is the list of light which touch this model.</span>
00262         <span class="keyword">static</span> std::vector&lt;CPointLightInfluence&gt;        lightList;
00263         <span class="comment">// static, for malloc perf.</span>
00264         lightList.clear();
00265 
00266         <span class="comment">// the position of the model.</span>
00267         CVector modelPos;
00268         <span class="keywordtype">float</span>   modelRadius;
00269 
00270         <span class="comment">// depends on model</span>
00271         model-&gt;getLightHotSpotInWorld(modelPos, modelRadius);
00272 
00273         <span class="comment">// First pass, fill the list of light which touch this model.</span>
00274         <span class="comment">//=========</span>
00275         <span class="comment">// get the dynamic lights around the model</span>
00276         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerd0">getDynamicPointLightList</a>(modelPos, lightList);
00277 
00278         <span class="comment">// if not already precomputed, append staticLights to this list.</span>
00279         <span class="keywordflow">if</span>( !lightContrib.FrozenStaticLightSetup )
00280         {
00281                 <span class="comment">// If no logicInfo provided</span>
00282                 <span class="keywordflow">if</span>(!logicInfo)
00283                 {
00284                         <span class="comment">// Default: suppose full SunLight and no PointLights.</span>
00285                         lightContrib.SunContribution= 255;
00286                         <span class="comment">// Take full SunAmbient.</span>
00287                         lightContrib.LocalAmbient.set(0,0,0,0);
00288                         <span class="comment">// do not append any pointLight to the setup</span>
00289                 }
00290                 <span class="keywordflow">else</span>
00291                 {
00292                         <span class="comment">// NB: SunContribution is computed by logicInfo</span>
00293                         logicInfo-&gt;getStaticLightSetup(lightList, lightContrib.SunContribution, lightContrib.LocalAmbient);
00294                 }
00295         }
00296 
00297         <span class="comment">// Second pass, in the lightList, choose the best suited light to lit this model</span>
00298         <span class="comment">//=========</span>
00299 
00300         <span class="comment">// for each light, modulate the factor of influence</span>
00301         <span class="keywordflow">for</span>(i=0; i&lt;(<a class="code" href="a04558.html#a14">sint</a>)lightList.size();i++)
00302         {
00303                 CPointLight     *pl= lightList[i].PointLight;
00304 
00305                 <span class="comment">// get the distance from the light to the model</span>
00306                 <span class="keywordtype">float</span>   dist= (pl-&gt;getPosition() - modelPos).norm();
00307                 <span class="keywordtype">float</span>   distMinusRadius= dist - modelRadius;
00308 
00309                 <span class="comment">// modulate the factor by the distance and the attenuation distance.</span>
00310                 <span class="keywordtype">float</span>    inf;
00311                 <span class="keywordtype">float</span>   attBegin= pl-&gt;getAttenuationBegin();
00312                 <span class="keywordtype">float</span>   attEnd= pl-&gt;getAttenuationEnd();
00313                 <span class="comment">// if no attenuation</span>
00314                 <span class="keywordflow">if</span>( attEnd==0 )
00315                 {
00316                         <span class="comment">// influence is awlays 1.</span>
00317                         inf= 1;
00318 
00319                         <span class="comment">// If SpotLight, must modulate with SpotAttenuation.</span>
00320                         <span class="keywordflow">if</span>(pl-&gt;getType() == CPointLight::SpotLight)
00321                                 inf*= pl-&gt;computeLinearAttenuation(modelPos, dist, modelRadius);
00322                 }
00323                 <span class="keywordflow">else</span>
00324                 {
00325                         <span class="comment">// if correct attenuation radius</span>
00326                         <span class="keywordflow">if</span>(distMinusRadius&lt;attBegin)
00327                         {
00328                                 <span class="comment">// NB: we are sure that attBegin&gt;0, because dist&gt;=0.</span>
00329                                 <span class="comment">// if &lt; attBegin, inf should be ==1, but must select the nearest lights; for better</span>
00330                                 <span class="comment">// understanding of the scene</span>
00331                                 inf= 1 + <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a> * (attBegin - distMinusRadius);        <span class="comment">// inf E [1, +oo[</span>
00332                                 <span class="comment">// NB: this formula favour big lights (ie light with big attBegin).</span>
00333 
00334                                 <span class="comment">// If SpotLight, must modulate with SpotAttenuation.</span>
00335                                 <span class="keywordflow">if</span>(pl-&gt;getType() == CPointLight::SpotLight)
00336                                         inf*= pl-&gt;computeLinearAttenuation(modelPos, dist, modelRadius);
00337                         }
00338                         <span class="keywordflow">else</span> <span class="keywordflow">if</span>(distMinusRadius&lt;attEnd)
00339                         {
00340                                 <span class="comment">// we are sure attEnd-attBegin&gt;0 because of the test</span>
00341                                 <span class="comment">// compute influence of the light: attenuation and SpotAttenuation</span>
00342                                 inf= pl-&gt;computeLinearAttenuation(modelPos, dist, modelRadius);
00343                         }
00344                         <span class="keywordflow">else</span>
00345                         {
00346                                 <span class="comment">// if &gt;= attEnd, inf should be ==0, but must select the nearest lights; for better</span>
00347                                 <span class="comment">// understanding of the scene</span>
00348                                 inf= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a> * (attEnd - distMinusRadius);              <span class="comment">// inf E ]-oo, 0]</span>
00349                         }
00350                 }
00351 
00352                 <span class="comment">// modulate the influence with this factor</span>
00353                 lightList[i].BkupInfluence= lightList[i].Influence;
00354                 lightList[i].Influence*= inf;
00355 
00356                 <span class="comment">// Bkup distance to model.</span>
00357                 lightList[i].DistanceToModel= dist;
00358         }
00359 
00360         <span class="comment">// sort the light by influence</span>
00361         sort(lightList.begin(), lightList.end());
00362 
00363         <span class="comment">// prepare Light Merging.</span>
00364         <span class="keyword">static</span> std::vector&lt;float&gt;       lightToMergeWeight;
00365         lightToMergeWeight.clear();
00366         lightToMergeWeight.resize(lightList.size(), 1);
00367 
00368 
00369         <span class="comment">// and choose only max light.</span>
00370         <a class="code" href="a04558.html#a15">uint</a>    startId= 0;
00371         <a class="code" href="a04558.html#a15">uint</a>    ligthSrcId= 0;
00372         <span class="comment">// skip already setuped light (statically)</span>
00373         <span class="keywordflow">if</span>(lightContrib.FrozenStaticLightSetup)
00374                 startId= lightContrib.NumFrozenStaticLight;
00375 
00376         <span class="comment">// If there is still place for unFrozen static lights or dynamic lights.</span>
00377         <span class="keywordflow">if</span>(startId &lt; <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>)
00378         {
00379                 <span class="comment">// setup the transition.</span>
00380                 <span class="keywordtype">float</span>   deltaMinInfluence= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a>;
00381                 <span class="keywordtype">float</span>   minInfluence= 0;
00382                 <a class="code" href="a04558.html#a14">sint</a>    doMerge= 0;
00383                 <a class="code" href="a04558.html#a14">sint</a>    firstLightToMergeFull= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>-startId;
00384                 <span class="comment">// If there is more light than we can accept in not merged mode, Must merge</span>
00385                 <span class="keywordflow">if</span>((<a class="code" href="a04558.html#a14">sint</a>)lightList.size() &gt; firstLightToMergeFull)
00386                 {
00387                         doMerge= 1;
00388                         <span class="comment">// the minInfluence is the influence of the first light not taken.</span>
00389                         minInfluence= lightList[firstLightToMergeFull].Influence;
00390                         <span class="comment">// but must still be &gt;=0.</span>
00391                         minInfluence= max(minInfluence, 0.f);
00392                 }
00393                 <span class="comment">// Any light under this minInfluence+deltaMinInfluence will be smoothly darken.</span>
00394                 <span class="keywordtype">float</span>   minInfluenceStart = minInfluence + deltaMinInfluence;
00395                 <span class="keywordtype">float</span>   OOdeltaMinInfluence= 1.0f / deltaMinInfluence;
00396                 <span class="comment">/* NB: this is not an error if we have only 3 light for example (assuming _MaxLightContribution=3), </span>
00397 <span class="comment">                        and still have minInfluenceStart&gt;0.</span>
00398 <span class="comment">                        It's to have a continuity in the case of for example we have 3 lights in lightLists at frame T0, </span>
00399 <span class="comment">                        resulting in "doMerge=0"  and at frame T1 we have 4 lights, the farthest having an influence of 0 </span>
00400 <span class="comment">                        or nearly 0.</span>
00401 <span class="comment">                */</span>
00402 
00403                 <span class="comment">// fill maxLight at max.</span>
00404                 <span class="keywordflow">for</span>(i=startId;i&lt;(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>; i++)
00405                 {
00406                         <span class="comment">// if not so many pointLights found, end!!</span>
00407                         <span class="keywordflow">if</span>(ligthSrcId&gt;=lightList.size())
00408                                 <span class="keywordflow">break</span>;
00409                         <span class="keywordflow">else</span>
00410                         {
00411                                 CPointLight     *pl= lightList[ligthSrcId].PointLight;
00412                                 <span class="keywordtype">float</span>           inf= lightList[ligthSrcId].Influence;
00413                                 <span class="keywordtype">float</span>           bkupInf= lightList[ligthSrcId].BkupInfluence;
00414                                 <span class="keywordtype">float</span>           distToModel= lightList[ligthSrcId].DistanceToModel;
00415                                 <span class="comment">// else fill it.</span>
00416                                 lightContrib.PointLight[i]= pl;
00417 
00418                                 <span class="comment">// Compute the Final factor of influence of the light.</span>
00419                                 <span class="keywordflow">if</span>(inf &gt;= minInfluenceStart)
00420                                 {
00421                                         <span class="comment">// For Static LightSetup BiLinear to work correctly, modulate with BkupInfluence</span>
00422                                         <span class="comment">// don't worry about the precision of floor, because of *255.</span>
00423                                         lightContrib.Factor[i]= (<a class="code" href="a04558.html#a7">uint8</a>)<a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>(bkupInf*255);
00424                                         <span class="comment">// Indicate that this light don't need to be merged at all!</span>
00425                                         lightToMergeWeight[ligthSrcId]= 0;
00426                                 }
00427                                 <span class="keywordflow">else</span>
00428                                 {
00429                                         <span class="keywordtype">float</span>   f= (inf-minInfluence) * OOdeltaMinInfluence;
00430                                         <span class="comment">// For Static LightSetup BiLinear to work correctly, modulate with BkupInfluence</span>
00431                                         <span class="comment">// don't worry about the precision of floor, because of *255.</span>
00432                                         <a class="code" href="a04558.html#a14">sint</a>    fi= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>( bkupInf*f*255 );
00433                                         <a class="code" href="a05378.html#a374">clamp</a>(fi, 0, 255);
00434                                         lightContrib.Factor[i]= fi;
00435                                         <span class="comment">// The rest of the light contribution is to be merged.</span>
00436                                         lightToMergeWeight[ligthSrcId]= 1-f;
00437                                 }
00438 
00439                                 <span class="comment">// Compute the Final Att factor for models using Global Attenuation. NB: modulate with Factor</span>
00440                                 <span class="comment">// don't worry about the precision of floor, because of *255.</span>
00441                                 <span class="comment">// NB: compute att on the center of the model =&gt; modelRadius==0</span>
00442                                 <a class="code" href="a04558.html#a14">sint</a>    attFactor= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>( lightContrib.Factor[i] * pl-&gt;computeLinearAttenuation(modelPos, distToModel) );
00443                                 lightContrib.AttFactor[i]= (<a class="code" href="a04558.html#a7">uint8</a>)attFactor;
00444 
00445                                 <span class="comment">// must append this lightedModel to the list in the light.</span>
00446                                 lightContrib.TransformIterator[i]= pl-&gt;appendLightedModel(model);
00447 
00448                                 <span class="comment">// next light.</span>
00449                                 ligthSrcId++;
00450                         }
00451                 }
00452 
00453                 <span class="comment">// Compute LightToMerge.</span>
00454                 <span class="keywordflow">if</span>(doMerge)
00455                 {
00456                         <a class="code" href="a03338.html">CRGBAF</a>          mergedAmbient(0,0,0);
00457                         <a class="code" href="a04558.html#a15">uint</a>            j;
00458 
00459                         <span class="comment">// For all lights in the lightList, merge Diffuse and Ambient term to mergedAmbient.</span>
00460                         <span class="keywordflow">for</span>(j=0;j&lt;lightToMergeWeight.size();j++)
00461                         {
00462                                 <span class="keywordflow">if</span>(lightToMergeWeight[j] &amp;&amp; lightList[j].Influence&gt;0)
00463                                 {
00464                                         CPointLight     *pl= lightList[j].PointLight;
00465 
00466                                         <span class="comment">// Get the original influence (ie for static PLs, biLinear influence)</span>
00467                                         <span class="keywordtype">float</span>           bkupInf= lightList[j].BkupInfluence;
00468                                         <span class="comment">// Get the attenuation of the pointLight to the model</span>
00469                                         <span class="keywordtype">float</span>           distToModel= lightList[j].DistanceToModel;
00470                                         <span class="keywordtype">float</span>           attInf= pl-&gt;computeLinearAttenuation(modelPos, distToModel);
00471                                         <span class="comment">// Attenuate the color of the light by biLinear and distance/spot attenuation.</span>
00472                                         <span class="keywordtype">float</span>           lightInf= attInf * bkupInf;
00473                                         <span class="comment">// Modulate also by the percentage to merge </span>
00474                                         lightInf*= lightToMergeWeight[j];
00475                                         <span class="comment">// Add the full ambient term of the light, attenuated by light attenuation and WeightMerge</span>
00476                                         mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo3">R</a>+= pl-&gt;getAmbient().R * lightInf;
00477                                         mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo2">G</a>+= pl-&gt;getAmbient().G * lightInf;
00478                                         mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo1">B</a>+= pl-&gt;getAmbient().B * lightInf;
00479                                         <span class="comment">// Add 0.25f of the diffuse term of the light, attenuated by light attenuation and WeightMerge</span>
00480                                         <span class="comment">// mul by 0.25f, because this is the averaged contribution of the diffuse part of a </span>
00481                                         <span class="comment">// light to a sphere (do the maths...).</span>
00482                                         <span class="keywordtype">float</span>   f= lightInf*0.25f;
00483                                         mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo3">R</a>+= pl-&gt;getDiffuse().R * f;
00484                                         mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo2">G</a>+= pl-&gt;getDiffuse().G * f;
00485                                         mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo1">B</a>+= pl-&gt;getDiffuse().B * f;
00486                                 }
00487                         }
00488 
00489 
00490                         <span class="comment">// Setup the merged Light</span>
00491                         <a class="code" href="a03337.html">CRGBA</a>   amb;
00492                         <a class="code" href="a04558.html#a14">sint</a>    <a class="code" href="a04223.html#a576">v</a>;
00493                         <span class="comment">// Because of floating point error, it appears that sometime result may be slightly below 0. </span>
00494                         <span class="comment">// =&gt; clamp necessary</span>
00495                         <a class="code" href="a04223.html#a576">v</a>= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>(mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo3">R</a>);       fastClamp8(v);  amb.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a>= <a class="code" href="a04223.html#a576">v</a>;
00496                         <a class="code" href="a04223.html#a576">v</a>= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>(mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo2">G</a>);       fastClamp8(v);  amb.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo2">G</a>= <a class="code" href="a04223.html#a576">v</a>;
00497                         <a class="code" href="a04223.html#a576">v</a>= <a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>(mergedAmbient.<a class="code" href="a03338.html#NLMISC_1_1CRGBAFo1">B</a>);       fastClamp8(v);  amb.<a class="code" href="a03337.html#NLMISC_1_1CRGBAo1">B</a>= <a class="code" href="a04223.html#a576">v</a>;
00498                         lightContrib.MergedPointLight= amb;
00499 
00500                         <span class="comment">// Indicate we use the merged pointLight =&gt; the model must recompute lighting each frame</span>
00501                         lightContrib.UseMergedPointLight= <span class="keyword">true</span>;
00502                 }
00503                 <span class="keywordflow">else</span>
00504                 {
00505                         <span class="comment">// If the model is freezeHRC(), need to test each frame only if MergedPointLight is used.</span>
00506                         lightContrib.UseMergedPointLight= <span class="keyword">false</span>;
00507                 }
00508         }
00509         <span class="keywordflow">else</span>
00510         {
00511                 <span class="comment">// point to end the list</span>
00512                 i= startId;
00513         }
00514 
00515         <span class="comment">// End the list.</span>
00516         <span class="keywordflow">if</span>(i&lt;<a class="code" href="a04471.html#a0">NL3D_MAX_LIGHT_CONTRIBUTION</a>)
00517         {
00518                 lightContrib.PointLight[i]= NULL;
00519         }
00520 
00521 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz336_0" doxytag="NL3D::CLightingManager::eraseStaticLightedModel" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a02749.html">CLightingManager::CQGItLightedModel</a> NL3D::CLightingManager::eraseStaticLightedModel </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02749.html">CQGItLightedModel</a>&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>ite</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
erase a lighted object to the _StaticLightedModelQuadGrid. must do it at deletion of the model or when it leaves freeHRC state. NB: default <a class="el" href="a02749.html">CQGItLightedModel</a> (ie NULL) can be passed in. <dl compact><dt><b>Returns:</b></dt><dd>quadgrid.end(), ie NULL iterator.</dd></dl>

<p>
Definition at line <a class="el" href="a05901.html#l00217">217</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00176">_StaticLightedModelQuadGrid</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_1">NL3D::CQuadGrid&lt; CTransform * &gt;::erase()</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a05902.html#l00068">NL3D::CLightingManager::CQGItLightedModel::QgItes</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06568.html#l00406">NL3D::CTransform::unfreezeHRC()</a>, <a class="el" href="a06568.html#l00450">NL3D::CTransform::update()</a>, and <a class="el" href="a06568.html#l00143">NL3D::CTransform::~CTransform()</a>.
<p>
<div class="fragment"><pre>00218 {
00219         <span class="comment">// Erase the iterator for all levels</span>
00220         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>;i++)
00221         {
00222                 <span class="comment">// NB: it is possible here that the iterator is NULL (ie end()).</span>
00223                 <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[i].erase(ite.QgItes[i]);
00224         }
00225 
00226         <span class="comment">// return end(), ie NULL iterators</span>
00227         <span class="keywordflow">return</span> CQGItLightedModel();
00228 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz334_2" doxytag="NL3D::CLightingManager::getAllDynamicLightList" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> const std::vector&lt;<a class="el" href="a03091.html">CPointLight</a>*&gt;&amp; NL3D::CLightingManager::getAllDynamicLightList </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline]</code></td>
        </tr>

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

<p>
retrieve (for this pass only) list of all pointLights visible in scene
<p>
Definition at line <a class="el" href="a05902.html#l00126">126</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
Referenced by <a class="el" href="a05870.html#l00143">NL3D::CLandscapeModel::clipAndRenderLandscape()</a>.
<p>
<div class="fragment"><pre>00126 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr0">_DynamicLightList</a>;}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerd0" doxytag="NL3D::CLightingManager::getDynamicPointLightList" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CLightingManager::getDynamicPointLightList </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>worldPos</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>std::vector&lt; <a class="el" href="a03092.html">CPointLightInfluence</a> &gt; &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>lightList</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
get the list of dynamic light viewed from a position. append to lightList 
<p>

<p>
Definition at line <a class="el" href="a05901.html#l00525">525</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00177">_LightQuadGrid</a>, <a class="el" href="a06300.html#l00641">NL3D::CQuadGrid&lt; T &gt;::begin()</a>, <a class="el" href="a06300.html#l00646">NL3D::CQuadGrid&lt; T &gt;::end()</a>, <a class="el" href="a06181.html#l00051">NL3D::CPointLightInfluence::Influence</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a06181.html#l00049">NL3D::CPointLightInfluence::PointLight</a>, <a class="el" href="a06300.html#l00613">NL3D::CQuadGrid&lt; T &gt;::select()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05901.html#l00256">computeModelLightContributions()</a>.
<p>
<div class="fragment"><pre>00526 {
00527         <span class="comment">// For all quadGrids.</span>
00528         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> qgId=0; qgId&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>; qgId++)
00529         {
00530                 CQuadGrid&lt;CPointLightInfo&gt;      &amp;quadGrid= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr1">_LightQuadGrid</a>[qgId];
00531 
00532                 <span class="comment">// select the lights around this position in the quadGrids.</span>
00533                 quadGrid.select(worldPos, worldPos);
00534 
00535                 <span class="comment">// for all possible found lights</span>
00536                 CQuadGrid&lt;CPointLightInfo&gt;::CIterator   itLight;
00537                 <span class="keywordflow">for</span>(itLight= quadGrid.begin(); itLight!=quadGrid.end(); itLight++)
00538                 {
00539                         <span class="comment">// verify it includes the entity</span>
00540                         <span class="keywordflow">if</span>( (*itLight).Sphere.include(worldPos) )
00541                         {
00542                                 <span class="comment">// ok, insert in list.</span>
00543                                 CPointLightInfluence    pli;
00544                                 pli.PointLight= (*itLight).Light;
00545                                 <span class="comment">// No special Influence degradation scheme for Dynamic lighting</span>
00546                                 pli.Influence= 1;
00547                                 lightList.push_back( pli );
00548                         }
00549                 }
00550         }
00551 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz332_0" doxytag="NL3D::CLightingManager::getLightTransitionThreshold" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float NL3D::CLightingManager::getLightTransitionThreshold </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline]</code></td>
        </tr>

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

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00109">109</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
References <a class="el" href="a05902.html#l00188">_LightTransitionThreshold</a>.
<p>
Referenced by <a class="el" href="a06348.html#l00903">NL3D::CScene::getLightTransitionThreshold()</a>.
<p>
<div class="fragment"><pre>00109 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a>;}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz332_1" doxytag="NL3D::CLightingManager::getMaxLightContribution" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NL3D::CLightingManager::getMaxLightContribution </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline]</code></td>
        </tr>

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

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00084">84</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
References <a class="el" href="a05902.html#l00185">_MaxLightContribution</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06348.html#l00894">NL3D::CScene::getMaxLightContribution()</a>.
<p>
<div class="fragment"><pre>00084 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>;}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz332_2" doxytag="NL3D::CLightingManager::getNoAttLightRadius" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float NL3D::CLightingManager::getNoAttLightRadius </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline]</code></td>
        </tr>

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

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00091">91</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
References <a class="el" href="a05902.html#l00186">_NoAttLightRadius</a>.
<p>
<div class="fragment"><pre>00091 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a>;}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz332_3" doxytag="NL3D::CLightingManager::getOutOfAttLightInfFactor" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float NL3D::CLightingManager::getOutOfAttLightInfFactor </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline]</code></td>
        </tr>

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

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00098">98</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
References <a class="el" href="a05902.html#l00187">_OutOfAttLightInfFactor</a>.
<p>
<div class="fragment"><pre>00098 {<span class="keywordflow">return</span> <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a>;}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz336_1" doxytag="NL3D::CLightingManager::insertStaticLightedModel" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a02749.html">CLightingManager::CQGItLightedModel</a> NL3D::CLightingManager::insertStaticLightedModel </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02316.html">CTransform</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>model</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
insert a lighted object to the _StaticLightedModelQuadGrid. must not be inserted before must do it only for static objects, ie when freeHRC state is validated (see <a class="el" href="a02316.html#NL3D_1_1CWaveMakerModelz1017_4">CTransform::update()</a>) NB: only lightable models with no AncestorSkeletonModel should be inserted
<p>
Definition at line <a class="el" href="a05901.html#l00231">231</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00176">_StaticLightedModelQuadGrid</a>, <a class="el" href="a05973.html#l00198">NLMISC::CMatrix::getPos()</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_2">NL3D::CQuadGrid&lt; CTransform * &gt;::insert()</a>, <a class="el" href="a05902.html#l00047">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>, <a class="el" href="a05902.html#l00068">NL3D::CLightingManager::CQGItLightedModel::QgItes</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06568.html#l00450">NL3D::CTransform::update()</a>.
<p>
<div class="fragment"><pre>00232 {
00233         CQGItLightedModel       ite;
00234         <span class="keyword">const</span> CVector &amp;worldPos= model-&gt;getWorldMatrix().getPos();
00235 
00236         <span class="comment">// Insert the models in all levels, because addDynamicLight() may choose the best suited level to select</span>
00237         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;<a class="code" href="a04479.html#a0">NL3D_QUADGRID_LIGHT_NUM_LEVEL</a>;i++)
00238         {
00239                 ite.QgItes[i]= <a class="code" href="a02747.html#NL3D_1_1CLightingManagerr3">_StaticLightedModelQuadGrid</a>[i].insert(worldPos, worldPos, model);
00240         }
00241 
00242         <span class="comment">// return the iterator</span>
00243         <span class="keywordflow">return</span> ite;
00244 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz332_4" doxytag="NL3D::CLightingManager::setLightTransitionThreshold" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CLightingManager::setLightTransitionThreshold </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">float&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>lightTransitionThreshold</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
Advanced. When a model is influenced by more light than allowed, or when it reach the limits of the light (attenuationEnd), the light can be darkened according to some threshold. The resultLightColor begin to fade when distModelToLight== attEnd- threshold*(attEnd-attBegin). when distModelToLight== 0, resultLightColor==Black. By default, this value is 0.1f. Setting higher values will smooth transition but will generally darken the global effects of lights. NB: clamp(value, 0, 1);
<p>
Definition at line <a class="el" href="a05901.html#l00128">128</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00188">_LightTransitionThreshold</a>, and <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>.
<p>
Referenced by <a class="el" href="a06348.html#l00899">NL3D::CScene::setLightTransitionThreshold()</a>.
<p>
<div class="fragment"><pre>00129 {
00130         <a class="code" href="a05378.html#a374">clamp</a>(lightTransitionThreshold, 0.f, 1.f);
00131         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_0">_LightTransitionThreshold</a>= lightTransitionThreshold;
00132 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz332_5" doxytag="NL3D::CLightingManager::setMaxLightContribution" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CLightingManager::setMaxLightContribution </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>nlights</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
set the max number of point light that can influence a model. NB: clamped by NL3D_MAX_LIGHT_CONTRIBUTION Default is 3. NB: the sun contribution is not taken into account
<p>
Definition at line <a class="el" href="a05901.html#l00105">105</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00185">_MaxLightContribution</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05894.html#l00042">NL3D_MAX_LIGHT_CONTRIBUTION</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05901.html#l00064">CLightingManager()</a>, and <a class="el" href="a06348.html#l00890">NL3D::CScene::setMaxLightContribution()</a>.
<p>
<div class="fragment"><pre>00106 {
00107         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_1">_MaxLightContribution</a>= <a class="code" href="a04061.html#a0">min</a>(nlights, (<a class="code" href="a04558.html#a15">uint</a>)NL3D_MAX_LIGHT_CONTRIBUTION);
00108 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz332_6" doxytag="NL3D::CLightingManager::setNoAttLightRadius" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CLightingManager::setNoAttLightRadius </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">float&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>noAttLightRadius</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
Advanced. When a light has no attenuation, it's still inserted in a quadgrid with some radius and won't influence models beyond. You can setup this radius with this method. Default is 1000m. NB: <a class="el" href="a04199.html#a6">nlassert(noAttLightRadius&gt;0)</a>;
<p>
Definition at line <a class="el" href="a05901.html#l00112">112</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00186">_NoAttLightRadius</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>.
<p>
<div class="fragment"><pre>00113 {
00114         <a class="code" href="a04199.html#a6">nlassert</a>(noAttLightRadius&gt;0);
00115         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_2">_NoAttLightRadius</a>= noAttLightRadius;
00116 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz332_7" doxytag="NL3D::CLightingManager::setOutOfAttLightInfFactor" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CLightingManager::setOutOfAttLightInfFactor </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">float&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>outOfAttLightInfFactor</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
Advanced. When a model is out of [AttBegin, AttEnd] of a light, the computed influence of the light used to choose "best lights" is not constant, and is a function of distance multiplied by a factor you can setup here. Default is 0.1f and is good for lights with att like (50, 100) (arbitrary).
<p>
Definition at line <a class="el" href="a05901.html#l00120">120</a> of file <a class="el" href="a05901.html">lighting_manager.cpp</a>.
<p>
References <a class="el" href="a05902.html#l00187">_OutOfAttLightInfFactor</a>.
<p>
<div class="fragment"><pre>00121 {
00122         outOfAttLightInfFactor= max(0.f, outOfAttLightInfFactor);
00123         <a class="code" href="a02747.html#NL3D_1_1CLightingManagerz338_3">_OutOfAttLightInfFactor</a>= outOfAttLightInfFactor;
00124 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CLightingManagerr0" doxytag="NL3D::CLightingManager::_DynamicLightList" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> std::vector&lt;<a class="el" href="a03091.html">CPointLight</a>*&gt; <a class="el" href="a02747.html#NL3D_1_1CLightingManagerr0">NL3D::CLightingManager::_DynamicLightList</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00181">181</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerr1" doxytag="NL3D::CLightingManager::_LightQuadGrid" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03273.html">CQuadGrid</a>&lt;<a class="el" href="a02748.html">CPointLightInfo</a>&gt; <a class="el" href="a02747.html#NL3D_1_1CLightingManagerr1">NL3D::CLightingManager::_LightQuadGrid</a>[ 4 ]<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00177">177</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
Referenced by <a class="el" href="a05901.html#l00151">addDynamicLight()</a>, <a class="el" href="a05901.html#l00137">clearDynamicLights()</a>, <a class="el" href="a05901.html#l00064">CLightingManager()</a>, and <a class="el" href="a05901.html#l00525">getDynamicPointLightList()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerr2" doxytag="NL3D::CLightingManager::_LightQuadGridRadiusLimit" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a02747.html#NL3D_1_1CLightingManagerr2">NL3D::CLightingManager::_LightQuadGridRadiusLimit</a>[ 4 ]<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00179">179</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
Referenced by <a class="el" href="a05901.html#l00151">addDynamicLight()</a>, and <a class="el" href="a05901.html#l00064">CLightingManager()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz338_0" doxytag="NL3D::CLightingManager::_LightTransitionThreshold" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_0">NL3D::CLightingManager::_LightTransitionThreshold</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00188">188</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
Referenced by <a class="el" href="a05901.html#l00064">CLightingManager()</a>, <a class="el" href="a05901.html#l00256">computeModelLightContributions()</a>, <a class="el" href="a05902.html#l00109">getLightTransitionThreshold()</a>, and <a class="el" href="a05901.html#l00128">setLightTransitionThreshold()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz338_1" doxytag="NL3D::CLightingManager::_MaxLightContribution" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_1">NL3D::CLightingManager::_MaxLightContribution</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00185">185</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
Referenced by <a class="el" href="a05901.html#l00256">computeModelLightContributions()</a>, <a class="el" href="a05902.html#l00084">getMaxLightContribution()</a>, and <a class="el" href="a05901.html#l00105">setMaxLightContribution()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz338_2" doxytag="NL3D::CLightingManager::_NoAttLightRadius" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_2">NL3D::CLightingManager::_NoAttLightRadius</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00186">186</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
Referenced by <a class="el" href="a05901.html#l00151">addDynamicLight()</a>, <a class="el" href="a05901.html#l00064">CLightingManager()</a>, <a class="el" href="a05902.html#l00091">getNoAttLightRadius()</a>, and <a class="el" href="a05901.html#l00112">setNoAttLightRadius()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerz338_3" doxytag="NL3D::CLightingManager::_OutOfAttLightInfFactor" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a02747.html#NL3D_1_1CLightingManagerz338_3">NL3D::CLightingManager::_OutOfAttLightInfFactor</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00187">187</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
Referenced by <a class="el" href="a05901.html#l00064">CLightingManager()</a>, <a class="el" href="a05901.html#l00256">computeModelLightContributions()</a>, <a class="el" href="a05902.html#l00098">getOutOfAttLightInfFactor()</a>, and <a class="el" href="a05901.html#l00120">setOutOfAttLightInfFactor()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CLightingManagerr3" doxytag="NL3D::CLightingManager::_StaticLightedModelQuadGrid" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03273.html">CQuadGrid</a>&lt;<a class="el" href="a02316.html">CTransform</a>*&gt; <a class="el" href="a02747.html#NL3D_1_1CLightingManagerr3">NL3D::CLightingManager::_StaticLightedModelQuadGrid</a>[ 4 ]<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a05902.html#l00176">176</a> of file <a class="el" href="a05902.html">lighting_manager.h</a>.
<p>
Referenced by <a class="el" href="a05901.html#l00151">addDynamicLight()</a>, <a class="el" href="a05901.html#l00064">CLightingManager()</a>, <a class="el" href="a05901.html#l00217">eraseStaticLightedModel()</a>, and <a class="el" href="a05901.html#l00231">insertStaticLightedModel()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a05902.html">lighting_manager.h</a><li><a class="el" href="a05901.html">lighting_manager.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:49:30 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.6 </small></address>
</body>
</html>