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
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: NL3D::CInstanceLighter class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"> <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NL3D::CInstanceLighter Class Reference</h1><code>#include <<a class="el" href="a05825.html">instance_lighter.h</a>></code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A class to precompute "StaticSetup" lighting for instances in an InstanceGroup. Class "inspired" from <a class="el" href="a03739.html">CZoneLighter</a> :) <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00055">55</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Cell Iteration. ie iteration on _IGRetrieverGridMap cells and _IGSurfaceLightBuild cells</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03465.html">CSurfaceLightGrid::CCellCorner</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02657.html">CIGSurfaceLightBuild::CCellCorner</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_3">getCurrentCellNumber</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03465.html">CSurfaceLightGrid::CCellCorner</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_4">getCurrentNeighborCell</a> (<a class="el" href="a04558.html#a14">sint</a> xnb, <a class="el" href="a04558.html#a14">sint</a> ynb)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02657.html">CIGSurfaceLightBuild::CCellCorner</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_5">getCurrentNeighborCellInfo</a> (<a class="el" href="a04558.html#a14">sint</a> xnb, <a class="el" href="a04558.html#a14">sint</a> ynb)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_6">getTotalCellNumber</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_7">isCurrentNeighborCellInSurface</a> (<a class="el" href="a04558.html#a14">sint</a> xnb, <a class="el" href="a04558.html#a14">sint</a> ynb)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a> (const char *message)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_13">_ItCurrentCellNumber</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02654.html#NL3D_1_1CIGSurfaceLightw0">CIGSurfaceLight::ItRetrieverGridMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw1">CIGSurfaceLightBuild::ItRetrieverGridMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_17">_LastCellProgress</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_18">_TotalCellNumber</a></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom>{ <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterw0NL3D_1_1CInstanceLighterw1">MaxOverSamples</a> = 16
}</td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera0">CInstanceLighter</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NL3D_1_1CInstanceLightera0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera1">init</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera2">light</a> (const <a class="el" href="a02671.html">CInstanceGroup</a> &igIn, <a class="el" href="a02671.html">CInstanceGroup</a> &igOut, const <a class="el" href="a02677.html">CLightDesc</a> &lightDesc, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &obstacles, <a class="el" href="a02702.html">CLandscape</a> *landscape=NULL, <a class="el" href="a02656.html">CIGSurfaceLightBuild</a> *igSurfaceLightBuild=NULL)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (const char *message, float progress)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightera4">~CInstanceLighter</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#NL3D_1_1CInstanceLightera4"></a><br><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Static PointLights mgt.</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz207_0">addStaticPointLight</a> (const <a class="el" href="a03094.html">CPointLightNamed</a> &pln, const char *igName)</td></tr>
<tr><td colspan=2><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightere0">addTriangles</a> (const <a class="el" href="a02539.html">IShape</a> &shape, const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &modelMT, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &triangleArray, <a class="el" href="a04558.html#a14">sint</a> instanceId)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (<a class="el" href="a02702.html">CLandscape</a> &landscape, std::vector< <a class="el" href="a04558.html#a15">uint</a> > &listZone, <a class="el" href="a04558.html#a15">uint</a> order, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &triangleArray)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLightere2">lightIgSimple</a> (<a class="el" href="a02675.html">CInstanceLighter</a> &instLighter, const <a class="el" href="a02671.html">CInstanceGroup</a> &igIn, <a class="el" href="a02671.html">CInstanceGroup</a> &igOut, const <a class="el" href="a02677.html">CLightDesc</a> &lightDesc, const char *igName)</td></tr>
<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterd0">compilePointLightRT</a> (<a class="el" href="a04558.html#a15">uint</a> gridSize, float gridCellSize, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &obstacles, bool doShadow)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Fill CubeGrid, and set PointLightRT in _StaticPointLightQuadGrid. <a href="#NL3D_1_1CInstanceLighterd0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterd1">computeSunContribution</a> (const <a class="el" href="a02677.html">CLightDesc</a> &lightDesc, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &obstacles, <a class="el" href="a02702.html">CLandscape</a> *landscape)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterd2">dilateLightingOnSurfaceCells</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterd3">processIGPointLightRT</a> (std::vector< <a class="el" href="a03094.html">CPointLightNamed</a> > &listPointLight)</td></tr>
<tr><td colspan=2><br><h2>Static Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterh0">addTriangles</a> (const <a class="el" href="a02892.html">CMeshMRMGeom</a> &meshGeom, const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &modelMT, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &triangleArray, <a class="el" href="a04558.html#a14">sint</a> instanceId)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterh1">addTriangles</a> (const <a class="el" href="a02878.html">CMeshGeom</a> &meshGeom, const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &modelMT, std::vector< <a class="el" href="a02680.html">CTriangle</a> > &triangleArray, <a class="el" href="a04558.html#a14">sint</a> instanceId)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterh2">excludeAllPatchFromRefineAll</a> (<a class="el" href="a02702.html">CLandscape</a> &landscape, std::vector< <a class="el" href="a04558.html#a15">uint</a> > &listZone, bool exclude)</td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr0">_CurrentInstanceComputed</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02654.html#NL3D_1_1CIGSurfaceLightw1">CIGSurfaceLight::TRetrieverGridMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02656.html">CIGSurfaceLightBuild</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02676.html">CInstanceInfo</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02672.html">CInstanceGroup::CInstance</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03273.html">CQuadGrid</a>< <a class="el" href="a02678.html">CPointLightRT</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">QuadGrid of PointLights. Builded from _StaticPointLights. <a href="#NL3D_1_1CInstanceLighterr5"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02678.html">CPointLightRT</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">List of PointLights. <a href="#NL3D_1_1CInstanceLighterr6"></a><br><br></td></tr>
</table>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="NL3D_1_1CInstanceLighterw0" doxytag="NL3D::CInstanceLighter::@14" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> anonymous enum
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CInstanceLighterw0NL3D_1_1CInstanceLighterw1" doxytag="MaxOverSamples" ></a>MaxOverSamples</em> </td><td>
</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="a05825.html#l00059">59</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
<div class="fragment"><pre>00059 {<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterw0NL3D_1_1CInstanceLighterw1">MaxOverSamples</a>= 16};
</pre></div> </td>
</tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CInstanceLightera0" doxytag="NL3D::CInstanceLighter::CInstanceLighter" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> NL3D::CInstanceLighter::CInstanceLighter </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructor.
<p>
<p>
Definition at line <a class="el" href="a05824.html#l00066">66</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>.
<p>
<div class="fragment"><pre>00067 {
00068 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>= NULL;
00069 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLightera4" doxytag="NL3D::CInstanceLighter::~CInstanceLighter" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual NL3D::CInstanceLighter::~<a class="el" href="a02675.html">CInstanceLighter</a> </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Destructor.
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00131">131</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
<div class="fragment"><pre>00131 {}
</pre></div> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CInstanceLighterz207_0" doxytag="NL3D::CInstanceLighter::addStaticPointLight" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::addStaticPointLight </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a03094.html">CPointLightNamed</a> & </td>
<td class="mdname" nowrap> <em>pln</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>igName</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Append a static point light to compute. call at setup stage (before <a class="el" href="a02675.html#NL3D_1_1CInstanceLightera2">light()</a> ). NB: you must append all PointLights of intersets, even ones from the IG to compute.
<p>
Definition at line <a class="el" href="a05824.html#l00999">999</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00253">_StaticPointLights</a>, <a class="el" href="a05825.html#l00223">NL3D::CInstanceLighter::CPointLightRT::BSphere</a>, <a class="el" href="a05505.html#l00048">NLMISC::CBSphere::Center</a>, <a class="el" href="a06180.html#l00141">NL3D::CPointLight::getAttenuationBegin()</a>, <a class="el" href="a06180.html#l00143">NL3D::CPointLight::getAttenuationEnd()</a>, <a class="el" href="a06180.html#l00116">NL3D::CPointLight::getPosition()</a>, <a class="el" href="a05825.html#l00221">NL3D::CInstanceLighter::CPointLightRT::OODeltaAttenuation</a>, <a class="el" href="a05825.html#l00220">NL3D::CInstanceLighter::CPointLightRT::PointLight</a>, and <a class="el" href="a05505.html#l00049">NLMISC::CBSphere::Radius</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01502">lightIgSimple()</a>.
<p>
<div class="fragment"><pre>01000 {
01001 <span class="comment">// NB: adding light more than 255 is allowed here, since the important thig is to not overflow really usefull lights</span>
01002
01003 <span class="comment">// build the plRT.</span>
01004 CPointLightRT plRT;
01005 plRT.PointLight= pln;
01006 <span class="comment">// compute plRT.OODeltaAttenuation</span>
01007 plRT.OODeltaAttenuation= pln.getAttenuationEnd() - pln.getAttenuationBegin();
01008 <span class="keywordflow">if</span>(plRT.OODeltaAttenuation <=0 )
01009 plRT.OODeltaAttenuation= 1e10f;
01010 <span class="keywordflow">else</span>
01011 plRT.OODeltaAttenuation= 1.0f / plRT.OODeltaAttenuation;
01012 <span class="comment">// compute plRT.BSphere</span>
01013 plRT.BSphere.Center= pln.getPosition();
01014 plRT.BSphere.Radius= pln.getAttenuationEnd();
01015 <span class="comment">// NB: FaceCubeGrid will be computed during light()</span>
01016
01017 <span class="comment">// add the plRT</span>
01018 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>.push_back(plRT);
01019 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterh0" doxytag="NL3D::CInstanceLighter::addTriangles" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::addTriangles </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a02892.html">CMeshMRMGeom</a> & </td>
<td class="mdname" nowrap> <em>meshGeom</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="a02851.html">NLMISC::CMatrix</a> & </td>
<td class="mdname" nowrap> <em>modelMT</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td>
<td class="mdname" nowrap> <em>triangleArray</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td>
<td class="mdname" nowrap> <em>instanceId</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static, private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l00231">231</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a06006.html#l00192">NL3D::CMeshMRMGeom::getNbRdrPass()</a>, <a class="el" href="a06198.html#l00141">NL3D::CPrimitiveBlock::getNumQuad()</a>, <a class="el" href="a06198.html#l00108">NL3D::CPrimitiveBlock::getNumTri()</a>, <a class="el" href="a06197.html#l00149">NL3D::CPrimitiveBlock::getQuadPointer()</a>, <a class="el" href="a06006.html#l00199">NL3D::CMeshMRMGeom::getRdrPassPrimitiveBlock()</a>, <a class="el" href="a06197.html#l00091">NL3D::CPrimitiveBlock::getTriPointer()</a>, <a class="el" href="a06006.html#l00176">NL3D::CMeshMRMGeom::getVertexBuffer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00232 {
00233 <span class="comment">// Get the vertex buffer</span>
00234 <span class="keyword">const</span> CVertexBuffer &vb=meshGeom.getVertexBuffer();
00235
00236 <span class="comment">// For each render pass</span>
00237 <a class="code" href="a04558.html#a15">uint</a> numRenderPass=meshGeom.getNbRdrPass(0);
00238 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> pass=0; pass<numRenderPass; pass++)
00239 {
00240 <span class="comment">// Get the primitive block</span>
00241 <span class="keyword">const</span> CPrimitiveBlock &primitive=meshGeom.getRdrPassPrimitiveBlock ( 0, pass);
00242
00243 <span class="comment">// Dump triangles</span>
00244 <span class="keyword">const</span> <a class="code" href="a04558.html#a11">uint32</a>* triIndex=primitive.getTriPointer ();
00245 <a class="code" href="a04558.html#a15">uint</a> numTri=primitive.getNumTri ();
00246 <a class="code" href="a04558.html#a15">uint</a> tri;
00247 <span class="keywordflow">for</span> (tri=0; tri<numTri; tri++)
00248 {
00249 <span class="comment">// Vertex</span>
00250 CVector v0=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3]));
00251 CVector v1=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3+1]));
00252 CVector v2=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3+2]));
00253
00254 <span class="comment">// Make a triangle</span>
00255 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v1, v2), instanceId));
00256 }
00257
00258 <span class="comment">// Dump quad</span>
00259 triIndex=primitive.getQuadPointer ();
00260 numTri=primitive.getNumQuad ();
00261 <span class="keywordflow">for</span> (tri=0; tri<numTri; tri++)
00262 {
00263 <span class="comment">// Vertex</span>
00264 CVector v0=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4]));
00265 CVector v1=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+1]));
00266 CVector v2=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+2]));
00267 CVector v3=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+3]));
00268
00269 <span class="comment">// Make 2 triangles</span>
00270 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v1, v2), instanceId));
00271 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v2, v3), instanceId));
00272 }
00273 }
00274 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterh1" doxytag="NL3D::CInstanceLighter::addTriangles" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::addTriangles </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a02878.html">CMeshGeom</a> & </td>
<td class="mdname" nowrap> <em>meshGeom</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="a02851.html">NLMISC::CMatrix</a> & </td>
<td class="mdname" nowrap> <em>modelMT</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td>
<td class="mdname" nowrap> <em>triangleArray</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td>
<td class="mdname" nowrap> <em>instanceId</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static, private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l00179">179</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05990.html#l00393">NL3D::CMeshGeom::getNbMatrixBlock()</a>, <a class="el" href="a05990.html#l00398">NL3D::CMeshGeom::getNbRdrPass()</a>, <a class="el" href="a06198.html#l00141">NL3D::CPrimitiveBlock::getNumQuad()</a>, <a class="el" href="a06198.html#l00108">NL3D::CPrimitiveBlock::getNumTri()</a>, <a class="el" href="a06197.html#l00149">NL3D::CPrimitiveBlock::getQuadPointer()</a>, <a class="el" href="a05990.html#l00404">NL3D::CMeshGeom::getRdrPassPrimitiveBlock()</a>, <a class="el" href="a06197.html#l00091">NL3D::CPrimitiveBlock::getTriPointer()</a>, <a class="el" href="a05990.html#l00390">NL3D::CMeshGeom::getVertexBuffer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
<div class="fragment"><pre>00180 {
00181 <span class="comment">// Get the vertex buffer</span>
00182 <span class="keyword">const</span> CVertexBuffer &vb=meshGeom.getVertexBuffer();
00183
00184 <span class="comment">// For each matrix block</span>
00185 <a class="code" href="a04558.html#a15">uint</a> numBlock=meshGeom.getNbMatrixBlock();
00186 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> block=0; block<numBlock; block++)
00187 {
00188 <span class="comment">// For each render pass</span>
00189 <a class="code" href="a04558.html#a15">uint</a> numRenderPass=meshGeom.getNbRdrPass(block);
00190 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> pass=0; pass<numRenderPass; pass++)
00191 {
00192 <span class="comment">// Get the primitive block</span>
00193 <span class="keyword">const</span> CPrimitiveBlock &primitive=meshGeom.getRdrPassPrimitiveBlock ( block, pass);
00194
00195 <span class="comment">// Dump triangles</span>
00196 <span class="keyword">const</span> <a class="code" href="a04558.html#a11">uint32</a>* triIndex=primitive.getTriPointer ();
00197 <a class="code" href="a04558.html#a15">uint</a> numTri=primitive.getNumTri ();
00198 <a class="code" href="a04558.html#a15">uint</a> tri;
00199 <span class="keywordflow">for</span> (tri=0; tri<numTri; tri++)
00200 {
00201 <span class="comment">// Vertex</span>
00202 CVector v0=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3]));
00203 CVector v1=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3+1]));
00204 CVector v2=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*3+2]));
00205
00206 <span class="comment">// Make a triangle</span>
00207 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v1, v2), instanceId));
00208 }
00209
00210 <span class="comment">// Dump quad</span>
00211 triIndex=primitive.getQuadPointer ();
00212 numTri=primitive.getNumQuad ();
00213 <span class="keywordflow">for</span> (tri=0; tri<numTri; tri++)
00214 {
00215 <span class="comment">// Vertex</span>
00216 CVector v0=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4]));
00217 CVector v1=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+1]));
00218 CVector v2=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+2]));
00219 CVector v3=modelMT*(*(CVector*)vb.getVertexCoordPointer (triIndex[tri*4+3]));
00220
00221 <span class="comment">// Make 2 triangles</span>
00222 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v1, v2), instanceId));
00223 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (v0, v2, v3), instanceId));
00224 }
00225 }
00226 }
00227 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLightere0" doxytag="NL3D::CInstanceLighter::addTriangles" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::addTriangles </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a02539.html">IShape</a> & </td>
<td class="mdname" nowrap> <em>shape</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="a02851.html">NLMISC::CMatrix</a> & </td>
<td class="mdname" nowrap> <em>modelMT</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td>
<td class="mdname" nowrap> <em>triangleArray</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td>
<td class="mdname" nowrap> <em>instanceId</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Add triangles from a transform shape. Work only for <a class="el" href="a02857.html">CMesh</a>, CMultiMesh and <a class="el" href="a02891.html">CMeshMRM</a> all without skinning. Give An instanceId!=-1 only for instances of the IG to compute. This is to avoid auto-shadowing.
<p>
Definition at line <a class="el" href="a05824.html#l00129">129</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05824.html#l00077">addTriangles()</a>, <a class="el" href="a06005.html#l02992">NL3D::CMeshMRM::getMeshGeom()</a>, <a class="el" href="a06016.html#l00599">NL3D::CMeshMultiLod::getMeshGeom()</a>, <a class="el" href="a05989.html#l02463">NL3D::CMesh::getMeshGeom()</a>, and <a class="el" href="a05981.html#l00104">sint</a>.
<p>
<div class="fragment"><pre>00130 {
00131 <span class="comment">// Lamed from CZoneLighter.</span>
00132
00133 <span class="comment">// Cast to CMesh</span>
00134 <span class="keyword">const</span> CMesh *mesh=dynamic_cast<const CMesh*>(&shape);
00135
00136 <span class="comment">// Cast to CMeshMultiLod</span>
00137 <span class="keyword">const</span> CMeshMultiLod *meshMulti=dynamic_cast<const CMeshMultiLod*>(&shape);
00138
00139 <span class="comment">// Cast to CMeshMultiLod</span>
00140 <span class="keyword">const</span> CMeshMRM *meshMRM=dynamic_cast<const CMeshMRM*>(&shape);
00141
00142 <span class="comment">// It is a mesh ?</span>
00143 <span class="keywordflow">if</span> (mesh)
00144 {
00145 <span class="comment">// Add its triangles</span>
00146 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (mesh->getMeshGeom (), modelMT, triangleArray, instanceId);
00147 }
00148 <span class="comment">// It is a CMeshMultiLod ?</span>
00149 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (meshMulti)
00150 {
00151 <span class="comment">// Get the first geommesh</span>
00152 <span class="keyword">const</span> IMeshGeom *meshGeom=&meshMulti->getMeshGeom (0);
00153
00154 <span class="comment">// Dynamic cast</span>
00155 <span class="keyword">const</span> CMeshGeom *geomMesh=dynamic_cast<const CMeshGeom*>(meshGeom);
00156 <span class="keywordflow">if</span> (geomMesh)
00157 {
00158 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (*geomMesh, modelMT, triangleArray, instanceId);
00159 }
00160
00161 <span class="comment">// Dynamic cast</span>
00162 <span class="keyword">const</span> CMeshMRMGeom *mrmGeomMesh=dynamic_cast<const CMeshMRMGeom*>(meshGeom);
00163 <span class="keywordflow">if</span> (mrmGeomMesh)
00164 {
00165 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (*mrmGeomMesh, modelMT, triangleArray, instanceId);
00166 }
00167 }
00168 <span class="comment">// It is a CMeshMultiLod ?</span>
00169 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (meshMRM)
00170 {
00171 <span class="comment">// Get the first lod mesh geom</span>
00172 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightere1">addTriangles</a> (meshMRM->getMeshGeom (), modelMT, triangleArray, instanceId);
00173 }
00174 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLightere1" doxytag="NL3D::CInstanceLighter::addTriangles" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::addTriangles </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02702.html">CLandscape</a> & </td>
<td class="mdname" nowrap> <em>landscape</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a04558.html#a15">uint</a> > & </td>
<td class="mdname" nowrap> <em>listZone</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>order</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td>
<td class="mdname" nowrap> <em>triangleArray</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l00077">77</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a06498.html#l00102">NL3D::CTessVertex::EndPos</a>, <a class="el" href="a05824.html#l00278">excludeAllPatchFromRefineAll()</a>, <a class="el" href="a05862.html#l02899">NL3D::CLandscape::getTessellationLeaves()</a>, <a class="el" href="a05862.html#l00737">NL3D::CLandscape::refineAll()</a>, <a class="el" href="a05862.html#l00318">NL3D::CLandscape::setThreshold()</a>, <a class="el" href="a05862.html#l00344">NL3D::CLandscape::setTileMaxSubdivision()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06498.html#l00241">NL3D::CTessFace::VBase</a>, <a class="el" href="a06498.html#l00241">NL3D::CTessFace::VLeft</a>, and <a class="el" href="a06498.html#l00241">NL3D::CTessFace::VRight</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00129">addTriangles()</a>.
<p>
<div class="fragment"><pre>00078 {
00079 <span class="comment">// Lamed from CZoneLighter.</span>
00080 <span class="comment">// Set all to refine</span>
00081 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterh2">excludeAllPatchFromRefineAll</a> (landscape, listZone, <span class="keyword">false</span>);
00082
00083 <span class="comment">// Setup the landscape</span>
00084 landscape.setThreshold (0);
00085 landscape.setTileMaxSubdivision (order);
00086
00087 <span class="comment">// Refine it</span>
00088 landscape.refineAll (CVector (0, 0, 0));
00089
00090 <span class="comment">// Dump tesselated triangles</span>
00091 std::vector<const CTessFace*> leaves;
00092 landscape.getTessellationLeaves(leaves);
00093
00094 <span class="comment">// Number of leaves</span>
00095 <a class="code" href="a04558.html#a15">uint</a> leavesCount=leaves.size();
00096
00097 <span class="comment">// Reserve the array</span>
00098 triangleArray.reserve (triangleArray.size()+leavesCount);
00099
00100 <span class="comment">// Scan each leaves</span>
00101 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> leave=0; leave<leavesCount; leave++)
00102 {
00103 <span class="comment">// Leave</span>
00104 <span class="keyword">const</span> CTessFace *face=leaves[leave];
00105
00106 <span class="comment">// Add a triangle. -1 because not an instance from an IG</span>
00107 triangleArray.push_back (<a class="code" href="a03616.html">CTriangle</a> (<a class="code" href="a03616.html">NLMISC::CTriangle</a> (face->VBase->EndPos, face->VLeft->EndPos, face->VRight->EndPos), -1 ));
00108 }
00109
00110 <span class="comment">// Setup the landscape</span>
00111 landscape.setThreshold (1000);
00112 landscape.setTileMaxSubdivision (0);
00113
00114 <span class="comment">// Remove all triangles</span>
00115 landscape.refineAll (CVector (0, 0, 0));
00116 landscape.refineAll (CVector (0, 0, 0));
00117 landscape.refineAll (CVector (0, 0, 0));
00118 landscape.refineAll (CVector (0, 0, 0));
00119 landscape.refineAll (CVector (0, 0, 0));
00120 landscape.refineAll (CVector (0, 0, 0));
00121 landscape.refineAll (CVector (0, 0, 0));
00122 landscape.refineAll (CVector (0, 0, 0));
00123 landscape.refineAll (CVector (0, 0, 0));
00124 landscape.refineAll (CVector (0, 0, 0));
00125
00126 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_0" doxytag="NL3D::CInstanceLighter::beginCell" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::beginCell </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01635">1635</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00214">_IGRetrieverGridMap</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00293">_IsEndCell</a>, <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00294">_ItCurrentCellNumber</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05825.html#l00296">_LastCellProgress</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05809.html#l00112">NL3D::CIGSurfaceLightBuild::RetrieverGridMap</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>.
<p>
<div class="fragment"><pre>01636 {
01637 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>)
01638 {
01639 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.begin();
01640 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a> != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.end() )
01641 {
01642 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.find(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->first);
01643 <a class="code" href="a04199.html#a6">nlassert</a>(_ItRetrieverInfo != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.end() );
01644 <span class="comment">// We are suze here that the retriever is not empty, and that the grid herself is not empty too</span>
01645 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>= 0;
01646 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>= 0;
01647 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_13">_ItCurrentCellNumber</a>= 0;
01648 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">false</span>;
01649 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_17">_LastCellProgress</a>= 0;
01650 }
01651 <span class="keywordflow">else</span>
01652 {
01653 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">true</span>;
01654 }
01655 }
01656 <span class="keywordflow">else</span>
01657 {
01658 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">true</span>;
01659 }
01660 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterd0" doxytag="NL3D::CInstanceLighter::compilePointLightRT" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::compilePointLightRT </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>gridSize</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>float </td>
<td class="mdname" nowrap> <em>gridCellSize</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td>
<td class="mdname" nowrap> <em>obstacles</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>doShadow</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Fill CubeGrid, and set PointLightRT in _StaticPointLightQuadGrid.
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01023">1023</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00255">_StaticPointLightQuadGrid</a>, <a class="el" href="a05825.html#l00253">_StaticPointLights</a>, <a class="el" href="a06300.html#l00641">NL3D::CQuadGrid< T >::begin()</a>, <a class="el" href="a05825.html#l00223">NL3D::CInstanceLighter::CPointLightRT::BSphere</a>, <a class="el" href="a05505.html#l00048">NLMISC::CBSphere::Center</a>, <a class="el" href="a02423.html#NL3D_1_1CCubeGrida1">NL3D::CCubeGrid< const CTriangle * >::compile()</a>, <a class="el" href="a02423.html#NL3D_1_1CCubeGrida2">NL3D::CCubeGrid< const CTriangle * >::create()</a>, <a class="el" href="a06300.html#l00433">NL3D::CQuadGrid< T >::create()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz772_1">NL3D::CQuadGrid< CPointLightRT * >::create()</a>, <a class="el" href="a06300.html#l00646">NL3D::CQuadGrid< T >::end()</a>, <a class="el" href="a05384.html#l00215">NLMISC::CAABBox::extend()</a>, <a class="el" href="a05825.html#l00226">NL3D::CInstanceLighter::CPointLightRT::FaceCubeGrid</a>, <a class="el" href="a06180.html#l00143">NL3D::CPointLight::getAttenuationEnd()</a>, <a class="el" href="a05385.html#l00087">NLMISC::CAABBox::getMax()</a>, <a class="el" href="a05385.html#l00086">NLMISC::CAABBox::getMin()</a>, <a class="el" href="a06180.html#l00116">NL3D::CPointLight::getPosition()</a>, <a class="el" href="a06179.html#l00138">NL3D::CPointLight::getType()</a>, <a class="el" href="a02423.html#NL3D_1_1CCubeGrida4">NL3D::CCubeGrid< const CTriangle * >::insert()</a>, <a class="el" href="a06300.html#l00516">NL3D::CQuadGrid< T >::insert()</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz774_2">NL3D::CQuadGrid< CPointLightRT * >::insert()</a>, <a class="el" href="a05824.html#l00044">NL3D_INSTANCE_LIGHTER_CUBE_GRID_SIZE</a>, <a class="el" href="a05825.html#l00220">NL3D::CInstanceLighter::CPointLightRT::PointLight</a>, <a class="el" href="a05825.html#l00159">progress()</a>, <a class="el" href="a05505.html#l00049">NLMISC::CBSphere::Radius</a>, <a class="el" href="a05825.html#l00228">NL3D::CInstanceLighter::CPointLightRT::RefCount</a>, <a class="el" href="a06300.html#l00613">NL3D::CQuadGrid< T >::select()</a>, <a class="el" href="a05385.html#l00066">NLMISC::CAABBox::setCenter()</a>, <a class="el" href="a05385.html#l00067">NLMISC::CAABBox::setHalfSize()</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a05825.html#l00106">NL3D::CInstanceLighter::CTriangle::Triangle</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00305">light()</a>.
<p>
<div class="fragment"><pre>01024 {
01025 <a class="code" href="a04558.html#a15">uint</a> i;
01026
01027 <span class="comment">// Fill the quadGrid of Lights.</span>
01028 <span class="comment">// ===========</span>
01029 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.create(gridSize, gridCellSize);
01030 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>.size();i++)
01031 {
01032 CPointLightRT &plRT= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>[i];
01033
01034 <span class="comment">// Compute the bbox of the light</span>
01035 CAABBox bbox;
01036 bbox.setCenter(plRT.BSphere.Center);
01037 <span class="keywordtype">float</span> hl= plRT.BSphere.Radius;
01038 bbox.setHalfSize(CVector(hl,hl,hl));
01039
01040 <span class="comment">// Insert the pointLight in the quadGrid.</span>
01041 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.insert(bbox.getMin(), bbox.getMax(), &plRT);
01042 }
01043
01044
01045 <span class="comment">// Append triangles to cubeGrid ??</span>
01046 <span class="keywordflow">if</span>(doShadow)
01047 {
01048 <span class="comment">// For all obstacles, Fill a quadGrid.</span>
01049 <span class="comment">// ===========</span>
01050 CQuadGrid<CTriangle*> obstacleGrid;
01051 obstacleGrid.create(gridSize, gridCellSize);
01052 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a587">size</a>= obstacles.size();
01053 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a04223.html#a587">size</a>; i++)
01054 {
01055 <span class="comment">// bbox of triangle</span>
01056 CAABBox bbox;
01057 bbox.setCenter(obstacles[i].Triangle.V0);
01058 bbox.extend(obstacles[i].Triangle.V1);
01059 bbox.extend(obstacles[i].Triangle.V2);
01060 <span class="comment">// insert triangle in quadGrid.</span>
01061 obstacleGrid.insert(bbox.getMin(), bbox.getMax(), &obstacles[i]);
01062 }
01063
01064
01065 <span class="comment">// For all PointLights, fill his CubeGrid</span>
01066 <span class="comment">// ===========</span>
01067 <span class="keywordflow">for</span>(i=0; i<_StaticPointLights.size();i++)
01068 {
01069 <span class="comment">// progress</span>
01070 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute Influences of PointLights 1/2"</span>, i / (<span class="keywordtype">float</span>)_StaticPointLights.size());
01071
01072 CPointLightRT &plRT= _StaticPointLights[i];
01073 <span class="comment">// Create the cubeGrid</span>
01074 plRT.FaceCubeGrid.create(plRT.PointLight.getPosition(), <a class="code" href="a04401.html#a0">NL3D_INSTANCE_LIGHTER_CUBE_GRID_SIZE</a>);
01075
01076 <span class="comment">// AmbiantLIghts: do nothing.</span>
01077 <span class="keywordflow">if</span>(plRT.PointLight.getType()!=CPointLight::AmbientLight)
01078 {
01079 <span class="comment">// Select only obstacle Faces around the light. Other are not usefull</span>
01080 CAABBox bbox;
01081 bbox.setCenter(plRT.PointLight.getPosition());
01082 <span class="keywordtype">float</span> hl= plRT.PointLight.getAttenuationEnd();
01083 bbox.setHalfSize(CVector(hl,hl,hl));
01084 obstacleGrid.select(bbox.getMin(), bbox.getMax());
01085
01086 <span class="comment">// For all faces, fill the cubeGrid.</span>
01087 CQuadGrid<CTriangle*>::CIterator itObstacle;
01088 itObstacle= obstacleGrid.begin();
01089 <span class="keywordflow">while</span>( itObstacle!=obstacleGrid.end() )
01090 {
01091 <a class="code" href="a03616.html">CTriangle</a> &tri= *(*itObstacle);
01092 <span class="comment">/* Don't Test BackFace culling Here (unlike in CZoneLighter !!).</span>
01093 <span class="comment"> For objects:</span>
01094 <span class="comment"> AutoOccluding problem is avoided with _CurrentInstanceComputed scheme.</span>
01095 <span class="comment"> Also, With pointLights, there is no multiSampling (since no factor stored)</span>
01096 <span class="comment"> Hence we are sure that no Object samples will lies under floor, and that the center of the </span>
01097 <span class="comment"> object is far away.</span>
01098 <span class="comment"> For IGSurface lighting:</span>
01099 <span class="comment"> notice that we already add 20cm in height because of "stairs problem" so</span>
01100 <span class="comment"> floor/surface auto_shadowing is not a problem here...</span>
01101 <span class="comment"> */</span>
01102 <span class="comment">// Insert the triangle in the CubeGrid</span>
01103 plRT.FaceCubeGrid.insert( tri.Triangle, &tri);
01104
01105 itObstacle++;
01106 }
01107 }
01108
01109 <span class="comment">// Compile the CubeGrid.</span>
01110 plRT.FaceCubeGrid.compile();
01111
01112 <span class="comment">// And Reset RefCount.</span>
01113 plRT.RefCount= 0;
01114 }
01115 }
01116 <span class="comment">// else, just build empty grid</span>
01117 <span class="keywordflow">else</span>
01118 {
01119 <span class="keywordflow">for</span>(i=0; i<_StaticPointLights.size();i++)
01120 {
01121 <span class="comment">// progress</span>
01122 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute Influences of PointLights 1/2"</span>, i / (<span class="keywordtype">float</span>)_StaticPointLights.size());
01123
01124 CPointLightRT &plRT= _StaticPointLights[i];
01125 <span class="comment">// Create a dummy empty cubeGrid => no rayTrace :)</span>
01126 plRT.FaceCubeGrid.create(plRT.PointLight.getPosition(), 4);
01127
01128 <span class="comment">// Compile the CubeGrid.</span>
01129 plRT.FaceCubeGrid.compile();
01130
01131 <span class="comment">// And Reset RefCount.</span>
01132 plRT.RefCount= 0;
01133 }
01134 }
01135
01136 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterd1" doxytag="NL3D::CInstanceLighter::computeSunContribution" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::computeSunContribution </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a02677.html">CLightDesc</a> & </td>
<td class="mdname" nowrap> <em>lightDesc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td>
<td class="mdname" nowrap> <em>obstacles</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a02702.html">CLandscape</a> * </td>
<td class="mdname" nowrap> <em>landscape</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l00633">633</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00210">_CurrentInstanceComputed</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00208">_InstanceInfos</a>, <a class="el" href="a06300.html#l00641">NL3D::CQuadGrid< T >::begin()</a>, <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a06300.html#l00428">NL3D::CQuadGrid< T >::changeBase()</a>, <a class="el" href="a06300.html#l00433">NL3D::CQuadGrid< T >::create()</a>, <a class="el" href="a06729.html#l00082">NL3D::CVisualCollisionManager::createEntity()</a>, <a class="el" href="a06729.html#l00089">NL3D::CVisualCollisionManager::deleteEntity()</a>, <a class="el" href="a05825.html#l00071">NL3D::CInstanceLighter::CLightDesc::DisableSunContribution</a>, <a class="el" href="a06300.html#l00646">NL3D::CQuadGrid< T >::end()</a>, <a class="el" href="a05384.html#l00215">NLMISC::CAABBox::extend()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05385.html#l00087">NLMISC::CAABBox::getMax()</a>, <a class="el" href="a05385.html#l00086">NLMISC::CAABBox::getMin()</a>, <a class="el" href="a06725.html#l00527">NL3D::CVisualCollisionEntity::getStaticLightSetup()</a>, <a class="el" href="a05825.html#l00080">NL3D::CInstanceLighter::CLightDesc::GridCellSize</a>, <a class="el" href="a05825.html#l00077">NL3D::CInstanceLighter::CLightDesc::GridSize</a>, <a class="el" href="a06300.html#l00516">NL3D::CQuadGrid< T >::insert()</a>, <a class="el" href="a05825.html#l00109">NL3D::CInstanceLighter::CTriangle::InstanceId</a>, <a class="el" href="a05809.html#l00059">NL3D::CIGSurfaceLightBuild::CCellCorner::InSurface</a>, <a class="el" href="a03616.html#NLMISC_1_1CTriangleUVa2">NLMISC::CTriangle::intersect()</a>, <a class="el" href="a05972.html#l01090">NLMISC::CMatrix::inverted()</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a05825.html#l00074">NL3D::CInstanceLighter::CLightDesc::LightDirection</a>, <a class="el" href="a05824.html#l00617">NL3D::NEL3DCalcBase()</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06682.html#l00119">NLMISC::CVector::normalize()</a>, <a class="el" href="a05809.html#l00065">NL3D::CIGSurfaceLightBuild::CCellCorner::NumOverSamples</a>, <a class="el" href="a05809.html#l00072">NL3D::CIGSurfaceLightBuild::CCellCorner::OverSamples</a>, <a class="el" href="a05825.html#l00086">NL3D::CInstanceLighter::CLightDesc::OverSampling</a>, <a class="el" href="a05825.html#l00115">NL3D::CInstanceLighter::CTriangle::Plane</a>, <a class="el" href="a05825.html#l00159">progress()</a>, <a class="el" href="a05824.html#l01623">progressCell()</a>, <a class="el" href="a06300.html#l00613">NL3D::CQuadGrid< T >::select()</a>, <a class="el" href="a05385.html#l00066">NLMISC::CAABBox::setCenter()</a>, <a class="el" href="a06729.html#l00075">NL3D::CVisualCollisionManager::setLandscape()</a>, <a class="el" href="a05825.html#l00083">NL3D::CInstanceLighter::CLightDesc::Shadow</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05809.html#l00063">NL3D::CIGSurfaceLightBuild::CCellCorner::SunContribution</a>, <a class="el" href="a06476.html#l00068">NL3D::CSurfaceLightGrid::CCellCorner::SunContribution</a>, <a class="el" href="a05825.html#l00106">NL3D::CInstanceLighter::CTriangle::Triangle</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00096">uint8</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00305">light()</a>.
<p>
<div class="fragment"><pre>00634 {
00635 <a class="code" href="a04558.html#a14">sint</a> i;
00636 <span class="comment">// Use precoputed landscape SunContribution</span>
00637 CVisualCollisionManager *VCM= NULL;
00638 CVisualCollisionEntity *VCE= NULL;
00639 <span class="keywordflow">if</span>(landscape)
00640 {
00641 <span class="comment">// create a CVisualCollisionManager and a CVisualCollisionEntity</span>
00642 VCM= <span class="keyword">new</span> CVisualCollisionManager;
00643 VCM->setLandscape(landscape);
00644 VCE= VCM->createEntity();
00645 }
00646 std::vector<CPointLightInfluence> dummyPointLightFromLandscape;
00647 dummyPointLightFromLandscape.reserve(1024);
00648
00649
00650 <span class="comment">// If DisableSunContribution, easy, </span>
00651 <span class="keywordflow">if</span>(lightDesc.DisableSunContribution)
00652 {
00653 <span class="comment">// Light all instances.</span>
00654 <span class="comment">//==========</span>
00655 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size(); i++)
00656 {
00657 <span class="comment">// If staticLight not enabled, skip.</span>
00658 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled )
00659 <span class="keywordflow">continue</span>;
00660
00661 <span class="comment">// fill SunContribution to 0</span>
00662 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= 0;
00663 }
00664
00665 <span class="comment">// Light SurfaceGrid Cells.</span>
00666 <span class="comment">//==========</span>
00667 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>)
00668 {
00669 <span class="comment">// Begin cell iteration</span>
00670 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>();
00671 <span class="comment">// For all surface cell corners</span>
00672 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() )
00673 {
00674 <span class="comment">// get the current cell and cellInfo iterated.</span>
00675 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>();
00676 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>();
00677
00678 <span class="comment">// if the cell corner lies in the polygon surface.</span>
00679 <span class="keywordflow">if</span>(cellInfo.InSurface)
00680 {
00681 <span class="comment">// fill SunContribution to 0</span>
00682 cell.SunContribution= 0;
00683 <span class="comment">// copy it to cellInfo</span>
00684 cellInfo.SunContribution= cell.SunContribution;
00685 }
00686
00687 <span class="comment">// next cell</span>
00688 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>();
00689 }
00690 }
00691 }
00692 <span class="comment">// If no Raytrace Shadow, easy, </span>
00693 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(!lightDesc.Shadow)
00694 {
00695 <span class="comment">// Light all instances.</span>
00696 <span class="comment">//==========</span>
00697 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size(); i++)
00698 {
00699 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute SunContribution on Instances"</span>, i / <span class="keywordtype">float</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size()) );
00700
00701 <span class="comment">// If staticLight not enabled, skip.</span>
00702 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled )
00703 <span class="keywordflow">continue</span>;
00704
00705 <span class="comment">// by default, fill SunContribution to 255</span>
00706 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= 255;
00707 <span class="comment">// Try to get landscape SunContribution (better)</span>
00708 <span class="keywordflow">if</span>(landscape)
00709 {
00710 CVector pos= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].CenterPos;
00711 <a class="code" href="a04558.html#a7">uint8</a> landSunContribution;
00712 dummyPointLightFromLandscape.clear();
00713 <span class="comment">// If find faces under me</span>
00714 <a class="code" href="a03337.html">NLMISC::CRGBA</a> dummyAmbient;
00715 <span class="keywordflow">if</span>(VCE->getStaticLightSetup(pos, dummyPointLightFromLandscape, landSunContribution, dummyAmbient) )
00716 {
00717 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= landSunContribution;
00718 }
00719 }
00720 }
00721
00722 <span class="comment">// Light SurfaceGrid Cells.</span>
00723 <span class="comment">//==========</span>
00724 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>)
00725 {
00726 <span class="comment">// Begin cell iteration</span>
00727 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>();
00728 <span class="comment">// For all surface cell corners</span>
00729 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() )
00730 {
00731 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a>(<span class="stringliteral">"Compute SunContribution on Surfaces"</span>);
00732
00733 <span class="comment">// get the current cell and cellInfo iterated.</span>
00734 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>();
00735 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>();
00736
00737 <span class="comment">// if the cell corner lies in the polygon surface.</span>
00738 <span class="keywordflow">if</span>(cellInfo.InSurface)
00739 {
00740 <span class="comment">// Just init SunContribution to 255, since no shadowing.</span>
00741 cell.SunContribution= 255;
00742 <span class="comment">// copy it to cellInfo</span>
00743 cellInfo.SunContribution= cell.SunContribution;
00744 }
00745
00746 <span class="comment">// next cell</span>
00747 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>();
00748 }
00749 }
00750 }
00751 <span class="keywordflow">else</span>
00752 {
00753 <span class="comment">// Compute rayBasis</span>
00754 CVector rayDir= lightDesc.LightDirection;
00755 CMatrix rayBasis;
00756 rayDir.normalize();
00757 <a class="code" href="a05363.html#a423">NEL3DCalcBase</a>(rayDir, rayBasis);
00758 CMatrix invRayBasis;
00759 invRayBasis= rayBasis.inverted();
00760
00761 <span class="comment">// Build QuadGrid of obstacles.</span>
00762 <span class="comment">//=========</span>
00763 <span class="comment">// setup quadGrid</span>
00764 CQuadGrid<const CTriangle*> quadGrid;
00765 quadGrid.changeBase (invRayBasis);
00766 quadGrid.create(lightDesc.GridSize, lightDesc.GridCellSize);
00767 <span class="comment">// Insert all obstacles in quadGrid</span>
00768 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)obstacles.size(); i++)
00769 {
00770 CAABBox triBBox;
00771 <span class="comment">// Compute the bbox in rayBasis.</span>
00772 triBBox.setCenter(invRayBasis * obstacles[i].Triangle.V0);
00773 triBBox.extend(invRayBasis * obstacles[i].Triangle.V1);
00774 triBBox.extend(invRayBasis * obstacles[i].Triangle.V2);
00775 <span class="comment">// And set the coord in our world, because will be multiplied with invRayBasis in insert()</span>
00776 quadGrid.insert(rayBasis * triBBox.getMin(), rayBasis * triBBox.getMax(), &obstacles[i]);
00777 }
00778
00779 <span class="comment">// For all instances, light them.</span>
00780 <span class="comment">//=========</span>
00781 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size(); i++)
00782 {
00783 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute SunContribution on Instances"</span>, i / <span class="keywordtype">float</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size()) );
00784
00785 <span class="comment">// If staticLight not enabled, skip.</span>
00786 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled )
00787 <span class="keywordflow">continue</span>;
00788
00789 <span class="comment">// try to use landscape SunContribution.</span>
00790 <span class="keywordtype">bool</span> landUsed= <span class="keyword">false</span>;
00791 <span class="keywordflow">if</span>(landscape)
00792 {
00793 CVector pos= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].CenterPos;
00794 <a class="code" href="a04558.html#a7">uint8</a> landSunContribution;
00795 dummyPointLightFromLandscape.clear();
00796 <span class="comment">// If find faces under me</span>
00797 <a class="code" href="a03337.html">NLMISC::CRGBA</a> dummyAmbient;
00798 <span class="keywordflow">if</span>(VCE->getStaticLightSetup(pos, dummyPointLightFromLandscape, landSunContribution, dummyAmbient) )
00799 {
00800 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= landSunContribution;
00801 landUsed= <span class="keyword">true</span>;
00802 }
00803 }
00804
00805 <span class="comment">// If failed to use landscape SunContribution, rayTrace</span>
00806 <span class="keywordflow">if</span>(!landUsed)
00807 {
00808 <span class="comment">// number of samples (1 if no overSampling)</span>
00809 <a class="code" href="a04558.html#a15">uint</a> nSamples= max(1U, lightDesc.OverSampling);
00810
00811 <span class="comment">// Default is full lighted.</span>
00812 <a class="code" href="a04558.html#a15">uint</a> sunAccum= 255*nSamples;
00813
00814 <span class="comment">// For all samples</span>
00815 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> sample=0; sample<nSamples; sample++)
00816 {
00817 <span class="comment">// pos to rayTrace against</span>
00818 CVector pos= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].OverSamples[sample];
00819
00820 <span class="comment">// rayTrace from this pos.</span>
00821 CVector lightPos= pos-(rayDir*1000.f);
00822 <span class="comment">// Select an element with the X axis as a 3d ray</span>
00823 quadGrid.select (lightPos, lightPos);
00824 <span class="comment">// For each triangle selected</span>
00825 CQuadGrid<const CTriangle*>::CIterator it=quadGrid.begin();
00826 <span class="keywordflow">while</span> (it!=quadGrid.end())
00827 {
00828 <span class="keyword">const</span> <a class="code" href="a03616.html">CTriangle</a> *tri= *it;
00829
00830 <span class="comment">// If same instanceId, skip</span>
00831 <span class="keywordflow">if</span>(tri->InstanceId != i)
00832 {
00833 CVector hit;
00834 <span class="comment">// If triangle occlude the ray, no sun Contribution</span>
00835 <span class="keywordflow">if</span>(tri->Triangle.<a class="code" href="a03616.html#NLMISC_1_1CTriangleUVa2">intersect</a>(lightPos, pos, hit, tri->Plane))
00836 {
00837 <span class="comment">// The sample is not touched by sun. sub his contribution</span>
00838 sunAccum-= 255;
00839 <span class="comment">// End</span>
00840 <span class="keywordflow">break</span>;
00841 }
00842 }
00843
00844 it++;
00845 }
00846 }
00847
00848 <span class="comment">// Average samples</span>
00849 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].SunContribution= sunAccum / nSamples;
00850 }
00851
00852 }
00853
00854
00855 <span class="comment">// Light SurfaceGrid Cells.</span>
00856 <span class="comment">//==========</span>
00857 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>)
00858 {
00859 <span class="comment">// No instance currenlty computed, since we compute surface cells.</span>
00860 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr0">_CurrentInstanceComputed</a>= -1;
00861
00862 <span class="comment">// Begin cell iteration</span>
00863 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>();
00864 <span class="comment">// For all surface cell corners</span>
00865 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() )
00866 {
00867 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a>(<span class="stringliteral">"Compute SunContribution on Surfaces"</span>);
00868
00869 <span class="comment">// get the current cell and cellInfo iterated.</span>
00870 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>();
00871 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>();
00872
00873 <span class="comment">// if the cell corner lies in the polygon surface.</span>
00874 <span class="keywordflow">if</span>(cellInfo.InSurface)
00875 {
00876 <span class="comment">// number of samples (at least 1 if no overSampling)</span>
00877 <a class="code" href="a04558.html#a15">uint</a> nSamples= cellInfo.NumOverSamples;
00878 <a class="code" href="a04199.html#a6">nlassert</a>(nSamples>=1);
00879
00880 <span class="comment">// Default is full lighted.</span>
00881 <a class="code" href="a04558.html#a15">uint</a> sunAccum= 255*nSamples;
00882
00883 <span class="comment">// For all samples</span>
00884 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> sample=0; sample<nSamples; sample++)
00885 {
00886 <span class="comment">// Get pos to rayTrace.</span>
00887 CVector pos= cellInfo.OverSamples[sample];
00888
00889 <span class="comment">// rayTrace from the pos of this Cell sample.</span>
00890 CVector lightPos= pos-(rayDir*1000.f);
00891 <span class="comment">// Select an element with the X axis as a 3d ray</span>
00892 quadGrid.select (lightPos, lightPos);
00893 <span class="comment">// For each triangle selected</span>
00894 CQuadGrid<const CTriangle*>::CIterator it=quadGrid.begin();
00895 <span class="keywordflow">while</span> (it!=quadGrid.end())
00896 {
00897 <span class="keyword">const</span> <a class="code" href="a03616.html">CTriangle</a> *tri= *it;
00898
00899 CVector hit;
00900 <span class="comment">// If triangle occlude the ray, no sun Contribution</span>
00901 <span class="keywordflow">if</span>(tri->Triangle.<a class="code" href="a03616.html#NLMISC_1_1CTriangleUVa2">intersect</a>(lightPos, pos, hit, tri->Plane))
00902 {
00903 <span class="comment">// The cell sample is not touched by sun. sub his contribution</span>
00904 sunAccum-= 255;
00905 <span class="comment">// End</span>
00906 <span class="keywordflow">break</span>;
00907 }
00908
00909 it++;
00910 }
00911 }
00912
00913 <span class="comment">// Average SunContribution</span>
00914 cell.SunContribution= sunAccum / nSamples;
00915
00916 <span class="comment">// copy it to cellInfo</span>
00917 cellInfo.SunContribution= cell.SunContribution;
00918 }
00919
00920 <span class="comment">// next cell</span>
00921 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>();
00922 }
00923 }
00924 }
00925
00926
00927 <span class="comment">// Clean VCM and VCE</span>
00928 <span class="keywordflow">if</span>(landscape)
00929 {
00930 <span class="comment">// delete CVisualCollisionManager and CVisualCollisionEntity</span>
00931 VCM->deleteEntity(VCE);
00932 <span class="keyword">delete</span> VCM;
00933 }
00934
00935 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterd2" doxytag="NL3D::CInstanceLighter::dilateLightingOnSurfaceCells" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::dilateLightingOnSurfaceCells </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01801">1801</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05809.html#l00068">NL3D::CIGSurfaceLightBuild::CCellCorner::CenterPos</a>, <a class="el" href="a05809.html#l00061">NL3D::CIGSurfaceLightBuild::CCellCorner::Dilated</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>, <a class="el" href="a05809.html#l00059">NL3D::CIGSurfaceLightBuild::CCellCorner::InSurface</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a06476.html#l00070">NL3D::CSurfaceLightGrid::CCellCorner::Light</a>, <a class="el" href="a06476.html#l00074">NL3D::CSurfaceLightGrid::CCellCorner::LocalAmbientId</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, <a class="el" href="a05824.html#l01623">progressCell()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05809.html#l00063">NL3D::CIGSurfaceLightBuild::CCellCorner::SunContribution</a>, <a class="el" href="a06476.html#l00068">NL3D::CSurfaceLightGrid::CCellCorner::SunContribution</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00305">light()</a>.
<p>
<div class="fragment"><pre>01802 {
01803 <span class="comment">// Begin cell iteration</span>
01804 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>();
01805 <span class="comment">// For all surface cell corners</span>
01806 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() )
01807 {
01808 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a>(<span class="stringliteral">"Dilate Surfaces grids"</span>);
01809
01810 <span class="comment">// get the current cell and cellInfo iterated.</span>
01811 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>();
01812 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>();
01813
01814 <span class="comment">// if the cell is not in the polygon surface, try to get from his neighbors.</span>
01815 <span class="keywordflow">if</span>(!cellInfo.InSurface)
01816 {
01817 <span class="comment">// Add Weighted influence of SunContribution, and get one of the PointLightContribution (random).</span>
01818 <a class="code" href="a04558.html#a15">uint</a> wgtSunContribution= 0;
01819 <a class="code" href="a04558.html#a15">uint</a> wgtSunCount= 0;
01820 <span class="comment">// search if one of 8 neighbors is InSurface.</span>
01821 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a14">sint</a> ynb= -1; ynb<= 1; ynb++)
01822 {
01823 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a14">sint</a> xnb= -1; xnb<= 1; xnb++)
01824 {
01825 <span class="comment">// center => skip.</span>
01826 <span class="keywordflow">if</span>( xnb==0 && ynb==0 )
01827 <span class="keywordflow">continue</span>;
01828 <span class="comment">// If the neighbor point is not out of the grid, and if in Surface.</span>
01829 <span class="keywordflow">if</span>( <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_7">isCurrentNeighborCellInSurface</a>(xnb, ynb) )
01830 {
01831 <span class="comment">// get the neighbor cell</span>
01832 CIGSurfaceLightBuild::CCellCorner &nbCellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_5">getCurrentNeighborCellInfo</a>(xnb, ynb);
01833 CSurfaceLightGrid::CCellCorner &nbCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_4">getCurrentNeighborCell</a>(xnb, ynb);
01834 <span class="comment">// Add SunContribution.</span>
01835 wgtSunContribution+= nbCell.SunContribution;
01836 wgtSunCount++;
01837 <span class="comment">// Just Copy PointLight info.</span>
01838 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> lightId= 0; lightId<CSurfaceLightGrid::NumLightPerCorner; lightId++)
01839 cell.Light[lightId]= nbCell.Light[lightId];
01840 <span class="comment">// Just Copy AmbientLight info.</span>
01841 cell.LocalAmbientId= nbCell.LocalAmbientId;
01842
01843
01844 <span class="comment">// For debug mesh only, copy z from nb cellInfo</span>
01845 cellInfo.CenterPos.z= nbCellInfo.CenterPos.z;
01846 }
01847 }
01848 }
01849 <span class="comment">// average SunContribution.</span>
01850 <span class="keywordflow">if</span>(wgtSunCount>0)
01851 {
01852 cell.SunContribution= wgtSunContribution / wgtSunCount;
01853
01854 <span class="comment">// For debug mesh only, copy SunContribution into cellInfo</span>
01855 cellInfo.SunContribution= cell.SunContribution;
01856 cellInfo.Dilated= <span class="keyword">true</span>;
01857 }
01858 }
01859
01860 <span class="comment">// next cell</span>
01861 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>();
01862 }
01863 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterh2" doxytag="NL3D::CInstanceLighter::excludeAllPatchFromRefineAll" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::excludeAllPatchFromRefineAll </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02702.html">CLandscape</a> & </td>
<td class="mdname" nowrap> <em>landscape</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a04558.html#a15">uint</a> > & </td>
<td class="mdname" nowrap> <em>listZone</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>exclude</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static, private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l00278">278</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05862.html#l00760">NL3D::CLandscape::excludePatchFromRefineAll()</a>, <a class="el" href="a06760.html#l00489">NL3D::CZone::getNumPatchs()</a>, <a class="el" href="a05862.html#l02206">NL3D::CLandscape::getZone()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00077">addTriangles()</a>.
<p>
<div class="fragment"><pre>00279 {
00280 <span class="comment">// For each zone</span>
00281 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> zone=0; zone<listZone.size(); zone++)
00282 {
00283 <span class="comment">// Get num patches</span>
00284 <a class="code" href="a04558.html#a15">uint</a> patchCount=landscape.getZone(listZone[zone])->getNumPatchs();
00285
00286 <span class="comment">// For each patches</span>
00287 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> patch=0; patch<patchCount; patch++)
00288 {
00289 <span class="comment">// Exclude all the patches from refine all</span>
00290 landscape.excludePatchFromRefineAll (listZone[zone], patch, exclude);
00291 }
00292 }
00293 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_1" doxytag="NL3D::CInstanceLighter::getCurrentCell" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a03465.html">CSurfaceLightGrid::CCellCorner</a> & NL3D::CInstanceLighter::getCurrentCell </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01705">1705</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>.
<p>
<div class="fragment"><pre>01706 {
01707 <a class="code" href="a04199.html#a6">nlassert</a>(!<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>());
01708
01709 <span class="comment">// return ref on Cell.</span>
01710 <span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>].Cells[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>];
01711 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_2" doxytag="NL3D::CInstanceLighter::getCurrentCellInfo" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02657.html">CIGSurfaceLightBuild::CCellCorner</a> & NL3D::CInstanceLighter::getCurrentCellInfo </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01714">1714</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>.
<p>
<div class="fragment"><pre>01715 {
01716 <a class="code" href="a04199.html#a6">nlassert</a>(!<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>());
01717
01718 <span class="comment">// return ref on CellInfo.</span>
01719 <span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>].Cells[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>];
01720 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_3" doxytag="NL3D::CInstanceLighter::getCurrentCellNumber" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NL3D::CInstanceLighter::getCurrentCellNumber </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00284">284</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
References <a class="el" href="a05825.html#l00294">_ItCurrentCellNumber</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01623">progressCell()</a>.
<p>
<div class="fragment"><pre>00284 {<span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_13">_ItCurrentCellNumber</a>;}
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_4" doxytag="NL3D::CInstanceLighter::getCurrentNeighborCell" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a03465.html">CSurfaceLightGrid::CCellCorner</a> & NL3D::CInstanceLighter::getCurrentNeighborCell </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td>
<td class="mdname" nowrap> <em>xnb</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td>
<td class="mdname" nowrap> <em>ynb</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01757">1757</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a06476.html#l00101">NL3D::CSurfaceLightGrid::Cells</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06476.html#l00099">NL3D::CSurfaceLightGrid::Width</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>.
<p>
<div class="fragment"><pre>01758 {
01759 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_7">isCurrentNeighborCellInSurface</a>(xnb, ynb));
01760
01761 <span class="comment">// get a ref on the current grid.</span>
01762 CSurfaceLightGrid &surfGrid= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>];
01763 <span class="comment">// copute coordinate of the current cellCorner.</span>
01764 <a class="code" href="a04558.html#a14">sint</a> xCell, yCell;
01765 xCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>%surfGrid.Width;
01766 yCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>/surfGrid.Width;
01767 <span class="comment">// compute coordinate of the neighbor cell corner</span>
01768 xCell+= xnb;
01769 yCell+= ynb;
01770 <span class="comment">// compute the neighbor id</span>
01771 <a class="code" href="a04558.html#a15">uint</a> nbId= yCell*surfGrid.Width + xCell;
01772
01773 <span class="comment">// then return a ref on it</span>
01774 <span class="keywordflow">return</span> surfGrid.Cells[nbId];
01775 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_5" doxytag="NL3D::CInstanceLighter::getCurrentNeighborCellInfo" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02657.html">CIGSurfaceLightBuild::CCellCorner</a> & NL3D::CInstanceLighter::getCurrentNeighborCellInfo </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td>
<td class="mdname" nowrap> <em>xnb</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td>
<td class="mdname" nowrap> <em>ynb</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01779">1779</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05809.html#l00093">NL3D::CIGSurfaceLightBuild::CSurface::Cells</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05809.html#l00090">NL3D::CIGSurfaceLightBuild::CSurface::Width</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>.
<p>
<div class="fragment"><pre>01780 {
01781 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_7">isCurrentNeighborCellInSurface</a>(xnb, ynb));
01782
01783 <span class="comment">// get a ref on the current grid.</span>
01784 CIGSurfaceLightBuild::CSurface &surfGrid= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>];
01785 <span class="comment">// copute coordinate of the current cellCorner.</span>
01786 <a class="code" href="a04558.html#a14">sint</a> xCell, yCell;
01787 xCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>%surfGrid.Width;
01788 yCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>/surfGrid.Width;
01789 <span class="comment">// compute coordinate of the neighbor cell corner</span>
01790 xCell+= xnb;
01791 yCell+= ynb;
01792 <span class="comment">// compute the neighbor id</span>
01793 <a class="code" href="a04558.html#a15">uint</a> nbId= yCell*surfGrid.Width + xCell;
01794
01795 <span class="comment">// then return a ref on it</span>
01796 <span class="keywordflow">return</span> surfGrid.Cells[nbId];
01797 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_6" doxytag="NL3D::CInstanceLighter::getTotalCellNumber" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> NL3D::CInstanceLighter::getTotalCellNumber </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [inline, private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00285">285</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
References <a class="el" href="a05825.html#l00295">_TotalCellNumber</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01623">progressCell()</a>.
<p>
<div class="fragment"><pre>00285 {<span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_18">_TotalCellNumber</a>;}
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLightera1" doxytag="NL3D::CInstanceLighter::init" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::init </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l00072">72</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01502">lightIgSimple()</a>.
<p>
<div class="fragment"><pre>00073 {
00074 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_7" doxytag="NL3D::CInstanceLighter::isCurrentNeighborCellInSurface" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NL3D::CInstanceLighter::isCurrentNeighborCellInSurface </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td>
<td class="mdname" nowrap> <em>xnb</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td>
<td class="mdname" nowrap> <em>ynb</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01724">1724</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a06476.html#l00100">NL3D::CSurfaceLightGrid::Height</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06476.html#l00099">NL3D::CSurfaceLightGrid::Width</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, and <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>.
<p>
<div class="fragment"><pre>01725 {
01726 <a class="code" href="a04199.html#a6">nlassert</a>(!<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>());
01727
01728 <span class="comment">// get a ref on the current grid.</span>
01729 CSurfaceLightGrid &surfGrid= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>];
01730 <span class="comment">// copute coordinate of the current cellCorner.</span>
01731 <a class="code" href="a04558.html#a14">sint</a> xCell, yCell;
01732 xCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>%surfGrid.Width;
01733 yCell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>/surfGrid.Width;
01734 <span class="comment">// compute coordinate of the neighbor cell corner</span>
01735 xCell+= xnb;
01736 yCell+= ynb;
01737
01738 <span class="comment">// check if in the surfaceGrid</span>
01739 <span class="keywordflow">if</span>(xCell<0 || xCell>=(<a class="code" href="a04558.html#a14">sint</a>)surfGrid.Width)
01740 <span class="keywordflow">return</span> <span class="keyword">false</span>;
01741 <span class="keywordflow">if</span>(yCell<0 || yCell>=(<a class="code" href="a04558.html#a14">sint</a>)surfGrid.Height)
01742 <span class="keywordflow">return</span> <span class="keyword">false</span>;
01743
01744 <span class="comment">// compute the neighbor id</span>
01745 <a class="code" href="a04558.html#a15">uint</a> nbId= yCell*surfGrid.Width + xCell;
01746
01747 <span class="comment">// Now check in the cellInfo if this cell is InSurface.</span>
01748 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>].Cells[nbId].InSurface )
01749 <span class="keywordflow">return</span> <span class="keyword">false</span>;
01750
01751 <span class="comment">// Ok, the neighbor cell is valid.</span>
01752
01753 <span class="keywordflow">return</span> <span class="keyword">true</span>;
01754 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_8" doxytag="NL3D::CInstanceLighter::isEndCell" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool NL3D::CInstanceLighter::isEndCell </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01699">1699</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00293">_IsEndCell</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>.
<p>
<div class="fragment"><pre>01700 {
01701 <span class="keywordflow">return</span> <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>;
01702 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLightera2" doxytag="NL3D::CInstanceLighter::light" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::light </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a02671.html">CInstanceGroup</a> & </td>
<td class="mdname" nowrap> <em>igIn</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a02671.html">CInstanceGroup</a> & </td>
<td class="mdname" nowrap> <em>igOut</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="a02677.html">CLightDesc</a> & </td>
<td class="mdname" nowrap> <em>lightDesc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a02680.html">CTriangle</a> > & </td>
<td class="mdname" nowrap> <em>obstacles</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a02702.html">CLandscape</a> * </td>
<td class="mdname" nowrap> <em>landscape</em> = NULL, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a02656.html">CIGSurfaceLightBuild</a> * </td>
<td class="mdname" nowrap> <em>igSurfaceLightBuild</em> = NULL</td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Light an InstanceGroup igOut has different PointLights than igIn. eg: if a pointLight do not light anything, then it is not present in igOut. NB: shapes are used to retrieve usefull info on them (center of AABBox ...) . They are taken from lightDesc.UserShapeMap, or loaded from lightDesc.ShapePath if not found. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>landscape</em> </td><td>if !NULL use this Landscape SunContribution, looking landscape faces under each instance, for faster computing, and to get influence of Sky. NB: this landscape does not have to be tesselated, but all Zones that lies under igIn should be loaded in. </td></tr>
<tr><td valign=top><em>igSurfaceLightBuild</em> </td><td>if !NULL, <a class="el" href="a02675.html#NL3D_1_1CInstanceLightera2">light()</a> will compute igOut.IGSurfaceLight, else it is just cleared.</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="a05824.html#l00305">305</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00214">_IGRetrieverGridMap</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00208">_InstanceInfos</a>, <a class="el" href="a05825.html#l00293">_IsEndCell</a>, <a class="el" href="a05825.html#l00295">_TotalCellNumber</a>, <a class="el" href="a06350.html#l00342">NL3D::CInstanceGroup::build()</a>, <a class="el" href="a05809.html#l00093">NL3D::CIGSurfaceLightBuild::CSurface::Cells</a>, <a class="el" href="a06476.html#l00101">NL3D::CSurfaceLightGrid::Cells</a>, <a class="el" href="a05809.html#l00110">NL3D::CIGSurfaceLightBuild::CellSize</a>, <a class="el" href="a05824.html#l01023">compilePointLightRT()</a>, <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, <a class="el" href="a06116.html#l00231">NLMISC::CObjectVector< CCellCorner >::fill()</a>, <a class="el" href="a05385.html#l00090">NLMISC::CAABBox::getCenter()</a>, <a class="el" href="a05385.html#l00091">NLMISC::CAABBox::getHalfSize()</a>, <a class="el" href="a06376.html#l00113">NL3D::CShapeStream::getShapePointer()</a>, <a class="el" href="a05825.html#l00080">NL3D::CInstanceLighter::CLightDesc::GridCellSize</a>, <a class="el" href="a05807.html#l00054">NL3D::CIGSurfaceLight::CRetrieverLightGrid::Grids</a>, <a class="el" href="a05825.html#l00077">NL3D::CInstanceLighter::CLightDesc::GridSize</a>, <a class="el" href="a05809.html#l00091">NL3D::CIGSurfaceLightBuild::CSurface::Height</a>, <a class="el" href="a06476.html#l00100">NL3D::CSurfaceLightGrid::Height</a>, <a class="el" href="a05992.html#l00198">NL3D::CMeshBase::isLightable()</a>, <a class="el" href="a06476.html#l00070">NL3D::CSurfaceLightGrid::CCellCorner::Light</a>, <a class="el" href="a06476.html#l00074">NL3D::CSurfaceLightGrid::CCellCorner::LocalAmbientId</a>, <a class="el" href="a06170.html#l00036">NLMISC::CPlane::make()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05708.html#l00135">NLMISC::CIFile::open()</a>, <a class="el" href="a05809.html#l00089">NL3D::CIGSurfaceLightBuild::CSurface::Origin</a>, <a class="el" href="a06476.html#l00098">NL3D::CSurfaceLightGrid::Origin</a>, <a class="el" href="a05825.html#l00086">NL3D::CInstanceLighter::CLightDesc::OverSampling</a>, <a class="el" href="a05825.html#l00115">NL3D::CInstanceLighter::CTriangle::Plane</a>, <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector< CCellCorner >::resize()</a>, <a class="el" href="a06116.html#l00142">NLMISC::CObjectVector< CSurfaceLightGrid >::resize()</a>, <a class="el" href="a06350.html#l00354">NL3D::CInstanceGroup::retrieve()</a>, <a class="el" href="a05809.html#l00112">NL3D::CIGSurfaceLightBuild::RetrieverGridMap</a>, <a class="el" href="a05972.html#l00644">NLMISC::CMatrix::scale()</a>, <a class="el" href="a06376.html#l00120">NL3D::CShapeStream::serial()</a>, <a class="el" href="a05385.html#l00066">NLMISC::CAABBox::setCenter()</a>, <a class="el" href="a05385.html#l00067">NLMISC::CAABBox::setHalfSize()</a>, <a class="el" href="a05972.html#l00267">NLMISC::CMatrix::setPos()</a>, <a class="el" href="a05972.html#l00209">NLMISC::CMatrix::setRot()</a>, <a class="el" href="a05825.html#l00083">NL3D::CInstanceLighter::CLightDesc::Shadow</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a06116.html#l00184">NLMISC::CObjectVector< CCellCorner >::size()</a>, <a class="el" href="a06476.html#l00068">NL3D::CSurfaceLightGrid::CCellCorner::SunContribution</a>, <a class="el" href="a05825.html#l00106">NL3D::CInstanceLighter::CTriangle::Triangle</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05825.html#l00089">NL3D::CInstanceLighter::CLightDesc::UserShapeMap</a>, <a class="el" href="a06585.html#l00051">NLMISC::CTriangle::V0</a>, <a class="el" href="a06585.html#l00051">NLMISC::CTriangle::V1</a>, <a class="el" href="a06585.html#l00051">NLMISC::CTriangle::V2</a>, <a class="el" href="a05809.html#l00090">NL3D::CIGSurfaceLightBuild::CSurface::Width</a>, <a class="el" href="a06476.html#l00099">NL3D::CSurfaceLightGrid::Width</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01502">lightIgSimple()</a>.
<p>
<div class="fragment"><pre>00307 {
00308 <a class="code" href="a04558.html#a14">sint</a> i;
00309 CVector outGlobalPos;
00310 std::vector<CCluster> outClusters;
00311 std::vector<CPortal> outPortals;
00312 std::vector<CPointLightNamed> pointLightList;
00313
00314 <a class="code" href="a04199.html#a6">nlassert</a>(lightDesc.OverSampling==0 || lightDesc.OverSampling==2 || lightDesc.OverSampling==4
00315 || lightDesc.OverSampling==8 || lightDesc.OverSampling==16);
00316
00317 <span class="comment">// Setup.</span>
00318 <span class="comment">//========</span>
00319
00320 <span class="comment">// Prepare IGSurfaceLight lighting</span>
00321 <span class="comment">//-----------</span>
00322 <span class="comment">// Bkup SurfaceLightBuild to know if must light the surfaces, in differents part of the process.</span>
00323 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>= igSurfaceLightBuild;
00324 <span class="comment">// Prepare _IGRetrieverGridMap.</span>
00325 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.clear();
00326 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>)
00327 {
00328 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_18">_TotalCellNumber</a>= 0;
00329 CIGSurfaceLightBuild::ItRetrieverGridMap itSrc;
00330 itSrc= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.begin();
00331 <span class="comment">// For all retrievers Infos in _IGSurfaceLightBuild</span>
00332 <span class="keywordflow">while</span>(itSrc!=<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.end())
00333 {
00334 <a class="code" href="a04558.html#a15">uint</a> numSurfaces= itSrc->second.Grids.size();
00335 <span class="comment">// If !empty retriever.</span>
00336 <span class="keywordflow">if</span>(numSurfaces>0)
00337 {
00338 <span class="comment">// Add it to the map, </span>
00339 CIGSurfaceLight::CRetrieverLightGrid &rlgDst= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>[itSrc->first];
00340 <span class="comment">// resize Array of surfaces.</span>
00341 rlgDst.Grids.resize(numSurfaces);
00342 <span class="comment">// For all surfaces, init them in rlgDst.</span>
00343 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<numSurfaces; i++)
00344 {
00345 CIGSurfaceLightBuild::CSurface &surfSrc= itSrc->second.Grids[i];
00346 CSurfaceLightGrid &surfDst= rlgDst.Grids[i];
00347 <span class="comment">// Init Cells with a default CellCorner</span>
00348 CSurfaceLightGrid::CCellCorner defaultCellCorner;
00349 defaultCellCorner.SunContribution= 0;
00350 defaultCellCorner.Light[0]= 0xFF;
00351 defaultCellCorner.LocalAmbientId= 0xFF;
00352
00353 <span class="comment">// Init the grid.</span>
00354 surfDst.Origin= surfSrc.Origin;
00355 surfDst.Width= surfSrc.Width;
00356 surfDst.Height= surfSrc.Height;
00357 surfDst.Cells.resize(surfSrc.Cells.size());
00358 surfDst.Cells.fill(defaultCellCorner);
00359 <span class="comment">// The grid must be valid an not empty</span>
00360 <a class="code" href="a04199.html#a6">nlassert</a>( surfDst.Cells.size() == surfDst.Width*surfDst.Height );
00361 <a class="code" href="a04199.html#a6">nlassert</a>( surfDst.Width>= 2 );
00362 <a class="code" href="a04199.html#a6">nlassert</a>( surfDst.Height>= 2 );
00363
00364 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_18">_TotalCellNumber</a>+= surfDst.Cells.size();
00365 }
00366 }
00367
00368 <span class="comment">// Next localRetriever info.</span>
00369 itSrc++;
00370 }
00371 }
00372 <span class="comment">// Reset cell iteration.</span>
00373 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">true</span>;
00374
00375
00376 <span class="comment">// Retrieve info from igIn.</span>
00377 <span class="comment">//-----------</span>
00378 igIn.retrieve (outGlobalPos, _Instances, outClusters, outPortals, pointLightList);
00379
00380
00381 <span class="comment">// set All Instances StaticLightEnabled= true, and Build _InstanceInfos.</span>
00382 <span class="comment">//-----------</span>
00383 <span class="comment">// Map of shape</span>
00384 std::map<string, IShape*> shapeMap;
00385 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>.resize(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size());
00386 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size();i++)
00387 {
00388 <span class="comment">// Avoid StaticLight precomputing??</span>
00389 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].AvoidStaticLightPreCompute)
00390 {
00391 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled= <span class="keyword">false</span>;
00392 <span class="comment">// Next instance.</span>
00393 <span class="keywordflow">continue</span>;
00394 }
00395
00396 <span class="comment">// Else let's do it.</span>
00397 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled= <span class="keyword">true</span>;
00398
00399
00400 <span class="comment">// Get the shape centerPos;</span>
00401 <span class="comment">//------------</span>
00402 CVector shapeCenterPos;
00403 CVector overSamples[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterw0NL3D_1_1CInstanceLighterw1">MaxOverSamples</a>];
00404
00405 <span class="comment">// Get the instance shape name</span>
00406 string name= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].Name;
00407 <span class="keywordtype">bool</span> shapeFound= <span class="keyword">true</span>;
00408
00409 <span class="comment">// Try to find the shape in the UseShapeMap.</span>
00410 std::map<string, IShape*>::const_iterator iteMap= lightDesc.UserShapeMap.find (name);
00411
00412 <span class="comment">// If not found in userShape map, try to load it from the temp loaded ShapeBank.</span>
00413 <span class="keywordflow">if</span>( iteMap == lightDesc.UserShapeMap.end() )
00414 {
00415 <span class="comment">// Add a .shape at the end ?</span>
00416 <span class="keywordflow">if</span> (name.find(<span class="charliteral">'.'</span>) == std::string::npos)
00417 name += <span class="stringliteral">".shape"</span>;
00418
00419 <span class="comment">// Get the instance shape name</span>
00420 string nameLookup = CPath::lookup (name, <span class="keyword">false</span>, <span class="keyword">false</span>);
00421 <span class="keywordflow">if</span> (!nameLookup.empty())
00422 name = nameLookup;
00423
00424 <span class="comment">// Find the shape in the bank</span>
00425 iteMap= shapeMap.find (name);
00426 <span class="keywordflow">if</span> (iteMap==shapeMap.end())
00427 {
00428 <span class="comment">// Input file</span>
00429 <a class="code" href="a02653.html">CIFile</a> inputFile;
00430
00431 <span class="keywordflow">if</span> (!name.empty() && inputFile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea12">open</a> (name))
00432 {
00433 <span class="comment">// Load it</span>
00434 CShapeStream stream;
00435 stream.serial (inputFile);
00436
00437 <span class="comment">// Get the pointer</span>
00438 iteMap=shapeMap.insert (std::map<string, IShape*>::value_type (name, stream.getShapePointer ())).first;
00439 }
00440 <span class="keywordflow">else</span>
00441 {
00442 <span class="comment">// Error</span>
00443 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"WARNING can't load shape %s\n"</span>, name.c_str());
00444 shapeFound= <span class="keyword">false</span>;
00445 }
00446 }
00447 }
00448
00449
00450 <span class="comment">// Last chance to skip it: fully LightMapped ??</span>
00451 <span class="comment">//-----------</span>
00452 <span class="keywordflow">if</span>(shapeFound)
00453 {
00454 CMeshBase *mesh= dynamic_cast<CMeshBase*>(iteMap->second);
00455 <span class="keywordflow">if</span>(mesh)
00456 {
00457 <span class="comment">// If this mesh is not lightable (fully lightMapped)</span>
00458 <span class="keywordflow">if</span>(!mesh->isLightable())
00459 {
00460 <span class="comment">// Force Avoid StaticLight precomputing</span>
00461 _Instances[i].AvoidStaticLightPreCompute= <span class="keyword">true</span>;
00462 <span class="comment">// Disable static lighting.</span>
00463 _Instances[i].StaticLightEnabled= <span class="keyword">false</span>;
00464 <span class="comment">// Next instance.</span>
00465 <span class="keywordflow">continue</span>;
00466 }
00467 }
00468 }
00469
00470
00471 <span class="comment">// Compute pos and OverSamples</span>
00472 <span class="comment">//-----------</span>
00473 {
00474 <span class="comment">// Compute bbox, or default bbox</span>
00475 CAABBox bbox;
00476 <span class="keywordflow">if</span>(!shapeFound)
00477 {
00478 bbox.setCenter(CVector::Null);
00479 bbox.setHalfSize(CVector::Null);
00480 }
00481 <span class="keywordflow">else</span>
00482 {
00483 iteMap->second->getAABBox(bbox);
00484 }
00485 <span class="comment">// get pos</span>
00486 shapeCenterPos= bbox.getCenter();
00487
00488
00489 <span class="comment">// Compute overSamples</span>
00490 <span class="keywordtype">float</span> qx= bbox.getHalfSize().x/2;
00491 <span class="keywordtype">float</span> qy= bbox.getHalfSize().y/2;
00492 <span class="keywordtype">float</span> qz= bbox.getHalfSize().z/2;
00493 <span class="comment">// No OverSampling => just copy.</span>
00494 <span class="keywordflow">if</span>(lightDesc.OverSampling==0)
00495 overSamples[0]= shapeCenterPos;
00496 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(lightDesc.OverSampling==2)
00497 {
00498 <span class="comment">// Prefer Z Axis.</span>
00499 overSamples[0]= shapeCenterPos + CVector(0, 0, qz);
00500 overSamples[1]= shapeCenterPos - CVector(0, 0, qz);
00501 }
00502 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(lightDesc.OverSampling==4)
00503 {
00504 <span class="comment">// Apply an overSampling such that we see 4 points if we look on each side of the bbox.</span>
00505 overSamples[0]= shapeCenterPos + CVector(-qx, -qy, -qz);
00506 overSamples[1]= shapeCenterPos + CVector(+qx, -qy, +qz);
00507 overSamples[2]= shapeCenterPos + CVector(-qx, +qy, +qz);
00508 overSamples[3]= shapeCenterPos + CVector(+qx, +qy, -qz);
00509 }
00510 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(lightDesc.OverSampling==8 || lightDesc.OverSampling==16)
00511 {
00512 <span class="comment">// 8x is the best overSampling shceme for bbox</span>
00513 overSamples[0]= shapeCenterPos + CVector(-qx, -qy, -qz);
00514 overSamples[1]= shapeCenterPos + CVector(+qx, -qy, -qz);
00515 overSamples[2]= shapeCenterPos + CVector(-qx, +qy, -qz);
00516 overSamples[3]= shapeCenterPos + CVector(+qx, +qy, -qz);
00517 overSamples[4]= shapeCenterPos + CVector(-qx, -qy, +qz);
00518 overSamples[5]= shapeCenterPos + CVector(+qx, -qy, +qz);
00519 overSamples[6]= shapeCenterPos + CVector(-qx, +qy, +qz);
00520 overSamples[7]= shapeCenterPos + CVector(+qx, +qy, +qz);
00521
00522 <span class="comment">// 16x => use this setup, and decal from 1/8</span>
00523 <span class="keywordflow">if</span>(lightDesc.OverSampling==16)
00524 {
00525 CVector decal(qx/2, qy/2, qz/2);
00526 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> sample=0; sample<8; sample++)
00527 {
00528 <span class="comment">// Copy and decal</span>
00529 overSamples[sample+8]= overSamples[sample] + decal;
00530 <span class="comment">// neg decal me</span>
00531 overSamples[sample]-= decal;
00532 }
00533 }
00534 }
00535 }
00536
00537
00538 <span class="comment">// Compute pos of the instance</span>
00539 <span class="comment">//------------</span>
00540 CMatrix matInst;
00541 matInst.setPos(_Instances[i].Pos);
00542 matInst.setRot(_Instances[i].Rot);
00543 matInst.scale(_Instances[i].Scale);
00544 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].CenterPos= matInst * shapeCenterPos;
00545 <span class="comment">// Apply matInst to samples.</span>
00546 <a class="code" href="a04558.html#a15">uint</a> nSamples= max(1U, lightDesc.OverSampling);
00547 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> sample=0; sample<nSamples; sample++)
00548 {
00549 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i].OverSamples[sample]= matInst * overSamples[sample];
00550 }
00551 }
00552
00553 <span class="comment">// Clean Up shapes.</span>
00554 <span class="comment">//-----------</span>
00555 std::map<string, IShape*>::iterator iteMap;
00556 iteMap= shapeMap.begin();
00557 <span class="keywordflow">while</span>(iteMap!= shapeMap.end())
00558 {
00559 <span class="comment">// delte shape</span>
00560 <span class="keyword">delete</span> iteMap->second;
00561 <span class="comment">// delete entry in map</span>
00562 shapeMap.erase(iteMap);
00563 <span class="comment">// next</span>
00564 iteMap= shapeMap.begin();
00565 }
00566
00567 <span class="comment">// Build all obstacles plane.</span>
00568 <span class="comment">//-----------</span>
00569 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)obstacles.size();i++)
00570 {
00571 CInstanceLighter::CTriangle& triangle=obstacles[i];
00572 <span class="comment">// Calc the plane</span>
00573 triangle.Plane.make (triangle.Triangle.V0, triangle.Triangle.V1, triangle.Triangle.V2);
00574 }
00575
00576
00577 <span class="comment">// Lighting</span>
00578 <span class="comment">//========</span>
00579 <span class="comment">// Light With Sun: build the grid, and do it on all _Instances, using _InstanceInfos</span>
00580 <span class="comment">// Compute also Lighting on surface.</span>
00581 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterd1">computeSunContribution</a>(lightDesc, obstacles, landscape);
00582
00583 <span class="comment">// Light With PointLights</span>
00584 <span class="comment">// build the cubeGrids</span>
00585 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterd0">compilePointLightRT</a>(lightDesc.GridSize, lightDesc.GridCellSize, obstacles, lightDesc.Shadow);
00586 <span class="comment">// kill pointLightList, because will use mine.</span>
00587 pointLightList.clear();
00588 <span class="comment">// Light for all _Instances, using _InstanceInfos</span>
00589 <span class="comment">// Compute also Lighting on surface.</span>
00590 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterd3">processIGPointLightRT</a>(pointLightList);
00591
00592 <span class="comment">// If _IGSurfaceLightBuild, then dilate lighting</span>
00593 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>)
00594 {
00595 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterd2">dilateLightingOnSurfaceCells</a>();
00596 }
00597
00598
00599 <span class="comment">// Build result.</span>
00600 <span class="comment">//========</span>
00601 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>)
00602 {
00603 <span class="comment">// build with IGSurfaceLight lighting</span>
00604 igOut.build(outGlobalPos, _Instances, outClusters, outPortals, pointLightList,
00605 &_IGRetrieverGridMap, <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->CellSize);
00606 }
00607 <span class="keywordflow">else</span>
00608 {
00609 <span class="comment">// build without IGSurfaceLight lighting</span>
00610 igOut.build(outGlobalPos, _Instances, outClusters, outPortals, pointLightList);
00611 }
00612
00613 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLightere2" doxytag="NL3D::CInstanceLighter::lightIgSimple" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::lightIgSimple </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a02675.html">CInstanceLighter</a> & </td>
<td class="mdname" nowrap> <em>instLighter</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="a02671.html">CInstanceGroup</a> & </td>
<td class="mdname" nowrap> <em>igIn</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a02671.html">CInstanceGroup</a> & </td>
<td class="mdname" nowrap> <em>igOut</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="a02677.html">CLightDesc</a> & </td>
<td class="mdname" nowrap> <em>lightDesc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>igName</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Tool method which take a single IG, and do all the god job to light this one, with no other dependencies NB: it uses instLighter passed, <a class="el" href="a02675.html#NL3D_1_1CInstanceLightera1">init()</a> ing it. It use lightDesc.UserShapeMap or it load Shape in directory lightDesc.ShapePath
<p>
Definition at line <a class="el" href="a05824.html#l01502">1502</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05824.html#l00999">addStaticPointLight()</a>, <a class="el" href="a06350.html#l00225">NL3D::CInstanceGroup::getInstance()</a>, <a class="el" href="a06350.html#l00181">NL3D::CInstanceGroup::getInstancePos()</a>, <a class="el" href="a06350.html#l00189">NL3D::CInstanceGroup::getInstanceRot()</a>, <a class="el" href="a06350.html#l00197">NL3D::CInstanceGroup::getInstanceScale()</a>, <a class="el" href="a06350.html#l00158">NL3D::CInstanceGroup::getNumInstance()</a>, <a class="el" href="a06351.html#l00338">NL3D::CInstanceGroup::getPointLightList()</a>, <a class="el" href="a06350.html#l00165">NL3D::CInstanceGroup::getShapeName()</a>, <a class="el" href="a06376.html#l00113">NL3D::CShapeStream::getShapePointer()</a>, <a class="el" href="a05824.html#l00072">init()</a>, <a class="el" href="a05824.html#l00305">light()</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05708.html#l00135">NLMISC::CIFile::open()</a>, <a class="el" href="a05825.html#l00159">progress()</a>, <a class="el" href="a05972.html#l00644">NLMISC::CMatrix::scale()</a>, <a class="el" href="a06376.html#l00120">NL3D::CShapeStream::serial()</a>, <a class="el" href="a05972.html#l00267">NLMISC::CMatrix::setPos()</a>, <a class="el" href="a05972.html#l00209">NLMISC::CMatrix::setRot()</a>, <a class="el" href="a05825.html#l00083">NL3D::CInstanceLighter::CLightDesc::Shadow</a>, <a class="el" href="a05981.html#l00104">sint</a>, and <a class="el" href="a05825.html#l00089">NL3D::CInstanceLighter::CLightDesc::UserShapeMap</a>.
<p>
<div class="fragment"><pre>01503 {
01504 <a class="code" href="a04558.html#a14">sint</a> i;
01505
01506
01507 <span class="comment">// Setup.</span>
01508 <span class="comment">//=======</span>
01509 <span class="comment">// Init</span>
01510 instLighter.init();
01511
01512 <span class="comment">// Add obstacles.</span>
01513 std::vector<CInstanceLighter::CTriangle> obstacles;
01514 <span class="comment">// only if Shadowing On.</span>
01515 <span class="keywordflow">if</span>(lightDesc.Shadow)
01516 {
01517 <span class="comment">// Map of shape to load</span>
01518 std::map<string, IShape*> shapeMap;
01519
01520 <span class="comment">// For all instances of igIn.</span>
01521 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)igIn.getNumInstance();i++)
01522 {
01523 <span class="comment">// progress</span>
01524 instLighter.progress(<span class="stringliteral">"Loading Shapes obstacles"</span>, <span class="keywordtype">float</span>(i)/igIn.getNumInstance());
01525
01526 <span class="comment">// Skip it??</span>
01527 <span class="keywordflow">if</span>(igIn.getInstance(i).DontCastShadow)
01528 <span class="keywordflow">continue</span>;
01529
01530 <span class="comment">// Get the instance shape name</span>
01531 string name= igIn.getShapeName(i);
01532 <span class="keywordtype">bool</span> shapeFound= <span class="keyword">true</span>;
01533
01534 <span class="comment">// Try to find the shape in the UseShapeMap.</span>
01535 std::map<string, IShape*>::const_iterator iteMap= lightDesc.UserShapeMap.find (name);
01536
01537 <span class="comment">// If not found in userShape map, try to load it from the temp loaded ShapeBank.</span>
01538 <span class="keywordflow">if</span>( iteMap == lightDesc.UserShapeMap.end() )
01539 {
01540 <span class="comment">// Add a .shape at the end ?</span>
01541 <span class="keywordflow">if</span> (name.find(<span class="charliteral">'.'</span>) == std::string::npos)
01542 name += <span class="stringliteral">".shape"</span>;
01543
01544 <span class="comment">// Get the instance shape name</span>
01545 string nameLookup = CPath::lookup (name, <span class="keyword">false</span>, <span class="keyword">false</span>);
01546 <span class="keywordflow">if</span> (!nameLookup.empty())
01547 name = nameLookup;
01548
01549 <span class="comment">// Find the shape in the bank</span>
01550 iteMap= shapeMap.find (name);
01551 <span class="keywordflow">if</span> (iteMap==shapeMap.end())
01552 {
01553 <span class="comment">// Input file</span>
01554 <a class="code" href="a02653.html">CIFile</a> inputFile;
01555
01556 <span class="keywordflow">if</span> (!name.empty() && inputFile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea12">open</a> (name))
01557 {
01558 <span class="comment">// Load it</span>
01559 CShapeStream stream;
01560 stream.serial (inputFile);
01561
01562 <span class="comment">// Get the pointer</span>
01563 iteMap=shapeMap.insert (std::map<string, IShape*>::value_type (name, stream.getShapePointer ())).first;
01564 }
01565 <span class="keywordflow">else</span>
01566 {
01567 <span class="comment">// Error</span>
01568 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"WARNING can't load shape %s\n"</span>, name.c_str());
01569 shapeFound= <span class="keyword">false</span>;
01570 }
01571 }
01572 }
01573
01574 <span class="keywordflow">if</span>(shapeFound)
01575 {
01576 CMatrix matInst;
01577 matInst.setPos(igIn.getInstancePos(i));
01578 matInst.setRot(igIn.getInstanceRot(i));
01579 matInst.scale(igIn.getInstanceScale(i));
01580 <span class="comment">// Add triangles of this shape</span>
01581 CInstanceLighter::addTriangles(*iteMap->second, matInst, obstacles, i);
01582 }
01583
01584 }
01585
01586 <span class="comment">// Clean Up shapes.</span>
01587 <span class="comment">//-----------</span>
01588 std::map<string, IShape*>::iterator iteMap;
01589 iteMap= shapeMap.begin();
01590 <span class="keywordflow">while</span>(iteMap!= shapeMap.end())
01591 {
01592 <span class="comment">// delte shape</span>
01593 <span class="keyword">delete</span> iteMap->second;
01594 <span class="comment">// delete entry in map</span>
01595 shapeMap.erase(iteMap);
01596 <span class="comment">// next</span>
01597 iteMap= shapeMap.begin();
01598 }
01599 }
01600
01601 <span class="comment">// Add pointLights of the IG.</span>
01602 <span class="keywordflow">for</span>(i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)igIn.getPointLightList().size();i++)
01603 {
01604 instLighter.addStaticPointLight( igIn.getPointLightList()[i], igName );
01605 }
01606
01607
01608 <span class="comment">// Run.</span>
01609 <span class="comment">//=======</span>
01610 instLighter.light(igIn, igOut, lightDesc, obstacles);
01611
01612 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_9" doxytag="NL3D::CInstanceLighter::nextCell" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::nextCell </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01663">1663</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00214">_IGRetrieverGridMap</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00293">_IsEndCell</a>, <a class="el" href="a05825.html#l00292">_ItCellId</a>, <a class="el" href="a05825.html#l00294">_ItCurrentCellNumber</a>, <a class="el" href="a05825.html#l00289">_ItRetriever</a>, <a class="el" href="a05825.html#l00290">_ItRetrieverInfo</a>, <a class="el" href="a05825.html#l00291">_ItSurfId</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05809.html#l00112">NL3D::CIGSurfaceLightBuild::RetrieverGridMap</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>.
<p>
<div class="fragment"><pre>01664 {
01665 <a class="code" href="a04199.html#a6">nlassert</a>(!<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>());
01666
01667 <span class="comment">// Next Cell.</span>
01668 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>++;
01669 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_13">_ItCurrentCellNumber</a>++;
01670
01671 <span class="comment">// If end of Cells, next surface.</span>
01672 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a> >= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids[<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>].Cells.size() )
01673 {
01674 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">_ItCellId</a>= 0;
01675 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a> ++;
01676 }
01677
01678 <span class="comment">// If end of surface, next retriever.</span>
01679 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a> >= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->second.Grids.size() )
01680 {
01681 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">_ItSurfId</a>= 0;
01682 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>++;
01683 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a> != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.end())
01684 {
01685 <span class="comment">// Get info.</span>
01686 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">_ItRetrieverInfo</a>= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.find(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a>->first);
01687 <a class="code" href="a04199.html#a6">nlassert</a>(_ItRetrieverInfo != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>->RetrieverGridMap.end() );
01688 }
01689 }
01690
01691 <span class="comment">// If end of retreiver, End.</span>
01692 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">_ItRetriever</a> == <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr1">_IGRetrieverGridMap</a>.end())
01693 {
01694 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">_IsEndCell</a>= <span class="keyword">true</span>;
01695 }
01696 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterd3" doxytag="NL3D::CInstanceLighter::processIGPointLightRT" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::processIGPointLightRT </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::vector< <a class="el" href="a03094.html">CPointLightNamed</a> > & </td>
<td class="mdname1" valign="top" nowrap> <em>listPointLight</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Process the IG, ie process _InstanceInfos. Also process SurfaceLightGrid MultiCPU: not done for now. Be aware of <a class="el" href="a02678.html#NL3D_1_1CInstanceLighter_1_1CPointLightRTo5">CPointLightRT::RefCount</a>!!!!
<p>
Definition at line <a class="el" href="a05824.html#l01161">1161</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00210">_CurrentInstanceComputed</a>, <a class="el" href="a05825.html#l00212">_IGSurfaceLightBuild</a>, <a class="el" href="a05825.html#l00208">_InstanceInfos</a>, <a class="el" href="a05825.html#l00255">_StaticPointLightQuadGrid</a>, <a class="el" href="a05825.html#l00253">_StaticPointLights</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_0">NL3D::CQuadGrid< CPointLightRT * >::begin()</a>, <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05825.html#l00223">NL3D::CInstanceLighter::CPointLightRT::BSphere</a>, <a class="el" href="a05505.html#l00048">NLMISC::CBSphere::Center</a>, <a class="el" href="a05809.html#l00068">NL3D::CIGSurfaceLightBuild::CCellCorner::CenterPos</a>, <a class="el" href="a05825.html#l00193">NL3D::CInstanceLighter::CInstanceInfo::CenterPos</a>, <a class="el" href="a05825.html#l00230">NL3D::CInstanceLighter::CPointLightRT::DstId</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_2">NL3D::CQuadGrid< CPointLightRT * >::end()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a06179.html#l00138">NL3D::CPointLight::getType()</a>, <a class="el" href="a05809.html#l00059">NL3D::CIGSurfaceLightBuild::CCellCorner::InSurface</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a06476.html#l00070">NL3D::CSurfaceLightGrid::CCellCorner::Light</a>, <a class="el" href="a06351.html#l00115">NL3D::CInstanceGroup::CInstance::Light</a>, <a class="el" href="a05825.html#l00199">NL3D::CInstanceLighter::CInstanceInfo::Light</a>, <a class="el" href="a05809.html#l00078">NL3D::CIGSurfaceLightBuild::CCellCorner::LightInfo</a>, <a class="el" href="a06476.html#l00074">NL3D::CSurfaceLightGrid::CCellCorner::LocalAmbientId</a>, <a class="el" href="a06351.html#l00119">NL3D::CInstanceGroup::CInstance::LocalAmbientId</a>, <a class="el" href="a05809.html#l00079">NL3D::CIGSurfaceLightBuild::CCellCorner::LocalAmbientLight</a>, <a class="el" href="a05825.html#l00202">NL3D::CInstanceLighter::CInstanceInfo::LocalAmbientLight</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, <a class="el" href="a05622.html#l00541">nlctassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05825.html#l00246">NL3D::CInstanceLighter::CPredPointLightToPoint::Point</a>, <a class="el" href="a05825.html#l00220">NL3D::CInstanceLighter::CPointLightRT::PointLight</a>, <a class="el" href="a05825.html#l00159">progress()</a>, <a class="el" href="a05824.html#l01623">progressCell()</a>, <a class="el" href="a05505.html#l00049">NLMISC::CBSphere::Radius</a>, <a class="el" href="a05825.html#l00228">NL3D::CInstanceLighter::CPointLightRT::RefCount</a>, <a class="el" href="a03273.html#NL3D_1_1CQuadGridz776_3">NL3D::CQuadGrid< CPointLightRT * >::select()</a>, <a class="el" href="a05824.html#l00954">NL3D::CInstanceLighter::CPointLightRT::testRaytrace()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00305">light()</a>.
<p>
<div class="fragment"><pre>01162 {
01163 <a class="code" href="a04558.html#a15">uint</a> i;
01164 vector<CPointLightRT*> lightInfs;
01165 lightInfs.reserve(1024);
01166
01167 <span class="comment">// clear result list</span>
01168 listPointLight.clear();
01169
01170
01171 <span class="comment">// Compute each Instance</span>
01172 <span class="comment">//===========</span>
01173 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>.size(); i++)
01174 {
01175 <span class="comment">// If staticLight not enabled, skip.</span>
01176 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled )
01177 <span class="keywordflow">continue</span>;
01178
01179 CInstanceInfo &inst= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr3">_InstanceInfos</a>[i];
01180 <span class="comment">// Avoid autoShadowing</span>
01181 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr0">_CurrentInstanceComputed</a>= i;
01182
01183 <span class="comment">// progress</span>
01184 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a> (<span class="stringliteral">"Compute Influences of PointLights 2/2"</span>, i / (<span class="keywordtype">float</span>)_InstanceInfos.size());
01185
01186 <span class="comment">// get the point of the instance.</span>
01187 CVector pos= inst.CenterPos;
01188
01189 <span class="comment">// Default: takes no LocalAmbientLight;</span>
01190 inst.LocalAmbientLight= NULL;
01191 <span class="keywordtype">float</span> furtherAmbLight= 0;
01192
01193 <span class="comment">// Compute Which light influences him.</span>
01194 <span class="comment">//---------</span>
01195 lightInfs.clear();
01196 <span class="comment">// Search possible lights around the position.</span>
01197 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.select(pos, pos);
01198 <span class="comment">// For all of them, get the ones which touch this point.</span>
01199 CQuadGrid<CPointLightRT*>::CIterator it= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.begin();
01200 <span class="keywordflow">while</span>(it != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.end())
01201 {
01202 CPointLightRT *pl= *it;
01203
01204 <span class="comment">// Test if really in the radius of the light, no occlusion, not an ambient, and in Spot Angle setup</span>
01205 <span class="keywordflow">if</span>( pl->testRaytrace(pos, _CurrentInstanceComputed) )
01206 {
01207 <span class="comment">// Ok, add the light to the lights which influence the instance</span>
01208 lightInfs.push_back(pl);
01209 }
01210
01211 <span class="comment">// Ambient Light ??</span>
01212 <span class="keywordflow">if</span>( pl->PointLight.getType() == CPointLight::AmbientLight )
01213 {
01214 <span class="comment">// If the instance is in radius of the ambiant light.</span>
01215 <span class="keywordtype">float</span> dRadius= pl->BSphere.Radius - (pl->BSphere.Center - pos).norm();
01216 <span class="keywordflow">if</span>(dRadius>0)
01217 {
01218 <span class="comment">// Take the best ambient light: the one which is further from the circumference</span>
01219 <span class="keywordflow">if</span>(dRadius > furtherAmbLight)
01220 {
01221 furtherAmbLight= dRadius;
01222 inst.LocalAmbientLight= pl;
01223 }
01224 }
01225 }
01226
01227 <span class="comment">// next</span>
01228 it++;
01229 }
01230
01231 <span class="comment">// If ambientLight chosen, inc Ref count of it</span>
01232 <span class="keywordflow">if</span>(inst.LocalAmbientLight)
01233 inst.LocalAmbientLight->RefCount++;
01234
01235 <span class="comment">// Choose the Best ones.</span>
01236 <span class="comment">//---------</span>
01237 CPredPointLightToPoint predPLTP;
01238 predPLTP.Point= pos;
01239 <span class="comment">// sort.</span>
01240 sort(lightInfs.begin(), lightInfs.end(), predPLTP);
01241 <span class="comment">// truncate.</span>
01242 lightInfs.resize( <a class="code" href="a04061.html#a0">min</a>((<a class="code" href="a04558.html#a15">uint</a>)lightInfs.size(), (<a class="code" href="a04558.html#a15">uint</a>)CInstanceGroup::NumStaticLightPerInstance) );
01243
01244
01245 <span class="comment">// For each of them, fill instance</span>
01246 <span class="comment">//---------</span>
01247 <a class="code" href="a04558.html#a15">uint</a> lightInfId;
01248 <span class="keywordflow">for</span>(lightInfId=0; lightInfId<lightInfs.size(); lightInfId++)
01249 {
01250 CPointLightRT *pl= lightInfs[lightInfId];
01251
01252 <span class="comment">// copy light.</span>
01253 inst.Light[lightInfId]= pl;
01254
01255 <span class="comment">// Inc RefCount of the light.</span>
01256 pl->RefCount++;
01257 }
01258 <span class="comment">// Reset any empty slot to NULL.</span>
01259 <span class="keywordflow">for</span>(; lightInfId<CInstanceGroup::NumStaticLightPerInstance; lightInfId++)
01260 {
01261 inst.Light[lightInfId]= NULL;
01262 }
01263
01264 }
01265
01266
01267 <span class="comment">// Compute Lighting on SurfaceLightGrid</span>
01268 <span class="comment">//===========</span>
01269 <span class="comment">// Must do it before compression !!</span>
01270 <span class="comment">// NB: big copy/Past from above</span>
01271 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>)
01272 {
01273 <span class="comment">// No instance currenlty computed, since we compute surface cells.</span>
01274 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr0">_CurrentInstanceComputed</a>= -1;
01275
01276 <span class="comment">// Begin cell iteration</span>
01277 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>();
01278 <span class="comment">// For all surface cell corners</span>
01279 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() )
01280 {
01281 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_10">progressCell</a>(<span class="stringliteral">"Compute PointLights on Surfaces"</span>);
01282
01283 <span class="comment">// get the current cellInfo iterated.</span>
01284 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>();
01285
01286 <span class="comment">// if the cell corner lies in the polygon surface.</span>
01287 <span class="keywordflow">if</span>(cellInfo.InSurface)
01288 {
01289 <span class="comment">// get the point of the cell.</span>
01290 CVector pos= cellInfo.CenterPos;
01291
01292 <span class="comment">// Default: takes no LocalAmbientLight;</span>
01293 cellInfo.LocalAmbientLight= NULL;
01294 <span class="keywordtype">float</span> furtherAmbLight= 0;
01295
01296 <span class="comment">// Compute Which light influences him.</span>
01297 <span class="comment">//---------</span>
01298 lightInfs.clear();
01299 <span class="comment">// Search possible lights around the position.</span>
01300 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.select(pos, pos);
01301 <span class="comment">// For all of them, get the ones which touch this point.</span>
01302 CQuadGrid<CPointLightRT*>::CIterator it= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.begin();
01303 <span class="keywordflow">while</span>(it != <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr5">_StaticPointLightQuadGrid</a>.end())
01304 {
01305 CPointLightRT *pl= *it;
01306
01307 <span class="comment">// Test if really in the radius of the light, no occlusion, not an ambient, and in Spot Angle setup</span>
01308 <span class="keywordflow">if</span>( pl->testRaytrace(pos, _CurrentInstanceComputed) )
01309 {
01310 <span class="comment">// Ok, add the light to the lights which influence the cell</span>
01311 lightInfs.push_back(pl);
01312 }
01313
01314 <span class="comment">// Ambient Light ??</span>
01315 <span class="keywordflow">if</span>( pl->PointLight.getType() == CPointLight::AmbientLight )
01316 {
01317 <span class="comment">// If the instance is in radius of the ambiant light.</span>
01318 <span class="keywordtype">float</span> dRadius= pl->BSphere.Radius - (pl->BSphere.Center - pos).norm();
01319 <span class="keywordflow">if</span>(dRadius>0)
01320 {
01321 <span class="comment">// Take the best ambient light: the one which is further from the circumference</span>
01322 <span class="keywordflow">if</span>(dRadius > furtherAmbLight)
01323 {
01324 furtherAmbLight= dRadius;
01325 cellInfo.LocalAmbientLight= pl;
01326 }
01327 }
01328 }
01329
01330 <span class="comment">// next</span>
01331 it++;
01332 }
01333
01334 <span class="comment">// If ambientLight chosen, inc Ref count of it</span>
01335 <span class="keywordflow">if</span>(cellInfo.LocalAmbientLight)
01336 ((CPointLightRT*)cellInfo.LocalAmbientLight)->RefCount++;
01337
01338
01339 <span class="comment">// Choose the Best ones.</span>
01340 <span class="comment">//---------</span>
01341 CPredPointLightToPoint predPLTP;
01342 predPLTP.Point= pos;
01343 <span class="comment">// sort.</span>
01344 sort(lightInfs.begin(), lightInfs.end(), predPLTP);
01345 <span class="comment">// truncate.</span>
01346 lightInfs.resize( <a class="code" href="a04061.html#a0">min</a>((<a class="code" href="a04558.html#a15">uint</a>)lightInfs.size(), (<a class="code" href="a04558.html#a15">uint</a>)CSurfaceLightGrid::NumLightPerCorner) );
01347
01348
01349 <span class="comment">// For each of them, fill cellInfo</span>
01350 <span class="comment">//---------</span>
01351 <a class="code" href="a04558.html#a15">uint</a> lightInfId;
01352 <span class="keywordflow">for</span>(lightInfId=0; lightInfId<lightInfs.size(); lightInfId++)
01353 {
01354 CPointLightRT *pl= lightInfs[lightInfId];
01355
01356 <span class="comment">// copy light.</span>
01357 cellInfo.LightInfo[lightInfId]= pl;
01358
01359 <span class="comment">// Inc RefCount of the light.</span>
01360 pl->RefCount++;
01361 }
01362 <span class="comment">// Reset any empty slot to NULL.</span>
01363 <span class="keywordflow">for</span>(; lightInfId<CSurfaceLightGrid::NumLightPerCorner; lightInfId++)
01364 {
01365 cellInfo.LightInfo[lightInfId]= NULL;
01366 }
01367
01368 }
01369
01370 <span class="comment">// next cell</span>
01371 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>();
01372 }
01373 }
01374
01375
01376
01377 <span class="comment">// Compress and setup _Instances with compressed data.</span>
01378 <span class="comment">//===========</span>
01379 <a class="code" href="a04558.html#a15">uint</a> plId= 0;
01380 <span class="comment">// Process each pointLights</span>
01381 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>.size(); i++)
01382 {
01383 CPointLightRT &plRT= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr6">_StaticPointLights</a>[i];
01384 <span class="comment">// If this light is used.</span>
01385 <span class="keywordflow">if</span>(plRT.RefCount > 0)
01386 {
01387 <span class="comment">// Valid light ?</span>
01388 <span class="keywordflow">if</span> (plId <=0xFF)
01389 {
01390 <span class="comment">// Must Copy it into Ig.</span>
01391 listPointLight.push_back(plRT.PointLight);
01392 plRT.DstId= plId++;
01393 <span class="comment">// If index >= 255, too many lights (NB: => because 255 is a NULL code).</span>
01394 }
01395 <span class="keywordflow">else</span>
01396 {
01397 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"ERROR: Too many Static Point Lights influence the IG!!"</span>);
01398 <span class="comment">// Set 0xFF. Special code indicating that the light CAN'T BE USED => any instance using </span>
01399 <span class="comment">// it is buggy (won't be lighted by this light).</span>
01400 plRT.DstId= plId++;
01401 }
01402 }
01403 }
01404
01405 <span class="comment">// For each instance, compress Point light info</span>
01406 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>.size(); i++)
01407 {
01408 <span class="comment">// If staticLight not enabled, skip.</span>
01409 <span class="keywordflow">if</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i].StaticLightEnabled )
01410 <span class="keywordflow">continue</span>;
01411
01412 CInstanceInfo &instSrc= _InstanceInfos[i];
01413 CInstanceGroup::CInstance &instDst= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr4">_Instances</a>[i];
01414
01415 <span class="comment">// Do it for PointLights</span>
01416 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> lightId= 0; lightId<CInstanceGroup::NumStaticLightPerInstance; lightId++)
01417 {
01418 <span class="keywordflow">if</span>(instSrc.Light[lightId] == NULL)
01419 {
01420 <span class="comment">// Mark as unused.</span>
01421 instDst.Light[lightId]= 0xFF;
01422 }
01423 <span class="keywordflow">else</span>
01424 {
01425 <span class="comment">// Get index. NB: may still be 0xFF if 'Too many static light' bug.</span>
01426 instDst.Light[lightId]= instSrc.Light[lightId]->DstId;
01427 }
01428 }
01429
01430 <span class="comment">// Ensure that all FF are at end of the list (possible because of the TooManyStaticLight bug).</span>
01431 <span class="comment">// But don't do a full sort, to preserve order due to influence...</span>
01432 <a class="code" href="a04199.html#a16">nlctassert</a>(CInstanceGroup::NumStaticLightPerInstance==2);
01433 <span class="keywordflow">if</span>(instDst.Light[0] == 0xFF) swap(instDst.Light[0], instDst.Light[1]);
01434
01435 <span class="comment">// Do it for Ambientlight</span>
01436 <span class="keywordflow">if</span>(instSrc.LocalAmbientLight == NULL)
01437 instDst.LocalAmbientId= 0xFF;
01438 <span class="keywordflow">else</span>
01439 <span class="comment">// NB: may still be 0xFF if 'Too many static light' bug.</span>
01440 instDst.LocalAmbientId= instSrc.LocalAmbientLight->DstId;
01441 }
01442
01443 <span class="comment">// For each cell, compress Point light info</span>
01444 <span class="keywordflow">if</span>(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterr2">_IGSurfaceLightBuild</a>)
01445 {
01446 <span class="comment">// Begin cell iteration</span>
01447 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_0">beginCell</a>();
01448 <span class="comment">// For all surface cell corners</span>
01449 <span class="keywordflow">while</span>( !<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_8">isEndCell</a>() )
01450 {
01451 <span class="comment">// get the current cell and cellInfo iterated.</span>
01452 CIGSurfaceLightBuild::CCellCorner &cellInfo= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_2">getCurrentCellInfo</a>();
01453 CSurfaceLightGrid::CCellCorner &cell= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_1">getCurrentCell</a>();
01454
01455 <span class="keywordflow">if</span>(cellInfo.InSurface)
01456 {
01457 <span class="comment">// Do it for PointLights</span>
01458 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> lightId= 0; lightId<CSurfaceLightGrid::NumLightPerCorner; lightId++)
01459 {
01460 <span class="keywordflow">if</span>(cellInfo.LightInfo[lightId] == NULL)
01461 {
01462 <span class="comment">// Mark as unused.</span>
01463 cell.Light[lightId]= 0xFF;
01464 }
01465 <span class="keywordflow">else</span>
01466 {
01467 <span class="comment">// Get index. NB: may still be 0xFF if 'Too many static light' bug.</span>
01468 cell.Light[lightId]= reinterpret_cast<CPointLightRT*>(cellInfo.LightInfo[lightId])->DstId;
01469 }
01470 }
01471
01472 <span class="comment">// Ensure that all FF are at end of the list (possible because of the TooManyStaticLight bug).</span>
01473 <span class="comment">// But don't do a full sort, to preserve order due to influence...</span>
01474 <a class="code" href="a04199.html#a16">nlctassert</a>(CInstanceGroup::NumStaticLightPerInstance==2);
01475 <span class="keywordflow">if</span>(cell.Light[0] == 0xFF) swap(cell.Light[0], cell.Light[1]);
01476
01477 <span class="comment">// Do it for Ambientlight</span>
01478 <span class="keywordflow">if</span>(cellInfo.LocalAmbientLight == NULL)
01479 cell.LocalAmbientId= 0xFF;
01480 <span class="keywordflow">else</span>
01481 <span class="comment">// NB: may still be 0xFF if 'Too many static light' bug.</span>
01482 cell.LocalAmbientId= ((CPointLightRT*)cellInfo.LocalAmbientLight)->DstId;
01483 }
01484
01485 <span class="comment">// next cell</span>
01486 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_9">nextCell</a>();
01487 }
01488 }
01489
01490
01491 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLightera3" doxytag="NL3D::CInstanceLighter::progress" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual void NL3D::CInstanceLighter::progress </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const char * </td>
<td class="mdname" nowrap> <em>message</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>float </td>
<td class="mdname" nowrap> <em>progress</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00159">159</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01023">compilePointLightRT()</a>, <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01502">lightIgSimple()</a>, <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>, and <a class="el" href="a05824.html#l01623">progressCell()</a>.
<p>
<div class="fragment"><pre>00159 {};
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_10" doxytag="NL3D::CInstanceLighter::progressCell" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CInstanceLighter::progressCell </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const char * </td>
<td class="mdname1" valign="top" nowrap> <em>message</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05824.html#l01623">1623</a> of file <a class="el" href="a05824.html">instance_lighter.cpp</a>.
<p>
References <a class="el" href="a05825.html#l00296">_LastCellProgress</a>, <a class="el" href="a05825.html#l00284">getCurrentCellNumber()</a>, <a class="el" href="a05825.html#l00285">getTotalCellNumber()</a>, and <a class="el" href="a05825.html#l00159">progress()</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l01801">dilateLightingOnSurfaceCells()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>.
<p>
<div class="fragment"><pre>01624 {
01625 <span class="keywordtype">float</span> cp= <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_3">getCurrentCellNumber</a>() / float(<a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_6">getTotalCellNumber</a>());
01626 <span class="keywordflow">if</span>( cp > <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_17">_LastCellProgress</a>+0.05f)
01627 {
01628 <a class="code" href="a02675.html#NL3D_1_1CInstanceLightera3">progress</a>(message, cp);
01629 <a class="code" href="a02675.html#NL3D_1_1CInstanceLighterz209_17">_LastCellProgress</a>= cp;
01630 }
01631 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CInstanceLighterr0" doxytag="NL3D::CInstanceLighter::_CurrentInstanceComputed" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr0">NL3D::CInstanceLighter::_CurrentInstanceComputed</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00210">210</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterr1" doxytag="NL3D::CInstanceLighter::_IGRetrieverGridMap" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02654.html#NL3D_1_1CIGSurfaceLightw1">CIGSurfaceLight::TRetrieverGridMap</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr1">NL3D::CInstanceLighter::_IGRetrieverGridMap</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00214">214</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l00305">light()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterr2" doxytag="NL3D::CInstanceLighter::_IGSurfaceLightBuild" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02656.html">CIGSurfaceLightBuild</a>* <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr2">NL3D::CInstanceLighter::_IGSurfaceLightBuild</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00212">212</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l00066">CInstanceLighter()</a>, <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l00305">light()</a>, <a class="el" href="a05824.html#l01663">nextCell()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterr3" doxytag="NL3D::CInstanceLighter::_InstanceInfos" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> std::vector<<a class="el" href="a02676.html">CInstanceInfo</a>> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr3">NL3D::CInstanceLighter::_InstanceInfos</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00208">208</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00633">computeSunContribution()</a>, <a class="el" href="a05824.html#l00305">light()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterr4" doxytag="NL3D::CInstanceLighter::_Instances" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> std::vector<<a class="el" href="a02672.html">CInstanceGroup::CInstance</a>> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr4">NL3D::CInstanceLighter::_Instances</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00206">206</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_11" doxytag="NL3D::CInstanceLighter::_IsEndCell" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_11">NL3D::CInstanceLighter::_IsEndCell</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00293">293</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01699">isEndCell()</a>, <a class="el" href="a05824.html#l00305">light()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_12" doxytag="NL3D::CInstanceLighter::_ItCellId" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_12">NL3D::CInstanceLighter::_ItCellId</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00292">292</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_13" doxytag="NL3D::CInstanceLighter::_ItCurrentCellNumber" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_13">NL3D::CInstanceLighter::_ItCurrentCellNumber</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00294">294</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05825.html#l00284">getCurrentCellNumber()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_14" doxytag="NL3D::CInstanceLighter::_ItRetriever" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02654.html#NL3D_1_1CIGSurfaceLightw0">CIGSurfaceLight::ItRetrieverGridMap</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_14">NL3D::CInstanceLighter::_ItRetriever</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00289">289</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_15" doxytag="NL3D::CInstanceLighter::_ItRetrieverInfo" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02656.html#NL3D_1_1CIGSurfaceLightBuildw1">CIGSurfaceLightBuild::ItRetrieverGridMap</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_15">NL3D::CInstanceLighter::_ItRetrieverInfo</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00290">290</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_16" doxytag="NL3D::CInstanceLighter::_ItSurfId" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_16">NL3D::CInstanceLighter::_ItSurfId</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00291">291</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, <a class="el" href="a05824.html#l01705">getCurrentCell()</a>, <a class="el" href="a05824.html#l01714">getCurrentCellInfo()</a>, <a class="el" href="a05824.html#l01757">getCurrentNeighborCell()</a>, <a class="el" href="a05824.html#l01779">getCurrentNeighborCellInfo()</a>, <a class="el" href="a05824.html#l01724">isCurrentNeighborCellInSurface()</a>, and <a class="el" href="a05824.html#l01663">nextCell()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_17" doxytag="NL3D::CInstanceLighter::_LastCellProgress" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> float <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_17">NL3D::CInstanceLighter::_LastCellProgress</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00296">296</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01635">beginCell()</a>, and <a class="el" href="a05824.html#l01623">progressCell()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterr5" doxytag="NL3D::CInstanceLighter::_StaticPointLightQuadGrid" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a03273.html">CQuadGrid</a><<a class="el" href="a02678.html">CPointLightRT</a>*> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr5">NL3D::CInstanceLighter::_StaticPointLightQuadGrid</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
QuadGrid of PointLights. Builded from _StaticPointLights.
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00255">255</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l01023">compilePointLightRT()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterr6" doxytag="NL3D::CInstanceLighter::_StaticPointLights" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> std::vector<<a class="el" href="a02678.html">CPointLightRT</a>> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterr6">NL3D::CInstanceLighter::_StaticPointLights</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
List of PointLights.
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00253">253</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05824.html#l00999">addStaticPointLight()</a>, <a class="el" href="a05824.html#l01023">compilePointLightRT()</a>, and <a class="el" href="a05824.html#l01161">processIGPointLightRT()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CInstanceLighterz209_18" doxytag="NL3D::CInstanceLighter::_TotalCellNumber" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02675.html#NL3D_1_1CInstanceLighterz209_18">NL3D::CInstanceLighter::_TotalCellNumber</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a05825.html#l00295">295</a> of file <a class="el" href="a05825.html">instance_lighter.h</a>.
<p>
Referenced by <a class="el" href="a05825.html#l00285">getTotalCellNumber()</a>, and <a class="el" href="a05824.html#l00305">light()</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a05825.html">instance_lighter.h</a><li><a class="el" href="a05824.html">instance_lighter.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:47:40 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.6 </small></address>
</body>
</html>
|