aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a02363.html
blob: 79d8a918c142a25092e391ca8cb4b85e2afd094e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
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
<!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: NLSOUND::CClusteredSound class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NLSOUND::CClusteredSound Class Reference</h1><code>#include &lt;<a class="el" href="a05566.html">clustered_sound.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class will manage the clipping/positioning/occlusion of sound placed inside the cluster/portal system.<p>
<dl compact><dt><b>Author:</b></dt><dd>Boris Boucher <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2002 </dd></dl>

<p>

<p>
Definition at line <a class="el" href="a05566.html#l00058">58</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map&lt; <a class="el" href="a02362.html">NL3D::CCluster</a> *,<br>
 <a class="el" href="a02365.html">CClusterSoundStatus</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundw0">TClusterStatusMap</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Container for audible cluster status.  <a href="#NLSOUND_1_1CClusteredSoundw0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map&lt; <a class="el" href="a02362.html">NL3D::CCluster</a> *,<br>
 <a class="el" href="a02366.html">CSoundTravContext</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundw1">TClusterTravContextMap</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Container for the next traversal step.  <a href="#NLSOUND_1_1CClusteredSoundw1"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSounda0">CClusteredSound</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#NLSOUND_1_1CClusteredSounda0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundw0">TClusterStatusMap</a> &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSounda1">getAudibleClusters</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>const std::vector&lt; std::pair&lt;<br>
 <a class="el" href="a03128.html">NLMISC::CVector</a>, <a class="el" href="a03128.html">NLMISC::CVector</a> &gt; &gt; &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSounda2">getAudioPath</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a02365.html">CClusterSoundStatus</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSounda3">getClusterSoundStatus</a> (<a class="el" href="a02362.html">NL3D::CCluster</a> *cluster)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02362.html">NL3D::CCluster</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSounda4">getRootCluster</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSounda5">init</a> (<a class="el" href="a03348.html">NL3D::CScene</a> *scene, float portalInterpolate, float maxEarDistance, float minGain)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSounda6">update</a> (const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;listenerPos, const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;view, const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;up)</td></tr>

<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundd0">addAudibleCluster</a> (<a class="el" href="a02362.html">NL3D::CCluster</a> *cluster, <a class="el" href="a02365.html">CClusterSoundStatus</a> &amp;soundStatus)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a cluster into the list of audible cluster.  <a href="#NLSOUND_1_1CClusteredSoundd0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundd1">addNextTraverse</a> (<a class="el" href="a02362.html">NL3D::CCluster</a> *cluster, <a class="el" href="a02366.html">CSoundTravContext</a> &amp;travContext)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a cluster for the next traversal step.  <a href="#NLSOUND_1_1CClusteredSoundd1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">NLMISC::CVector</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundd2">interpolateSourceDirection</a> (const <a class="el" href="a02366.html">CSoundTravContext</a> &amp;context, float portalDist, const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;nearPoint, const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;realListener, <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;d1, <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;d2, float &amp;<a class="el" href="a04223.html#a663">alpha</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compute a positional blending depending on context.  <a href="#NLSOUND_1_1CClusteredSoundd2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundd3">soundTraverse</a> (const std::vector&lt; <a class="el" href="a02362.html">NL3D::CCluster</a> * &gt; &amp;clusters, <a class="el" href="a02366.html">CSoundTravContext</a> &amp;travContext)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Traverse the cluster system to build/update the audible cluster set and theire respective status.  <a href="#NLSOUND_1_1CClusteredSoundd3"></a><br><br></td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundz1297_0">getAABoxNearestPos</a> (const <a class="el" href="a02156.html">NLMISC::CAABBox</a> &amp;box, const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;pos, <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;nearPos)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundz1297_1">getPolyNearestPos</a> (const std::vector&lt; <a class="el" href="a03128.html">NLMISC::CVector</a> &gt; &amp;poly, const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;pos, <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;nearPoint)</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="a02363.html#NLSOUND_1_1CClusteredSoundw0">TClusterStatusMap</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The current audible cluster.  <a href="#NLSOUND_1_1CClusteredSoundr0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; std::pair&lt; <a class="el" href="a03128.html">NLMISC::CVector</a>,<br>
 <a class="el" href="a03128.html">NLMISC::CVector</a> &gt; &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr1">_AudioPath</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The segment of all the audio path.  <a href="#NLSOUND_1_1CClusteredSoundr1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::hash_map&lt; <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>,<br>
 <a class="el" href="a04558.html#a15">uint</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr2">_IdToEaxEnv</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The mapping for env name Id to EAX environement number.  <a href="#NLSOUND_1_1CClusteredSoundr2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::hash_map&lt; <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>,<br>
 <a class="el" href="a04558.html#a15">uint</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr3">_IdToMaterial</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The mapping for occlusion material name to material number.  <a href="#NLSOUND_1_1CClusteredSoundr3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr4">_LastEnv</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The last setted environement.  <a href="#NLSOUND_1_1CClusteredSoundr4"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Maximum earing distance.  <a href="#NLSOUND_1_1CClusteredSoundr5"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr6">_MinGain</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Minimum gain.  <a href="#NLSOUND_1_1CClusteredSoundr6"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundw1">TClusterTravContextMap</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The cluster for the next travesal step.  <a href="#NLSOUND_1_1CClusteredSoundr7"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr8">_PortalInterpolate</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Interpolation distance when listener is near a portal.  <a href="#NLSOUND_1_1CClusteredSoundr8"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02362.html">NL3D::CCluster</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr9">_RootCluster</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The root cluster of the scene.  <a href="#NLSOUND_1_1CClusteredSoundr9"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03348.html">NL3D::CScene</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The scene of interest.  <a href="#NLSOUND_1_1CClusteredSoundr10"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::hash_map&lt; <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>,<br>
 <a class="el" href="a05378.html#a236">NLMISC::TStringId</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr11">_SoundGroupToSound</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The sound_group to sound assoc.  <a href="#NLSOUND_1_1CClusteredSoundr11"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::hash_map&lt; <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>,<br>
 <a class="el" href="a02364.html">CClusterSound</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr12">_Sources</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The current cluster playing source indexed with sound group id.  <a href="#NLSOUND_1_1CClusteredSoundr12"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Static Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundv0">_EnvironmentNames</a> []</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The environment name table for init.  <a href="#NLSOUND_1_1CClusteredSoundv0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundv1">_MaterialNames</a> []</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The material name table for init.  <a href="#NLSOUND_1_1CClusteredSoundv1"></a><br><br></td></tr>
</table>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundw0" doxytag="NLSOUND::CClusteredSound::TClusterStatusMap" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> typedef std::map&lt;<a class="el" href="a02362.html">NL3D::CCluster</a>*, <a class="el" href="a02365.html">CClusterSoundStatus</a>&gt; <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundw0">NLSOUND::CClusteredSound::TClusterStatusMap</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Container for audible cluster status. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00087">87</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05566.html#l00198">getAudibleClusters()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundw1" doxytag="NLSOUND::CClusteredSound::TClusterTravContextMap" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> typedef std::map&lt;<a class="el" href="a02362.html">NL3D::CCluster</a>*, <a class="el" href="a02366.html">CSoundTravContext</a>&gt; <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundw1">NLSOUND::CClusteredSound::TClusterTravContextMap</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Container for the next traversal step. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00175">175</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.    </td>
  </tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CClusteredSounda0" doxytag="NLSOUND::CClusteredSound::CClusteredSound" ></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"> NLSOUND::CClusteredSound::CClusteredSound </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
Constructor. 
<p>

<p>
Definition at line <a class="el" href="a05565.html#l00222">222</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a05565.html#l00051">_EnvironmentNames</a>, <a class="el" href="a05566.html#l00267">_IdToEaxEnv</a>, <a class="el" href="a05566.html#l00269">_IdToMaterial</a>, <a class="el" href="a05565.html#l00081">_MaterialNames</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00223 :       <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a>(0),
00224         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr9">_RootCluster</a>(0),
00225         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr4">_LastEnv</a>(0xffffffff)
00226 {
00227         <span class="comment">// fill the env name table</span>
00228         <a class="code" href="a04558.html#a15">uint</a> i;
00229         <span class="keywordflow">for</span> (i=0; <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundv0">_EnvironmentNames</a>[i] != 0; ++i)
00230         {
00231                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr2">_IdToEaxEnv</a>.insert(make_pair(CStringMapper::map(string(_EnvironmentNames[i])), i));
00232         }
00233         <span class="comment">// fill the material name table</span>
00234         <span class="keywordflow">for</span> (i=0; <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundv1">_MaterialNames</a>[i] != 0; ++i)
00235         {
00236                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr3">_IdToMaterial</a>.insert(make_pair(CStringMapper::map(string(_MaterialNames[i])), i));
00237         }
00238 
00239 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundd0" doxytag="NLSOUND::CClusteredSound::addAudibleCluster" ></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 NLSOUND::CClusteredSound::addAudibleCluster </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02362.html">NL3D::CCluster</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>cluster</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a02365.html">CClusterSoundStatus</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>soundStatus</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
Add a cluster into the list of audible cluster. 
<p>

<p>
Definition at line <a class="el" href="a05565.html#l00957">957</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a05566.html#l00252">_AudibleClusters</a>, <a class="el" href="a05566.html#l00244">_MaxEarDistance</a>, <a class="el" href="a05566.html#l00075">NLSOUND::CClusteredSound::CClusterSoundStatus::Direction</a>, <a class="el" href="a05566.html#l00067">NLSOUND::CClusteredSound::CClusterSoundStatus::Dist</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a06682.html#l00115">NLMISC::CVector::norm()</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00481">soundTraverse()</a>.
<p>
<div class="fragment"><pre>00958 {
00959         TClusterStatusMap::iterator it(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>.find(cluster));
00960         <a class="code" href="a04199.html#a6">nlassert</a>(soundStatus.Dist &lt; _MaxEarDistance);
00961         <a class="code" href="a04199.html#a6">nlassert</a>(soundStatus.Direction.norm() &lt;= 1.01f);
00962 
00963         <span class="keywordflow">if</span> (it != <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>.end())
00964         {
00965                 <span class="comment">// get the best one (for now, based on shortest distance)</span>
00966                 <span class="keywordflow">if</span> (soundStatus.Dist &lt; it-&gt;second.Dist)
00967                 {
00968                         it-&gt;second = soundStatus;
00969 
00970                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00971                 }
00972         }
00973         <span class="keywordflow">else</span>
00974         {
00975                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>.insert(make_pair(cluster, soundStatus));
00976                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00977         }
00978 
00979         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00980 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundd1" doxytag="NLSOUND::CClusteredSound::addNextTraverse" ></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 NLSOUND::CClusteredSound::addNextTraverse </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02362.html">NL3D::CCluster</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>cluster</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a02366.html">CSoundTravContext</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>travContext</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
Add a cluster for the next traversal step. 
<p>

<p>
Definition at line <a class="el" href="a05565.html#l00941">941</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a05566.html#l00254">_NextTraversalStep</a>, and <a class="el" href="a05566.html#l00099">NLSOUND::CClusteredSound::CSoundTravContext::Dist</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00481">soundTraverse()</a>.
<p>
<div class="fragment"><pre>00942 {
00943         std::map&lt;CCluster*, CSoundTravContext&gt;::iterator it = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a>.find(cluster);
00944 
00945         <span class="keywordflow">if</span> (it != <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a>.end())
00946         {
00947                 <span class="keywordflow">if</span> (it-&gt;second.Dist &gt; travContext.Dist)
00948                 {
00949                         it-&gt;second = travContext;
00950                 }
00951         }
00952         <span class="keywordflow">else</span>
00953                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a>.insert(make_pair(cluster, travContext));
00954 
00955 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundz1297_0" doxytag="NLSOUND::CClusteredSound::getAABoxNearestPos" ></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 NLSOUND::CClusteredSound::getAABoxNearestPos </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a02156.html">NLMISC::CAABBox</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>box</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>pos</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>nearPos</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
Compute the point in the bounding box that is the nearest from a given position. This point can be in the volume of the box, on a segment of one of the vertex. In addition, the method also return the distance from the nearest point to the reference position. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>poly</em>&nbsp;</td><td>The bounding box description. </td></tr>
    <tr><td valign=top><em>pos</em>&nbsp;</td><td>The reference position. </td></tr>
    <tr><td valign=top><em>nearPoint</em>&nbsp;</td><td>The nearest point (out var). </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The distance between pos and nearPoint.</dd></dl>

<p>
Definition at line <a class="el" href="a05565.html#l01155">1155</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a05587.html#l00115">NLMISC::clamp()</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="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="a05565.html#l00481">soundTraverse()</a>.
<p>
<div class="fragment"><pre>01156 {
01157         CVector vMin, vMax;
01158         box.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_5">getMin</a>(vMin);
01159         box.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_3">getMax</a>(vMax);
01160 
01161 
01162         nearPos = pos;
01163         <span class="comment">// X</span>
01164         <a class="code" href="a05378.html#a374">clamp</a>(nearPos.<a class="code" href="a03128.html#NLMISC_1_1CVectoro0">x</a>, vMin.x, vMax.x);
01165         <span class="comment">// Y</span>
01166         <a class="code" href="a05378.html#a374">clamp</a>(nearPos.<a class="code" href="a03128.html#NLMISC_1_1CVectoro1">y</a>, vMin.y, vMax.y);
01167         <span class="comment">// Z</span>
01168         <a class="code" href="a05378.html#a374">clamp</a>(nearPos.<a class="code" href="a03128.html#NLMISC_1_1CVectoro2">z</a>, vMin.z, vMax.z);
01169 
01170         <span class="keywordflow">return</span> (pos-nearPos).norm();
01171 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSounda1" doxytag="NLSOUND::CClusteredSound::getAudibleClusters" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> const <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundw0">TClusterStatusMap</a>&amp; NLSOUND::CClusteredSound::getAudibleClusters </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>

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

<p>

<p>
Definition at line <a class="el" href="a05566.html#l00198">198</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
References <a class="el" href="a05566.html#l00252">_AudibleClusters</a>, and <a class="el" href="a05566.html#l00087">TClusterStatusMap</a>.
<p>
<div class="fragment"><pre>00198 {<span class="keywordflow">return</span> <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>;}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSounda2" doxytag="NLSOUND::CClusteredSound::getAudioPath" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> const std::vector&lt;std::pair&lt;<a class="el" href="a03128.html">NLMISC::CVector</a>, <a class="el" href="a03128.html">NLMISC::CVector</a>&gt; &gt;&amp; NLSOUND::CClusteredSound::getAudioPath </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>

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

<p>

<p>
Definition at line <a class="el" href="a05566.html#l00200">200</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
References <a class="el" href="a05566.html#l00258">_AudioPath</a>.
<p>
<div class="fragment"><pre>00200 { <span class="keywordflow">return</span> <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr1">_AudioPath</a>;}
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSounda3" doxytag="NLSOUND::CClusteredSound::getClusterSoundStatus" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> const <a class="el" href="a02365.html">CClusteredSound::CClusterSoundStatus</a> * NLSOUND::CClusteredSound::getClusterSoundStatus </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02362.html">NL3D::CCluster</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>cluster</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>

<p>
Definition at line <a class="el" href="a05565.html#l00459">459</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a05566.html#l00252">_AudibleClusters</a>.
<p>
Referenced by <a class="el" href="a05465.html#l01268">NLSOUND::CAudioMixerUser::update()</a>, and <a class="el" href="a05471.html#l00861">NLSOUND::CBackgroundSoundManager::updateBackgroundStatus()</a>.
<p>
<div class="fragment"><pre>00460 {
00461         TClusterStatusMap::iterator it(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>.find(cluster));
00462 
00463         <span class="keywordflow">if</span> (it == <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>.end())
00464         {
00465                 <span class="keywordflow">return</span> 0;
00466         }
00467         <span class="keywordflow">else</span>
00468                 <span class="keywordflow">return</span> &amp;(it-&gt;second);
00469 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundz1297_1" doxytag="NLSOUND::CClusteredSound::getPolyNearestPos" ></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 NLSOUND::CClusteredSound::getPolyNearestPos </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const std::vector&lt; <a class="el" href="a03128.html">NLMISC::CVector</a> &gt; &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>poly</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>pos</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>nearPoint</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
Compute the point on the poly that is the nearest from a given position. This point can be on the surface of the poly, on a segment or on one of the vertex. In addition, the method also return the distance from the nearest point to the reference position. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>poly</em>&nbsp;</td><td>The polygone description. </td></tr>
    <tr><td valign=top><em>pos</em>&nbsp;</td><td>The reference position. </td></tr>
    <tr><td valign=top><em>nearPoint</em>&nbsp;</td><td>The nearest point (out var). </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The distance between pos and nearPoint.</dd></dl>

<p>
Definition at line <a class="el" href="a05565.html#l01098">1098</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a06172.html#l00035">NLMISC::CPlane::getNormal()</a>, <a class="el" href="a06170.html#l00036">NLMISC::CPlane::make()</a>, <a class="el" href="a06682.html#l00115">NLMISC::CVector::norm()</a>, <a class="el" href="a06172.html#l00062">NLMISC::CPlane::project()</a>, <a class="el" href="a06682.html#l00111">NLMISC::CVector::sqrnorm()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00481">soundTraverse()</a>.
<p>
<div class="fragment"><pre>01099 {
01100         <a class="code" href="a03082.html">CPlane</a> plane;
01101         plane.<a class="code" href="a03082.html#NLMISC_1_1CPlanez1990_2">make</a>(poly[0], poly[1], poly[2]);
01102         CVector proj = plane.<a class="code" href="a03082.html#NLMISC_1_1CPlanez1992_7">project</a>(pos);
01103         <span class="keywordtype">float</span>   minDist = FLT_MAX;
01104         <span class="keywordtype">bool</span>    projIn = <span class="keyword">true</span>;
01105         <a class="code" href="a04558.html#a15">uint</a>    nbVertex = poly.size();
01106 
01107         <span class="comment">// loop throw all vertex</span>
01108         <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> j=0; j&lt;nbVertex; ++j)
01109         {
01110                 <span class="keywordtype">float</span> d = (pos-poly[j]).sqrnorm();
01111                 <span class="comment">// check if the vertex is the nearest point</span>
01112                 <span class="keywordflow">if</span> (d &lt; minDist)
01113                 {
01114                         nearPoint = poly[j];
01115                         minDist = d;
01116                 }
01117 <span class="comment">//              if (projIn /*&amp;&amp; j&lt;poly.size()-1*/)</span>
01118                 {
01119                         <span class="comment">// check each segment</span>
01120                         <span class="keywordflow">if</span> (plane.<a class="code" href="a03082.html#NLMISC_1_1CPlanez1990_0">getNormal</a>()*((poly[(j+1)%nbVertex] - poly[j]) ^ (proj - poly[j])) &lt; 0)
01121                         {
01122                                 <span class="comment">// the point is not inside the poly surface !</span>
01123                                 projIn = <span class="keyword">false</span>;
01124                                 <span class="comment">// check if the nearest point is on this segment</span>
01125                                 CVector v1 = (poly[(j+1)%nbVertex] - poly[j]);
01126                                 <span class="keywordtype">float</span> v1Len = v1.<a class="code" href="a03128.html#NLMISC_1_1CVectorz2049_0">norm</a>();
01127                                 v1 = v1 / v1Len;
01128                                 CVector v2 = proj - poly[j];
01129                                 <span class="comment">// project v2 on v1</span>
01130                                 <span class="keywordtype">float</span> p = v1 * v2;
01131                                 <span class="keywordflow">if</span> (p&gt;=0 &amp;&amp; p&lt;=v1Len)
01132                                 {
01133                                         <span class="comment">// the nearest point is on the segment! </span>
01134                                         nearPoint = poly[j] + v1 * p;
01135                                         minDist = (nearPoint-pos).<a class="code" href="a03128.html#NLMISC_1_1CVectorz2049_5">sqrnorm</a>();
01136                                         <span class="keywordflow">break</span>;
01137                                 }
01138                         }
01139                 }
01140         }
01141         <span class="keywordflow">if</span> (projIn)
01142         {
01143                 <span class="keywordtype">float</span> d = (proj-pos).sqrnorm();
01144                 <span class="keywordflow">if</span> (d &lt; minDist)
01145                 {
01146                         <span class="comment">// the nearest point is on the surface</span>
01147                         nearPoint = proj;
01148                         minDist = d;
01149                 }
01150         }
01151         
01152         <span class="keywordflow">return</span> sqrtf(minDist);
01153 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSounda4" doxytag="NLSOUND::CClusteredSound::getRootCluster" ></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="a02362.html">NL3D::CCluster</a> * NLSOUND::CClusteredSound::getRootCluster </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>

<p>
Definition at line <a class="el" href="a05565.html#l00472">472</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a06349.html#l00475">NL3D::CScene::getClipTrav()</a>.
<p>
Referenced by <a class="el" href="a05471.html#l00861">NLSOUND::CBackgroundSoundManager::updateBackgroundStatus()</a>.
<p>
<div class="fragment"><pre>00473 {
00474         <span class="keywordflow">if</span> (<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a> == 0)
00475                 <span class="keywordflow">return</span> 0;
00476 
00477         <span class="keywordflow">return</span> <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a>-&gt;<a class="code" href="a03348.html#NL3D_1_1CScenez820_1">getClipTrav</a>().<a class="code" href="a02353.html#NL3D_1_1CClipTravo4">RootCluster</a>;
00478 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSounda5" doxytag="NLSOUND::CClusteredSound::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 NLSOUND::CClusteredSound::init </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a03348.html">NL3D::CScene</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>scene</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>portalInterpolate</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>maxEarDistance</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>minGain</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

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

<p>
Initialize the class <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>scene</em>&nbsp;</td><td>The scene of interest for cluster management. </td></tr>
    <tr><td valign=top><em>portalInterpolate</em>&nbsp;</td><td>Ditance from listener to portal for interpolation. </td></tr>
    <tr><td valign=top><em>maxEarDist</em>&nbsp;</td><td>The maximum traversal distance to limit graph traversal. </td></tr>
    <tr><td valign=top><em>minGain</em>&nbsp;</td><td>The minimun gain to stop traversal.</td></tr>
  </table>
</dl>

<p>
Definition at line <a class="el" href="a05565.html#l00242">242</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a05566.html#l00244">_MaxEarDistance</a>, <a class="el" href="a05566.html#l00246">_MinGain</a>, <a class="el" href="a05566.html#l00242">_PortalInterpolate</a>, <a class="el" href="a05566.html#l00248">_RootCluster</a>, <a class="el" href="a05566.html#l00264">_SoundGroupToSound</a>, <a class="el" href="a05565.html#l00219">NLSOUND::Container</a>, and <a class="el" href="a06349.html#l00475">NL3D::CScene::getClipTrav()</a>.
<p>
Referenced by <a class="el" href="a05465.html#l00204">NLSOUND::CAudioMixerUser::initClusteredSound()</a>.
<p>
<div class="fragment"><pre>00243 {
00244         <span class="comment">// load the sound_group sheets</span>
00245         ::loadForm(<span class="stringliteral">"sound_group"</span>, CAudioMixerUser::instance()-&gt;getPackedSheetPath()+<span class="stringliteral">"sound_groups.packed_sheets"</span>, <a class="code" href="a05381.html#a6">Container</a>, CAudioMixerUser::instance()-&gt;getPackedSheetUpdate(), <span class="keyword">false</span>);
00246 
00247         <span class="comment">// copy the container data into internal structure</span>
00248         std::map&lt;std::string, CSoundGroupSerializer&gt;::iterator first(<a class="code" href="a05381.html#a6">Container</a>.begin()), last(<a class="code" href="a05381.html#a6">Container</a>.end());
00249         <span class="keywordflow">for</span> (; first != last; ++first)
00250         {
00251                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr11">_SoundGroupToSound</a>.insert(first-&gt;second._SoundGroupAssoc.begin(), first-&gt;second._SoundGroupAssoc.end());
00252         }
00253         
00254         <span class="comment">// and clear the temporary Container </span>
00255         <a class="code" href="a05381.html#a6">Container</a>.clear();
00256 
00257         
00258         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a> = scene;
00259         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr8">_PortalInterpolate</a> = portalInterpolate;
00260         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a> = maxEarDist;
00261         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr6">_MinGain</a> = minGain;
00262         <span class="keywordflow">if</span>(scene != 0)
00263         {
00264                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr9">_RootCluster</a> = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a>-&gt;<a class="code" href="a03348.html#NL3D_1_1CScenez820_1">getClipTrav</a>().<a class="code" href="a02353.html#NL3D_1_1CClipTravo4">RootCluster</a>;
00265         }
00266         <span class="keywordflow">else</span>
00267                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr9">_RootCluster</a> = 0;
00268 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundd2" doxytag="NLSOUND::CClusteredSound::interpolateSourceDirection" ></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"> CVector NLSOUND::CClusteredSound::interpolateSourceDirection </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a02366.html">CSoundTravContext</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>context</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>portalDist</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>nearPoint</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>realListener</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>d1</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>d2</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>alpha</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
Compute a positional blending depending on context. 
<p>

<p>
Definition at line <a class="el" href="a05565.html#l00982">982</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a05566.html#l00242">_PortalInterpolate</a>, <a class="el" href="a05646.html#l01173">alpha</a>, <a class="el" href="a05566.html#l00105">NLSOUND::CClusteredSound::CSoundTravContext::NbPortal</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06682.html#l00115">NLMISC::CVector::norm()</a>, and <a class="el" href="a06682.html#l00125">NLMISC::CVector::normed()</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00481">soundTraverse()</a>.
<p>
<div class="fragment"><pre>00983 {
00984         CVector direction;<span class="comment">// (context.Direction);</span>
00985 
00986         <span class="keywordflow">if</span> (portalDist &gt; <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr8">_PortalInterpolate</a> || <a class="code" href="a04223.html#a663">alpha</a> &gt;= 1.0f)
00987         {
00988                 <span class="comment">// the portal is too far, no interpolation.</span>
00989                 <span class="keywordflow">if</span> (context.NbPortal == 0)
00990                 {
00991                         <span class="comment">// it's the first portal, compute the initial virtual sound direction</span>
00992                         direction = d1 = (nearPoint-realListener).<a class="code" href="a03128.html#NLMISC_1_1CVectorz2049_2">normed</a>();
00993                 }
00994                 <span class="keywordflow">else</span>
00995                 {
00996                         direction = (nearPoint-realListener).normed();
00997                         direction = (direction * (1-<a class="code" href="a04223.html#a663">alpha</a>) + d1 * (<a class="code" href="a04223.html#a663">alpha</a>)).normed();
00998                         d1 = direction;
00999                 }
01000                 <a class="code" href="a04223.html#a663">alpha</a> = 1;
01001         }
01002         <span class="keywordflow">else</span>
01003         {
01004                 <span class="comment">// the portal is near the listener, interpolate the direction</span>
01005                 <span class="keywordflow">if</span> (context.NbPortal == 0)
01006                 {
01007                         <span class="comment">// It's the first portal, compute the initial direction</span>
01008                         <a class="code" href="a04223.html#a663">alpha</a> = (portalDist / <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr8">_PortalInterpolate</a>);
01009 <span class="comment">//                      alpha = alpha*alpha*alpha;</span>
01010                         direction = d1 = (nearPoint-realListener).<a class="code" href="a03128.html#NLMISC_1_1CVectorz2049_2">normed</a>();
01011                 }
01012 <span class="comment">/*              else if (context.NbPortal == 1)</span>
01013 <span class="comment">                {</span>
01014 <span class="comment">                        float factor = (1-alpha);</span>
01015 <span class="comment">//                      factor = factor*factor*factor;</span>
01016 <span class="comment">                        direction = (nearPoint-realListener).normed();</span>
01017 <span class="comment">                        direction = d1 = (direction * factor + d1 * (1-factor)).normed();</span>
01018 <span class="comment"></span>
01019 <span class="comment">//                      alpha = 1-factor;</span>
01020 <span class="comment">                        alpha = factor;</span>
01021 <span class="comment">                }</span>
01022 <span class="comment">*/</span>              <span class="keywordflow">else</span> 
01023                 {
01024                         <span class="comment">// two or more portal</span>
01025                         <span class="keywordtype">float</span> factor = (portalDist / <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr8">_PortalInterpolate</a>) * (1-<a class="code" href="a04223.html#a663">alpha</a>);
01026 <span class="comment">//                      factor = factor*factor*factor;</span>
01027                         direction = (nearPoint-realListener).normed();
01028                         direction = d1 = (direction * factor + d1 * <a class="code" href="a04223.html#a663">alpha</a>).<a class="code" href="a03128.html#NLMISC_1_1CVectorz2049_2">normed</a>();
01029 
01030 <span class="comment">//                      alpha = 1-factor;</span>
01031                         <a class="code" href="a04223.html#a663">alpha</a> = factor;
01032                 }
01033         }
01034 
01035         <a class="code" href="a04199.html#a6">nlassert</a>(direction.norm() &lt;= 1.01f);
01036         <span class="keywordflow">return</span> direction;
01037 <span class="comment">/*</span>
01038 <span class="comment">        CVector direction (context.Direction);</span>
01039 <span class="comment">        d1 = context.Direction1;</span>
01040 <span class="comment">        d2 = context.Direction2;</span>
01041 <span class="comment"></span>
01042 <span class="comment"></span>
01043 <span class="comment">        if (portalDist &lt; _PortalInterpolate)</span>
01044 <span class="comment">        {</span>
01045 <span class="comment">                if (context.NbPortal == 0)</span>
01046 <span class="comment">                {</span>
01047 <span class="comment">                        alpha = (portalDist / _PortalInterpolate);</span>
01048 <span class="comment">                        direction = d1 = (nearPoint-realListener).normed() * alpha;</span>
01049 <span class="comment">                        direction.normalize();</span>
01050 <span class="comment">                }</span>
01051 <span class="comment">                else if (context.NbPortal == 1)</span>
01052 <span class="comment">                {</span>
01053 <span class="comment">                        alpha = alpha * (portalDist / _PortalInterpolate);</span>
01054 <span class="comment">//                      d2 = (nearPoint-realListener).normed() * alpha;</span>
01055 <span class="comment">                        d2 = (nearPoint-context.ListenerPos).normed() * (1-alpha);</span>
01056 <span class="comment">                        direction = d1 + d2;</span>
01057 <span class="comment">                        direction.normalize();</span>
01058 <span class="comment">                }</span>
01059 <span class="comment">                else</span>
01060 <span class="comment">                {</span>
01061 <span class="comment">                        alpha = alpha * (portalDist / _PortalInterpolate);</span>
01062 <span class="comment">//                      d1 = d1+d2;</span>
01063 <span class="comment">                        d2 = (nearPoint-context.ListenerPos).normed() * (1-alpha);</span>
01064 <span class="comment">//                      direction = d1 + d2 + (nearPoint-context.ListenerPos).normed() * (1-alpha);</span>
01065 <span class="comment">                        direction = d1 + d2;</span>
01066 <span class="comment">                        direction.normalize();</span>
01067 <span class="comment">                }</span>
01068 <span class="comment">        }</span>
01069 <span class="comment">        else</span>
01070 <span class="comment">        {</span>
01071 <span class="comment">//              alpha = 0.0f</span>
01072 <span class="comment">                if (context.NbPortal == 0)</span>
01073 <span class="comment">                {</span>
01074 <span class="comment">                        direction = d1 = (nearPoint-realListener).normed();</span>
01075 <span class="comment">                }</span>
01076 <span class="comment">                else if (context.NbPortal == 1)</span>
01077 <span class="comment">                {</span>
01078 <span class="comment">                        d2 = (nearPoint-context.ListenerPos).normed() * (1-alpha);</span>
01079 <span class="comment">//                      d2 = d1; //(nearPoint-context.ListenerPos).normed(); // * (1-alpha);</span>
01080 <span class="comment">                        direction = d1+d2;</span>
01081 <span class="comment">                        direction.normalize();</span>
01082 <span class="comment">                }</span>
01083 <span class="comment">                else</span>
01084 <span class="comment">                {</span>
01085 <span class="comment">//                      d2 = (nearPoint-context.ListenerPos).normed() * (1-alpha);</span>
01086 <span class="comment">                        d1 = d1+d2;</span>
01087 <span class="comment">//                      d2 = (nearPoint-realListener).normed();</span>
01088 <span class="comment">//                      direction = d1+d2+(nearPoint-context.ListenerPos).normed() * (1-alpha);</span>
01089 <span class="comment">                        direction.normalize();</span>
01090 <span class="comment">                }</span>
01091 <span class="comment">        }</span>
01092 <span class="comment"></span>
01093 <span class="comment">        return direction;</span>
01094 <span class="comment">*/</span>
01095 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundd3" doxytag="NLSOUND::CClusteredSound::soundTraverse" ></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 NLSOUND::CClusteredSound::soundTraverse </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const std::vector&lt; <a class="el" href="a02362.html">NL3D::CCluster</a> * &gt; &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>clusters</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a02366.html">CSoundTravContext</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>travContext</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
Traverse the cluster system to build/update the audible cluster set and theire respective status. 
<p>

<p>
Definition at line <a class="el" href="a05565.html#l00481">481</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a05566.html#l00252">_AudibleClusters</a>, <a class="el" href="a05566.html#l00258">_AudioPath</a>, <a class="el" href="a05566.html#l00269">_IdToMaterial</a>, <a class="el" href="a05566.html#l00244">_MaxEarDistance</a>, <a class="el" href="a05566.html#l00246">_MinGain</a>, <a class="el" href="a05566.html#l00254">_NextTraversalStep</a>, <a class="el" href="a05566.html#l00242">_PortalInterpolate</a>, <a class="el" href="a05566.html#l00248">_RootCluster</a>, <a class="el" href="a05565.html#l00957">addAudibleCluster()</a>, <a class="el" href="a05565.html#l00941">addNextTraverse()</a>, <a class="el" href="a05566.html#l00107">NLSOUND::CClusteredSound::CSoundTravContext::Alpha</a>, <a class="el" href="a05646.html#l01173">alpha</a>, <a class="el" href="a05566.html#l00113">NLSOUND::CClusteredSound::CSoundTravContext::Direction</a>, <a class="el" href="a05566.html#l00075">NLSOUND::CClusteredSound::CClusterSoundStatus::Direction</a>, <a class="el" href="a05566.html#l00109">NLSOUND::CClusteredSound::CSoundTravContext::Direction1</a>, <a class="el" href="a05566.html#l00111">NLSOUND::CClusteredSound::CSoundTravContext::Direction2</a>, <a class="el" href="a05566.html#l00099">NLSOUND::CClusteredSound::CSoundTravContext::Dist</a>, <a class="el" href="a05566.html#l00067">NLSOUND::CClusteredSound::CClusterSoundStatus::Dist</a>, <a class="el" href="a05566.html#l00069">NLSOUND::CClusteredSound::CClusterSoundStatus::DistFactor</a>, <a class="el" href="a05565.html#l00109">NLSOUND::EAX_MATERIAL_PARAM</a>, <a class="el" href="a05564.html#l00163">NL3D::CCluster::FatherAudible</a>, <a class="el" href="a05566.html#l00101">NLSOUND::CClusteredSound::CSoundTravContext::FilterUnvisibleChild</a>, <a class="el" href="a05566.html#l00103">NLSOUND::CClusteredSound::CSoundTravContext::FilterUnvisibleFather</a>, <a class="el" href="a05566.html#l00093">NLSOUND::CClusteredSound::CSoundTravContext::Gain</a>, <a class="el" href="a05566.html#l00065">NLSOUND::CClusteredSound::CClusterSoundStatus::Gain</a>, <a class="el" href="a05565.html#l01155">getAABoxNearestPos()</a>, <a class="el" href="a05565.html#l01098">getPolyNearestPos()</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a05565.html#l00982">interpolateSourceDirection()</a>, <a class="el" href="a05566.html#l00120">NLSOUND::CClusteredSound::CSoundTravContext::ListenerPos</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05566.html#l00105">NLSOUND::CClusteredSound::CSoundTravContext::NbPortal</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a06682.html#l00125">NLMISC::CVector::normed()</a>, <a class="el" href="a05566.html#l00097">NLSOUND::CClusteredSound::CSoundTravContext::Obstruction</a>, <a class="el" href="a05566.html#l00083">NLSOUND::CClusteredSound::CClusterSoundStatus::Obstruction</a>, <a class="el" href="a05566.html#l00094">NLSOUND::CClusteredSound::CSoundTravContext::Occlusion</a>, <a class="el" href="a05566.html#l00077">NLSOUND::CClusteredSound::CClusterSoundStatus::Occlusion</a>, <a class="el" href="a05566.html#l00095">NLSOUND::CClusteredSound::CSoundTravContext::OcclusionLFFactor</a>, <a class="el" href="a05566.html#l00079">NLSOUND::CClusteredSound::CClusterSoundStatus::OcclusionLFFactor</a>, <a class="el" href="a05566.html#l00096">NLSOUND::CClusteredSound::CSoundTravContext::OcclusionRoomRatio</a>, <a class="el" href="a05566.html#l00081">NLSOUND::CClusteredSound::CClusterSoundStatus::OcclusionRoomRatio</a>, <a class="el" href="a05566.html#l00073">NLSOUND::CClusteredSound::CClusterSoundStatus::PosAlpha</a>, <a class="el" href="a05566.html#l00071">NLSOUND::CClusteredSound::CClusterSoundStatus::Position</a>, <a class="el" href="a05566.html#l00115">NLSOUND::CClusteredSound::CSoundTravContext::PreviousCluster</a>, <a class="el" href="a05566.html#l00117">NLSOUND::CClusteredSound::CSoundTravContext::PreviousVector</a>, <a class="el" href="a06590.html#l00218">sint32</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00270">update()</a>.
<p>
<div class="fragment"><pre>00482 {
00483         <a class="code" href="a04365.html#a4">H_AUTO</a>(NLSOUND_soundTraverse)
00484 <span class="comment">//      std::map&lt;CCluster*, CSoundTravContext&gt;  nextTraverse;</span>
00485         std::vector&lt;std::pair&lt;const CCluster*, CSoundTravContext&gt; &gt;     curClusters;
00486         CVector         realListener (travContext.ListenerPos);
00487 
00488         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr1">_AudioPath</a>.clear();
00489 
00490         <span class="comment">// fill the initial cluster liste</span>
00491         CClusterSoundStatus css;
00492         css.Direction = CVector::Null;
00493         css.DistFactor = 0.0f;
00494         css.Dist = 0.0f;
00495         css.Gain = 1.0f;
00496         css.Occlusion = 0;
00497         css.OcclusionLFFactor = 1.0f;
00498         css.OcclusionRoomRatio = 1.0f;
00499         css.Obstruction = 0;
00500         css.PosAlpha = 0;
00501 <span class="comment">//      css.Position = CVector::Null;</span>
00502         css.Position = realListener;
00503 
00504         <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;clusters.size(); ++i)
00505         {
00506                 <span class="keywordtype">bool</span> valid = <span class="keyword">true</span>;
00507                 <span class="comment">// eliminate cluster when listener is behind their portals AND inside the other cluster</span>
00508                 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> j=0; j&lt;clusters[i]-&gt;getNbPortals(); j++)
00509                 {                               
00510                         <a class="code" href="a03103.html">CPortal</a> *portal = clusters[i]-&gt;getPortal(j);
00511                         <span class="keyword">const</span> std::vector&lt;CVector&gt; &amp;poly = portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala7">getPoly</a>();
00512 
00513                         <span class="keywordflow">if</span> (poly.size() &lt; 3)
00514                         {
00515                                 <span class="comment">// only warn once, avoid log flooding !</span>
00516                                 <span class="keyword">static</span> std::set&lt;std::string&gt;    warned;
00517                                 <span class="keywordflow">if</span> (warned.find(clusters[i]-&gt;Name) == warned.end())
00518                                 {
00519                                         <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"Cluster [%s] contains a portal [%s] with less than 3 vertex !"</span>, 
00520                                                 clusters[i]-&gt;Name.c_str(), portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala4">getName</a>().empty() ? <span class="stringliteral">"no name"</span> : portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala4">getName</a>().c_str());
00521                                         warned.insert(clusters[i]-&gt;Name);
00522                                 }
00523                                 valid = <span class="keyword">false</span>;
00524                                 <span class="keywordflow">continue</span>;
00525                         }
00526                         CVector normal = (poly[0] - poly[1]) ^ (poly[2] - poly[1]);
00527 
00528                         <span class="keywordtype">float</span> dist = (realListener - poly[0]) * normal;
00529                         <span class="keywordtype">float</span> dist2 = (clusters[i]-&gt;getBBox().getCenter() - poly[0]) * normal;
00530 
00531                         <span class="keywordflow">if</span> ((dist &lt; 0 &amp;&amp; dist2 &gt; 0) || (dist &gt; 0 &amp;&amp; dist2 &lt; 0))
00532                         {
00533                                 <span class="keywordflow">if</span> (portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala3">getCluster</a>(0) == clusters[i]) 
00534                                 {
00535                                         <span class="keywordflow">if</span> (find(clusters.begin(), clusters.end(), portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala3">getCluster</a>(1)) != clusters.end())
00536                                         {
00537                                                 valid = <span class="keyword">false</span>;
00538                                                 <span class="keywordflow">continue</span>;
00539                                         }
00540                                 }
00541                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (find(clusters.begin(), clusters.end(), portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala3">getCluster</a>(0)) != clusters.end())
00542                                 {
00543                                         valid = <span class="keyword">false</span>;
00544                                         <span class="keywordflow">continue</span>;
00545                                 }
00546 
00547                         }
00548 
00549 <span class="comment">/*</span>
00550 <span class="comment">                        if (portal-&gt;getCluster(0) == clusters[i] &amp;&amp; dist &gt; 0)</span>
00551 <span class="comment">//                              if (!portal-&gt;isInFront(realListener))</span>
00552 <span class="comment">                        {</span>
00553 <span class="comment">                                valid = false;</span>
00554 <span class="comment">                                continue;</span>
00555 <span class="comment">                        }</span>
00556 <span class="comment">                        else if (portal-&gt;getCluster(1) == clusters[i] &amp;&amp; dist &lt; 0)</span>
00557 <span class="comment">//                              if (portal-&gt;isInFront(realListener))</span>
00558 <span class="comment">                        {</span>
00559 <span class="comment">                                valid = false;</span>
00560 <span class="comment">                                continue;</span>
00561 <span class="comment">                        }</span>
00562 <span class="comment">*/</span>
00563                 }
00564                 <span class="keywordflow">if</span>( valid)
00565                 {
00566                         curClusters.push_back(make_pair(clusters[i], travContext));
00567                         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd0">addAudibleCluster</a>(clusters[i], css);
00568                 }
00569         }
00570 
00571         <span class="keywordflow">do</span>
00572         {
00573                 <span class="comment">// add the next traverse (if any)</span>
00574                 std::copy(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a>.begin(), <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a>.end(), std::back_inserter(curClusters));
00575                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a>.clear();
00576 
00577                 <span class="keywordflow">while</span> (!curClusters.empty())
00578                 {
00579                         <a class="code" href="a02362.html">CCluster</a> * cluster = const_cast&lt;CCluster*&gt;(curClusters.back().first);
00580                         CSoundTravContext &amp;travContext = curClusters.back().second;
00581 
00582                         CClusterSoundStatus css;
00583                         css.Gain = travContext.Gain;
00584                         css.Dist = travContext.Dist;
00585                         css.Direction = travContext.Direction;
00586                         css.Occlusion = travContext.Occlusion;
00587                         css.OcclusionLFFactor = travContext.OcclusionLFFactor;
00588                         css.OcclusionRoomRatio = travContext.OcclusionRoomRatio;
00589                         css.Obstruction = travContext.Obstruction;
00590 
00591                         <span class="comment">// store this cluster and it's parameters</span>
00592                         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>.insert(make_pair(cluster, css));
00593 
00594                         <span class="comment">// 1st, look each portal</span>
00595                         <a class="code" href="a04558.html#a15">uint</a> i;
00596                         <span class="keywordflow">for</span> (i=0; i&lt;cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustera14">getNbPortals</a>(); ++i)
00597                         {
00598                                 <a class="code" href="a03103.html">CPortal</a> *portal = cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustera17">getPortal</a>(i);
00599                                 <span class="comment">// get the other cluster</span>
00600                                 <a class="code" href="a02362.html">CCluster</a> *otherCluster = portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala3">getCluster</a>(0);
00601                                 <span class="keywordtype">bool</span>    clusterInFront = <span class="keyword">true</span>;
00602                                 <span class="keywordflow">if</span> (otherCluster == cluster)
00603                                 {
00604                                         otherCluster = portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala3">getCluster</a>(1);
00605                                         clusterInFront = <span class="keyword">false</span>;
00606                                 }
00607                                 <a class="code" href="a04199.html#a6">nlassert</a>(otherCluster != cluster);
00608 
00609                                 <span class="keywordflow">if</span> (otherCluster &amp;&amp; travContext.PreviousCluster != otherCluster) <span class="comment">// &amp;&amp; (!travContext.FilterUnvisibleChild || otherCluster-&gt;AudibleFromFather))</span>
00610                                 {
00611                                         <span class="keyword">const</span> vector&lt;CVector&gt; &amp;poly = portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala7">getPoly</a>();
00612 
00613                                         <span class="comment">// a security test </span>
00614                                         <span class="keywordflow">if</span> (poly.size() &lt; 3)
00615                                         {
00616                                                 <span class="comment">// only warn once, avoid log flooding !</span>
00617                                                 <span class="keyword">static</span> std::set&lt;std::string&gt;    warned;
00618                                                 <span class="keywordflow">if</span> (warned.find(cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero8">Name</a>) == warned.end())
00619                                                 {
00620                                                         <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"Cluster [%s] contains a portal [%s] with less than 3 vertex !"</span>, 
00621                                                                 cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero8">Name</a>.c_str(), portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala4">getName</a>().empty() ? <span class="stringliteral">"no name"</span> : portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortala4">getName</a>().c_str());
00622                                                         warned.insert(cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero8">Name</a>);
00623                                                 }
00624                                         }
00625                                         <span class="keywordflow">else</span>
00626                                         {
00627 
00628                                                 <span class="comment">// Test to skip portal with suface &gt; 40 m2 (aprox)</span>
00629                                                 <span class="keywordtype">float</span> surface = ((poly[2]-poly[1]) ^ (poly[0]-poly[1])).norm();
00630                                                 <span class="keywordflow">if</span> (surface &gt; 340 <span class="comment">/* &amp;&amp; otherCluster-&gt;isIn(travContext.ListenerPos, travContext.MaxDist-travContext.Dist)*/</span>)
00631                                                 {
00632                                                         <span class="keywordtype">float</span> minDist;
00633                                                         CVector nearPos;
00634                                                         <a class="code" href="a02156.html">CAABBox</a> box = otherCluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustera8">getBBox</a>();
00635 
00636                                                         minDist = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundz1297_0">getAABoxNearestPos</a>(box, travContext.ListenerPos, nearPos);
00637 
00638                                                         <span class="keywordflow">if</span> (travContext.Dist + minDist &lt; <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a>)
00639                                                         {
00640                                                                 CVector soundDir = (nearPos - travContext.ListenerPos).normed();
00641                                                                 CClusterSoundStatus css;
00642                                                                 css.Gain = travContext.Gain;
00643                                                                 css.Dist = travContext.Dist + minDist;
00644                                                                 css.Occlusion = travContext.Occlusion;
00645                                                                 css.OcclusionLFFactor = travContext.OcclusionLFFactor;
00646                                                                 css.Obstruction = travContext.Obstruction;
00647                                                                 css.OcclusionRoomRatio = travContext.OcclusionRoomRatio;
00648                                                                 css.DistFactor = css.Dist / <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a>;
00649                                                                 css.Direction = travContext.Direction;
00650 
00651                                                                 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a663">alpha</a> = travContext.Alpha;
00652                                                                 CVector d1(travContext.Direction1), d2;
00653 
00654                                                                 css.Direction = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd2">interpolateSourceDirection</a>(travContext, css.Dist+travContext.Dist, nearPos, travContext.ListenerPos <span class="comment">/*realListener*/</span>, d1, d2, alpha);
00655                                                                 css.Position = nearPos + css.Dist * css.Direction;
00656                                                                 css.PosAlpha = <a class="code" href="a04061.html#a0">min</a>(1.0f, css.Dist / _PortalInterpolate);
00657 
00658                                                                 <span class="keywordflow">if</span> (<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd0">addAudibleCluster</a>(otherCluster, css))
00659                                                                 {
00660         <span class="comment">//                                                              debugLines.push_back(CLine(travContext.ListenerPos, nearPos));</span>
00661                                                                         CSoundTravContext stc(travContext);
00662                                                                         stc.FilterUnvisibleChild = <span class="keyword">true</span>;
00663                                                                         stc.Direction1 = d1;
00664                                                                         stc.Direction2 = d2;
00665                                                                         stc.Direction = css.Direction;
00666                                                                         stc.PreviousCluster = cluster;
00667                                                                         stc.Alpha = <a class="code" href="a04223.html#a663">alpha</a>;
00668                                                                         stc.PreviousVector = (nearPos - travContext.ListenerPos).normed();
00669                                                                         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd1">addNextTraverse</a>(otherCluster, stc);
00670                                                                         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr1">_AudioPath</a>.push_back(make_pair(travContext.ListenerPos, nearPos));
00671                                                                 }
00672                                                         }
00673                                                 }
00674                                                 <span class="keywordflow">else</span>
00675                                                 {
00676                                                         <span class="comment">// find the nearest point of this portal (either on of the perimeter vertex or a point on the portal surface)</span>
00677                                                         <span class="keywordtype">float</span> minDist;
00678                                                         CVector nearPos;
00679 
00680                                                         minDist = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundz1297_1">getPolyNearestPos</a>(poly, travContext.ListenerPos, nearPos);
00681 
00682                                                         <span class="keywordflow">if</span> (travContext.Dist+minDist &lt; <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a>)
00683                                                         {
00684                                                                 <span class="comment">// TODO : compute relative gain according to portal behavior.</span>
00685                                                                 CClusterSoundStatus css;
00686                                                                 css.Gain = travContext.Gain;
00687                                                                 CVector soundDir = (nearPos - travContext.ListenerPos).normed();
00688                                                                 <a class="code" href="a04558.html#a15">uint</a> occId = portal-&gt;<a class="code" href="a03103.html#NL3D_1_1CPortalz698_1">getOcclusionModelId</a>();
00689                                                                 std::hash_map&lt;NLMISC::TStringId, uint&gt;::iterator it(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr3">_IdToMaterial</a>.find(occId));
00690 
00691 <span class="preprocessor">        #if EAX_AVAILABLE == 1</span>
00692 <span class="preprocessor"></span>                                                                <span class="keywordflow">if</span> (it != <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr3">_IdToMaterial</a>.end())
00693                                                                 {
00694                                                                         <span class="comment">// found an occlusion material for this portal</span>
00695                                                                         <a class="code" href="a04558.html#a15">uint</a> matId = it-&gt;second;
00696                                                                         css.Occlusion = max(<a class="code" href="a05167.html#a12">sint32</a>(EAXBUFFER_MINOCCLUSION), <a class="code" href="a05167.html#a12">sint32</a>(travContext.Occlusion + EAX_MATERIAL_PARAM[matId][0])); <span class="comment">//- 1800); //EAX_MATERIAL_THINDOOR;</span>
00697                                                                         css.OcclusionLFFactor = travContext.OcclusionLFFactor * <a class="code" href="a05381.html#a5">EAX_MATERIAL_PARAM</a>[matId][1]; <span class="comment">//EAX_MATERIAL_THICKDOORLF; //0.66f; //0.0f; //min(EAX_MATERIAL_THINDOORLF, travContext.OcclusionLFFactor);</span>
00698                                                                         css.OcclusionRoomRatio = <a class="code" href="a05381.html#a5">EAX_MATERIAL_PARAM</a>[matId][2] * travContext.OcclusionRoomRatio;
00699                                                                 }
00700                                                                 <span class="keywordflow">else</span>
00701                                                                 {
00702                                                                         <span class="comment">// the id does not match any know material</span>
00703                                                                         css.Occlusion = travContext.Occlusion;
00704                                                                         css.OcclusionLFFactor = travContext.OcclusionLFFactor;
00705                                                                         css.OcclusionRoomRatio = travContext.OcclusionRoomRatio;
00706                                                                 }
00707 <span class="preprocessor">        #else   // EAX_AVAILABLE</span>
00708 <span class="preprocessor"></span>                                                                <span class="keywordflow">if</span> (it != <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr3">_IdToMaterial</a>.end())
00709                                                                 {
00710                                                                         <span class="comment">// found an occlusion material for this portal</span>
00711                                                                         <a class="code" href="a04558.html#a15">uint</a> matId = it-&gt;second;
00712                                                                         css.Gain *= <a class="code" href="a05381.html#a5">EAX_MATERIAL_PARAM</a>[matId];
00713                                                                 }
00714 <span class="preprocessor">        #endif  // EAX_AVAILABLE</span>
00715 <span class="preprocessor"></span>        <span class="comment">/*                                                      if (portal-&gt;getOcclusionModel() == "wood door")</span>
00716 <span class="comment">                                                                {</span>
00717 <span class="comment">        //                                                              css.Gain *= 0.5f;</span>
00718 <span class="comment">        #if EAX_AVAILABLE == 1</span>
00719 <span class="comment">                                                                        css.Occlusion = max(EAXBUFFER_MINOCCLUSION, travContext.Occlusion + EAX_MATERIAL_THICKDOOR); //- 1800); //EAX_MATERIAL_THINDOOR;</span>
00720 <span class="comment">                                                                        css.OcclusionLFFactor = 0.1f * travContext.OcclusionLFFactor; //EAX_MATERIAL_THICKDOORLF; //0.66f; //0.0f; //min(EAX_MATERIAL_THINDOORLF, travContext.OcclusionLFFactor);</span>
00721 <span class="comment">                                                                        css.OcclusionRoomRatio = EAX_MATERIAL_THICKDOORROOMRATION * travContext.OcclusionRoomRatio;</span>
00722 <span class="comment">        #else</span>
00723 <span class="comment">                                                                        css.Gain *= 0.5f;</span>
00724 <span class="comment">        #endif</span>
00725 <span class="comment">                                                                }</span>
00726 <span class="comment">                                                                else if (portal-&gt;getOcclusionModel() == "brick door")</span>
00727 <span class="comment">                                                                {</span>
00728 <span class="comment">        #if EAX_AVAILABLE == 1</span>
00729 <span class="comment">                                                                        css.Occlusion = max(EAXBUFFER_MINOCCLUSION, travContext.Occlusion + EAX_MATERIAL_BRICKWALL);</span>
00730 <span class="comment">                                                                        css.OcclusionLFFactor = min(EAX_MATERIAL_BRICKWALLLF, travContext.OcclusionLFFactor);</span>
00731 <span class="comment">                                                                        css.OcclusionRoomRatio = EAX_MATERIAL_BRICKWALLROOMRATIO * travContext.OcclusionRoomRatio;</span>
00732 <span class="comment">        #else</span>
00733 <span class="comment">                                                                        css.Gain *= 0.2f;</span>
00734 <span class="comment">        #endif</span>
00735 <span class="comment">                                                                }</span>
00736 <span class="comment">                                                                else</span>
00737 <span class="comment">                                                                {</span>
00738 <span class="comment">        #if EAX_AVAILABLE == 1</span>
00739 <span class="comment">                                                                        css.Occlusion = travContext.Occlusion;</span>
00740 <span class="comment">                                                                        css.OcclusionLFFactor = travContext.OcclusionLFFactor;</span>
00741 <span class="comment">                                                                        css.OcclusionRoomRatio = travContext.OcclusionRoomRatio;</span>
00742 <span class="comment">        #endif</span>
00743 <span class="comment">                                                                }</span>
00744 <span class="comment"></span>
00745 <span class="comment">        */</span>                                                      <span class="comment">// compute obstruction  </span>
00746                                                                 <span class="keywordflow">if</span> (travContext.NbPortal &gt;= 1)
00747                                                                 {
00748                                                                         <span class="keywordtype">float</span> h = soundDir * travContext.PreviousVector;
00749                                                                         <span class="keywordtype">float</span> obst;
00750 
00751                                                                         <span class="keywordflow">if</span> (h &lt; 0)
00752                                                                         {
00753         <span class="comment">//                                                                      obst = float(2000 + asinf(-(soundDir ^ travContext.PreviousVector).norm()) / (Pi/2) * 2000);</span>
00754                                                                                 obst = float(4000 - (soundDir ^ travContext.PreviousVector).norm() * 2000);
00755                                                                         }
00756                                                                         <span class="keywordflow">else</span>
00757                                                                         {
00758         <span class="comment">//                                                                      obst = float(asinf((soundDir ^ travContext.PreviousVector).norm()) / (Pi/2) * 2000);</span>
00759                                                                                 obst = float((soundDir ^ travContext.PreviousVector).norm() * 2000);
00760                                                                         }
00761 
00762         <span class="comment">//                                                              float sqrdist = (realListener - nearPoint).sqrnorm();</span>
00763                                                                         <span class="keywordflow">if</span> (travContext.Dist &lt; 2.0f)    <span class="comment">// interpolate a 2 m</span>
00764                                                                                 obst *= travContext.Dist / 2.0f;
00765 <span class="preprocessor">        #if EAX_AVAILABLE == 1</span>
00766 <span class="preprocessor"></span>                                                                        css.Obstruction = max(<a class="code" href="a05167.html#a12">sint32</a>(EAXBUFFER_MINOBSTRUCTION), <a class="code" href="a05167.html#a12">sint32</a>(travContext.Obstruction - <a class="code" href="a04558.html#a10">sint32</a>(obst)));
00767                                                                         css.OcclusionLFFactor = 0.50f * travContext.OcclusionLFFactor;
00768 <span class="preprocessor">        #else</span>
00769 <span class="preprocessor"></span>                                                                        css.Gain *= float(pow(10, -(obst/4)/2000));
00770 <span class="preprocessor">        #endif</span>
00771 <span class="preprocessor"></span>                                                                }
00772                                                                 <span class="keywordflow">else</span>
00773                                                                         css.Obstruction = travContext.Obstruction;
00774         <span class="comment">//                                                      css.Dist = travContext.Dist + float(sqrt(minDist));</span>
00775                                                                 css.Dist = travContext.Dist + minDist;
00776                                                                 css.DistFactor = css.Dist / <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a>;
00777                                                                 <span class="keywordtype">float</span>   portalDist = css.Dist; 
00778                                                                 <span class="keywordtype">float</span>   <a class="code" href="a04223.html#a663">alpha</a> = travContext.Alpha;
00779                                                                 CVector d1(travContext.Direction1), d2(travContext.Direction2);
00780 
00781                                                                 css.Direction = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd2">interpolateSourceDirection</a>(travContext, portalDist+travContext.Dist, nearPos, travContext.ListenerPos <span class="comment">/*realListener*/</span>, d1, d2, alpha);
00782                                                                 css.Position = nearPos + css.Dist * css.Direction;
00783                                                                 css.PosAlpha = <a class="code" href="a04061.html#a0">min</a>(1.0f, css.Dist / _PortalInterpolate);
00784 
00785                                                                 <span class="keywordflow">if</span> (<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd0">addAudibleCluster</a>(otherCluster, css))
00786                                                                 {
00787         <span class="comment">//                                                              debugLines.push_back(CLine(travContext.ListenerPos, nearPoint));</span>
00788                                                                         CSoundTravContext tc(nearPos, travContext.FilterUnvisibleChild, !cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero1">AudibleFromFather</a>);
00789                                                                         tc.Dist = css.Dist;
00790                                                                         tc.Gain = css.Gain;
00791                                                                         tc.Occlusion = css.Occlusion;
00792                                                                         tc.OcclusionLFFactor = css.OcclusionLFFactor;
00793                                                                         tc.OcclusionRoomRatio = css.OcclusionRoomRatio;
00794                                                                         tc.Obstruction = css.Obstruction;
00795                                                                         tc.Direction1 = d1;
00796                                                                         tc.Direction2 = d2;
00797                                                                         tc.NbPortal = travContext.NbPortal+1;
00798                                                                         tc.Direction = css.Direction;
00799                                                                         tc.PreviousCluster = cluster;
00800                                                                         tc.Alpha = <a class="code" href="a04223.html#a663">alpha</a>;
00801                                                                         tc.PreviousVector = soundDir;
00802 
00803                                                                         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd1">addNextTraverse</a>(otherCluster, tc);
00804                                                                         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr1">_AudioPath</a>.push_back(make_pair(travContext.ListenerPos, nearPos));
00805                                                                 }
00806                                                         }
00807                                                 }
00808                                         }
00809                                 }
00810                         }
00811 
00812                         <span class="comment">// 2nd, look each child cluster</span>
00813                         <span class="keywordflow">for</span> (i=0; i&lt;cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero2">Children</a>.size(); ++i)
00814                         {
00815                                 <a class="code" href="a02362.html">CCluster</a> *c = cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero2">Children</a>[i];
00816                                 
00817                                 <span class="comment">// dont redown into an upstream</span>
00818                                 <span class="keywordflow">if</span> (c != travContext.PreviousCluster)
00819                                 {
00820                                         <span class="comment">// clip on distance.</span>
00821                                         <span class="keywordflow">if</span> (c-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero1">AudibleFromFather</a> &amp;&amp; c-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustera29">isIn</a>(travContext.ListenerPos, _MaxEarDistance-travContext.Dist))
00822                                         {
00823                                                 <span class="keywordtype">float</span> minDist;
00824                                                 CVector nearPos;
00825                                                 <a class="code" href="a02156.html">CAABBox</a> box = c-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustera8">getBBox</a>();
00826 
00827                                                 minDist = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundz1297_0">getAABoxNearestPos</a>(box, travContext.ListenerPos, nearPos);
00828                                                 
00829                                                 <span class="keywordflow">if</span> (travContext.Dist + minDist &lt; <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a>)
00830                                                 {
00831                                                         CClusterSoundStatus css;
00832                                                         css.Gain = travContext.Gain;
00833                                                         css.Dist = travContext.Dist + minDist;
00834                                                         css.DistFactor = css.Dist / <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a>;
00835                                                         css.Occlusion = travContext.Occlusion;
00836                                                         css.OcclusionLFFactor = travContext.OcclusionLFFactor;
00837                                                         css.OcclusionRoomRatio = travContext.OcclusionRoomRatio;
00838                                                         css.Obstruction = travContext.Obstruction;
00839 <span class="comment">/*                                                      if (travContext.NbPortal == 0)</span>
00840 <span class="comment">                                                                css.Direction = (nearPos - travContext.ListenerPos).normed();</span>
00841 <span class="comment">                                                        else</span>
00842 <span class="comment">                                                                css.Direction = travContext.Direction1;</span>
00843 <span class="comment">*/</span>
00844                                                         <span class="keywordtype">float</span> <a class="code" href="a04223.html#a663">alpha</a> = travContext.Alpha;
00845                                                         CVector d1(travContext.Direction1), d2;
00846 
00847                                                         css.Direction = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd2">interpolateSourceDirection</a>(travContext, css.Dist+travContext.Dist, nearPos, travContext.ListenerPos <span class="comment">/*realListener*/</span>, d1, d2, alpha);
00848                                                         css.Position = nearPos + css.Dist * css.Direction;
00849                                                         css.PosAlpha = <a class="code" href="a04061.html#a0">min</a>(1.0f, css.Dist / _PortalInterpolate);
00850 
00851                                                         <span class="keywordflow">if</span> (<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd0">addAudibleCluster</a>(c, css))
00852                                                         {
00853 <span class="comment">//                                                              debugLines.push_back(CLine(travContext.ListenerPos, nearPos));</span>
00854                                                                 CSoundTravContext stc(travContext);
00855                                                                 stc.FilterUnvisibleChild = <span class="keyword">true</span>;
00856                                                                 stc.Direction1 = d1;
00857                                                                 stc.Direction2 = d2;
00858                                                                 stc.Direction = css.Direction;
00859                                                                 stc.PreviousCluster = cluster;
00860                                                                 stc.Alpha = <a class="code" href="a04223.html#a663">alpha</a>;
00861                                                                 stc.PreviousVector = (nearPos - travContext.ListenerPos).normed();
00862                                                                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd1">addNextTraverse</a>(c, stc);
00863                                                                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr1">_AudioPath</a>.push_back(make_pair(travContext.ListenerPos, nearPos));
00864                                                         }
00865                                                 }
00866                                         }
00867                                 }
00868                         }
00869 
00870                         <span class="comment">// 3nd, look in father cluster</span>
00871                         <span class="keywordflow">if</span> (cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero4">Father</a> &amp;&amp; cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero4">Father</a> != travContext.PreviousCluster &amp;&amp; cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero5">FatherAudible</a>)
00872                         {
00873 <span class="comment">//                              if (!travContext.FilterUnvisibleFather || ((1.0f-travContext.Alpha) &gt; travContext.MinGain))</span>
00874                                 {
00875                                         <a class="code" href="a02362.html">CCluster</a> *c = cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero4">Father</a>;
00876                                         <span class="keywordtype">float</span> minDist;
00877                                         CVector nearPos;
00878                                         <a class="code" href="a02156.html">CAABBox</a> box = c-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustera8">getBBox</a>();
00879 
00880                                         <span class="keywordflow">if</span> (c != <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr9">_RootCluster</a>)
00881                                                 minDist = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundz1297_0">getAABoxNearestPos</a>(box, travContext.ListenerPos, nearPos);
00882                                         <span class="keywordflow">else</span>
00883                                         {
00884                                                 <span class="comment">// special case for root cluster coz it have a zero sized box and a zero position.</span>
00885                                                 nearPos = travContext.ListenerPos;
00886                                                 minDist = 0;
00887                                         }
00888                                         
00889                                         CClusterSoundStatus css;
00890                                         css.Gain = travContext.Gain;
00891 <span class="comment">/*                                      if (travContext.FilterUnvisibleFather)</span>
00892 <span class="comment">                                        {</span>
00893 <span class="comment">                                                // compute a gain</span>
00894 <span class="comment">                                                float alpha = 1-(travContext.Dist / _PortalInterpolate);</span>
00895 <span class="comment">                                                alpha = alpha * alpha * alpha;</span>
00896 <span class="comment">                                                css.Gain = max(0.0f, alpha);</span>
00897 <span class="comment">                                        }</span>
00898 <span class="comment">                                        else</span>
00899 <span class="comment">                                                css.Gain = travContext.Gain;</span>
00900 <span class="comment">*/</span>
00901 <span class="comment">//                                      if (c-&gt;Name == "cluster_1")</span>
00902 <span class="comment">//                                              nldebug("Cluster 1 : gain = %f", css.Gain);</span>
00903                                         <span class="keywordtype">float</span> <a class="code" href="a04223.html#a663">alpha</a> = travContext.Alpha;
00904                                         CVector d1(travContext.Direction1), d2;
00905 
00906                                         css.Direction = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd2">interpolateSourceDirection</a>(travContext, travContext.Dist, nearPos, travContext.ListenerPos <span class="comment">/*realListener*/</span>, d1, d2, alpha);
00907 
00908                                         <span class="keywordflow">if</span> (css.Gain &gt; <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr6">_MinGain</a>)
00909                                         {
00910                                                 css.Dist = travContext.Dist; 
00911 <span class="comment">//                                              css.Direction = CVector::Null;</span>
00912                                                 css.DistFactor = css.Dist / <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a>;
00913                                                 css.Occlusion = travContext.Occlusion;
00914                                                 css.OcclusionLFFactor = travContext.OcclusionLFFactor;
00915                                                 css.OcclusionRoomRatio = travContext.OcclusionRoomRatio;
00916                                                 css.Obstruction = travContext.Obstruction;
00917                                                 css.Position = nearPos + css.Dist * css.Direction;
00918                                                 css.PosAlpha = <a class="code" href="a04061.html#a0">min</a>(1.0f, css.Dist / _PortalInterpolate);
00919 
00920                                                 <span class="keywordflow">if</span> (<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd0">addAudibleCluster</a>(c, css))
00921                                                 {
00922                                                         CSoundTravContext stc(travContext);
00923                                                         stc.FilterUnvisibleFather = <span class="keyword">true</span>;
00924                                                         stc.PreviousCluster = cluster;
00925                                                         stc.Direction1 = d1;
00926                                                         stc.Direction2 = d2;
00927                                                         stc.Direction = css.Direction;
00928                                                         stc.Alpha = <a class="code" href="a04223.html#a663">alpha</a>;
00929                                                         stc.PreviousVector = (nearPos - travContext.ListenerPos).normed();
00930                                                         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a>.insert(make_pair(c, stc));
00931                                                 }
00932                                         }
00933                                 }
00934                         }
00935                         curClusters.pop_back();
00936                 }
00937         }
00938         <span class="keywordflow">while</span> (!<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a>.empty());
00939 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSounda6" doxytag="NLSOUND::CClusteredSound::update" ></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 NLSOUND::CClusteredSound::update </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>listenerPos</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>view</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>up</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

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

<p>
Update the cluster sound system.
<p>
css.DistFactor*css.DistFactor 
<p>
Definition at line <a class="el" href="a05565.html#l00270">270</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
References <a class="el" href="a05566.html#l00252">_AudibleClusters</a>, <a class="el" href="a05566.html#l00267">_IdToEaxEnv</a>, <a class="el" href="a05566.html#l00248">_RootCluster</a>, <a class="el" href="a05566.html#l00264">_SoundGroupToSound</a>, <a class="el" href="a05566.html#l00075">NLSOUND::CClusteredSound::CClusterSoundStatus::Direction</a>, <a class="el" href="a05566.html#l00067">NLSOUND::CClusteredSound::CClusterSoundStatus::Dist</a>, <a class="el" href="a05566.html#l00170">NLSOUND::CClusteredSound::CClusterSound::Distance</a>, <a class="el" href="a05566.html#l00069">NLSOUND::CClusteredSound::CClusterSoundStatus::DistFactor</a>, <a class="el" href="a05565.html#l00120">EAXLISTENER_MAXENVIRONMENTSIZE</a>, <a class="el" href="a05566.html#l00065">NLSOUND::CClusteredSound::CClusterSoundStatus::Gain</a>, <a class="el" href="a06349.html#l00475">NL3D::CScene::getClipTrav()</a>, <a class="el" href="a05385.html#l00091">NLMISC::CAABBox::getHalfSize()</a>, <a class="el" href="a05466.html#l00229">NLSOUND::CAudioMixerUser::getListener()</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05587.html#l00124">NLMISC::minof()</a>, <a class="el" href="a05622.html#l00101">nldebug</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a03861.html#NLSOUND_1_1IListenerz1318_2">NLSOUND::IListener::setEnvironment()</a>, <a class="el" href="a03429.html#NLSOUND_1_1USourcez2137_4">NLSOUND::USource::setLooping()</a>, <a class="el" href="a03429.html#NLSOUND_1_1USourcez2139_10">NLSOUND::USource::setPos()</a>, <a class="el" href="a03429.html#NLSOUND_1_1USourcez2139_11">NLSOUND::USource::setRelativeGain()</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a05565.html#l00481">soundTraverse()</a>, <a class="el" href="a05566.html#l00169">NLSOUND::CClusteredSound::CClusterSound::Source</a>, <a class="el" href="a05981.html#l00105">uint</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="a05465.html#l01268">NLSOUND::CAudioMixerUser::update()</a>.
<p>
<div class="fragment"><pre>00271 {
00272         <a class="code" href="a04365.html#a4">H_AUTO</a>(NLSOUND_ClusteredSoundUpdate)
00273         <span class="keywordflow">if</span> (<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a> == 0)
00274         {
00275                 <span class="comment">// hum... what to do ?</span>
00276                 <span class="keyword">static</span> <span class="keywordtype">bool</span> bDisplayOnce = <span class="keyword">false</span>;
00277                 <span class="keywordflow">if</span> (!bDisplayOnce)
00278                 {
00279                         <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"CClusteredSound::update : no scene specified !"</span>);
00280                         bDisplayOnce = <span class="keyword">true</span>;
00281                 }
00282                 <span class="keywordflow">return</span>;
00283         }
00284         
00285         <a class="code" href="a02353.html">CClipTrav</a>       &amp;clipTrav = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a>-&gt;<a class="code" href="a03348.html#NL3D_1_1CScenez820_1">getClipTrav</a> ();
00286 
00287         <span class="comment">// Retreive the list of cluster where the listener is</span>
00288         vector&lt;CCluster*&gt; vCluster;
00289         clipTrav.<a class="code" href="a02353.html#NL3D_1_1CClipTravz65_1">fullSearch</a> (vCluster, clipTrav.<a class="code" href="a02353.html#NL3D_1_1CClipTravo4">RootCluster</a>-&gt;<a class="code" href="a02362.html#NL3D_1_1CClustero7">Group</a>, listenerPos);
00290 
00291 
00292         <span class="comment">// reset the audible cluster map</span>
00293         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>.clear();
00294 
00295         <span class="comment">// create the initial travesal context</span>
00296         CSoundTravContext stc(listenerPos, <span class="keyword">false</span>, <span class="keyword">false</span>);
00297 
00298         <span class="comment">// and start the cluster traversal to find out what cluster is audible and how we ear it</span>
00299         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundd3">soundTraverse</a>(vCluster, stc);
00300 
00301         <span class="comment">//-----------------------------------------------------</span>
00302         <span class="comment">// update the clustered sound (create and stop sound)</span>
00303         <span class="comment">//-----------------------------------------------------</span>
00304 
00305         std::hash_map&lt;uint, CClusterSound&gt;              newSources;
00306 
00307         {
00308                 <span class="comment">// fake the distance for all playing source</span>
00309 <span class="comment">//              std::map&lt;std::string, CClusterSound&gt;::iterator first(_Sources.begin()), last(_Sources.end());</span>
00310                 std::hash_map&lt;NLMISC::TStringId, CClusterSound&gt;::iterator first(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr12">_Sources</a>.begin()), last(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr12">_Sources</a>.end());
00311                 <span class="keywordflow">for</span> (; first != last; ++first)
00312                 {
00313                         first-&gt;second.Distance = FLT_MAX;
00314                 }
00315         }
00316 
00317         
00318         TClusterStatusMap::const_iterator first(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>.begin()), last(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a>.end());
00319         <span class="keywordflow">for</span> (; first != last; ++first )
00320         {
00321                 <span class="keyword">static</span> NLMISC::TStringId NO_SOUND_GROUP = CStringMapper::emptyId();
00322                 <span class="keyword">const</span> CClusterSoundStatus &amp;css = first-&gt;second;
00323                 <a class="code" href="a02362.html">CCluster</a> *cluster = first-&gt;first;
00324                 NLMISC::TStringId soundGroup;
00325 
00326                 soundGroup = cluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClusterz68_3">getSoundGroupId</a>();
00327 
00328 
00329                 <span class="keywordflow">if</span> (soundGroup != NO_SOUND_GROUP)
00330                 {
00331                         <span class="comment">// search an associated sound name</span>
00332                         std::hash_map&lt;NLMISC::TStringId, CClusterSound&gt;::iterator it(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr12">_Sources</a>.find(soundGroup));
00333                         <span class="keywordflow">if</span> (it != <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr12">_Sources</a>.end())
00334                         {
00335                                 <span class="comment">// the source is already playing, check and replace if needed</span>
00336                                 CClusterSound &amp;cs = it-&gt;second;
00337 
00338                                 <span class="keywordflow">if</span> (cs.Distance &gt;= css.Dist)
00339                                 {
00340                                         <span class="comment">// this one is better !</span>
00341                                         cs.Distance = css.Dist;
00342                                         cs.Source-&gt;setPos(listenerPos + css.Direction * css.Dist + CVector(0,0,2));
00343                                         <span class="keywordflow">if</span> (css.DistFactor &lt; 1.0f)
00344                                                 cs.Source-&gt;setRelativeGain(css.Gain * (1.0f - (css.DistFactor*css.DistFactor*css.DistFactor*css.DistFactor)));
00345                                         <span class="keywordflow">else</span>
00346                                                 cs.Source-&gt;setRelativeGain(css.Gain);
00347                                 }
00348                                 newSources.insert(make_pair(soundGroup, cs));
00349                         }
00350                         <span class="keywordflow">else</span>
00351                         {
00352                                 <span class="comment">// create a new source</span>
00353 
00354 <span class="comment">//                              nldebug("Searching sound assoc for group [%s]", CStringMapper::unmap(soundGroup).c_str());</span>
00355 
00356                                 std::hash_map&lt;NLMISC::TStringId, NLMISC::TStringId&gt;::iterator it2(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr11">_SoundGroupToSound</a>.find(soundGroup));
00357                                 <span class="keywordflow">if</span> (it2 != <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr11">_SoundGroupToSound</a>.end())
00358                                 {
00359                                         NLMISC::TStringId soundName = it2-&gt;second;
00360                                         CClusterSound cs;
00361 
00362                                         <a class="code" href="a04199.html#a0">nldebug</a>(<span class="stringliteral">"Found the sound [%s] for sound group [%s]"</span>, CStringMapper::unmap(soundName).c_str(), CStringMapper::unmap(soundGroup).c_str());
00363                                         
00364                                         cs.Distance = css.Dist;
00365                                         cs.Source = CAudioMixerUser::instance()-&gt;createSource(soundName, <span class="keyword">false</span>, NULL, NULL, cluster);
00366                                         <span class="keywordflow">if</span> (cs.Source != 0)
00367                                         {
00368                                                 cs.Source-&gt;setPos(listenerPos + css.Direction * css.Dist + CVector(0,0,2));
00369                                                 <span class="keywordflow">if</span> (css.DistFactor &lt; 1.0f)
00370                                                         cs.Source-&gt;setRelativeGain(css.Gain * (1.0f - (css.DistFactor*css.DistFactor)));
00371                                                 <span class="keywordflow">else</span>
00372                                                         cs.Source-&gt;setRelativeGain(css.Gain);
00373                                                 cs.Source-&gt;setLooping(<span class="keyword">true</span>);
00374                                                 newSources.insert(make_pair(soundGroup, cs));
00375                                         }
00376                                 }
00377                         }
00378                 }
00379         }
00380         <span class="comment">// check for source to stop</span>
00381         {
00382 <span class="preprocessor">#if _STLPORT_VERSION &gt;= 0x450</span>
00383 <span class="preprocessor"></span>                std::hash_map&lt;NLMISC::TStringId, CClusterSound&gt; oldSources;
00384                 oldSources.swap(_Sources);
00385 <span class="preprocessor">#else</span>
00386 <span class="preprocessor"></span>                <span class="comment">// there is a bug in the swap methode in stlport 4.5, so fallback to a</span>
00387                 <span class="comment">// very less effective create by copy and clear.</span>
00388                 std::hash_map&lt;NLMISC::TStringId, CClusterSound&gt; oldSources(_Sources);
00389                 <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr12">_Sources</a>.clear();
00390 <span class="preprocessor">#endif</span>
00391 <span class="preprocessor"></span>
00392                 std::hash_map&lt;uint, CClusterSound&gt;::iterator first(newSources.begin()), last(newSources.end());
00393                 <span class="keywordflow">for</span> (; first != last; ++first)
00394                 {
00395                         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr12">_Sources</a>.insert(*first);
00396                         <span class="keywordflow">if</span> (!first-&gt;second.Source-&gt;isPlaying())
00397                                 first-&gt;second.Source-&gt;play();
00398 
00399                         oldSources.erase(first-&gt;first);
00400                 }
00401 
00402                 <span class="keywordflow">while</span> (!oldSources.empty())
00403                 {
00404                         CClusterSound &amp;cs = oldSources.begin()-&gt;second;
00405                         <span class="keyword">delete</span> cs.Source;
00406                         oldSources.erase(oldSources.begin());
00407                 }
00408         }
00409 
00410         <span class="comment">// update the environnement effect (if any)</span>
00411         <span class="keywordflow">if</span> (!vCluster.empty())
00412         {
00413                 <a class="code" href="a04365.html#a4">H_AUTO</a>(NLSOUND_ClusteredSound_updateEnvFx)
00414                 CAudioMixerUser *mixer = CAudioMixerUser::instance();
00415                 <a class="code" href="a05378.html#a236">TStringId</a> fxId = vCluster[0]-&gt;getEnvironmentFxId();
00416 
00417                 IListener *drvListener = static_cast&lt;CListenerUser*&gt;(mixer-&gt;getListener())-&gt;getListener();
00418                 <span class="keyword">const</span> <a class="code" href="a02156.html">CAABBox</a> &amp;box = vCluster[0]-&gt;getBBox();
00419                 CVector vsize = box.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_1">getHalfSize</a>();
00420                 <span class="keywordtype">float</span>   <a class="code" href="a04223.html#a587">size</a> = <a class="code" href="a05378.html#a375">NLMISC::minof</a>(vsize.x, vsize.y, vsize.z) * 2;
00421 
00422                 <span class="comment">// special case for root cluster (ie, external)</span>
00423                 <span class="keywordflow">if</span> (vCluster[0] == <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr9">_RootCluster</a>)
00424                 {
00425                         <span class="comment">// this is the root cluster. This cluster have a size of 0 !</span>
00426                         <a class="code" href="a04223.html#a587">size</a> = <a class="code" href="a04142.html#a0">EAXLISTENER_MAXENVIRONMENTSIZE</a>;
00427                 }
00428                 <span class="keywordflow">else</span>
00429                 {
00430                         <span class="comment">// else, clip the env size to max eax supported size</span>
00431                         <a class="code" href="a04223.html#a587">size</a> = <a class="code" href="a04061.html#a0">min</a>(size, EAXLISTENER_MAXENVIRONMENTSIZE);
00432                 }
00433 
00434                 <a class="code" href="a04558.html#a15">uint</a> newEnv;
00435 
00436                 <span class="comment">// retreive the EAX environment number</span>
00437                 std::hash_map&lt;NLMISC::TStringId, uint&gt;::iterator it(<a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr2">_IdToEaxEnv</a>.find(fxId));
00438                 <span class="keywordflow">if</span> (it != <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr2">_IdToEaxEnv</a>.end())
00439                 {
00440                         <span class="comment">// there is an EAX effect</span>
00441                         newEnv = it-&gt;second;
00442                 }
00443                 <span class="keywordflow">else</span>
00444                 {
00445                         <span class="comment">// no effect, default to "PLAIN" effect</span>
00446                         <span class="keyword">static</span> <a class="code" href="a05378.html#a236">TStringId</a> plain = CStringMapper::map(<span class="stringliteral">"PLAIN"</span>);
00447                         newEnv = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr2">_IdToEaxEnv</a>[plain];
00448                 }
00449 
00450                 <span class="comment">// only update environement if there is some change.</span>
00451                 <span class="keywordflow">if</span> (newEnv != <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr4">_LastEnv</a>)
00452                 {
00453                         drvListener-&gt;setEnvironment(newEnv, size);
00454                         <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr4">_LastEnv</a> = newEnv;
00455                 }
00456         }
00457 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr0" doxytag="NLSOUND::CClusteredSound::_AudibleClusters" ></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="a02363.html#NLSOUND_1_1CClusteredSoundw0">TClusterStatusMap</a> <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">NLSOUND::CClusteredSound::_AudibleClusters</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The current audible cluster. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00252">252</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00957">addAudibleCluster()</a>, <a class="el" href="a05566.html#l00198">getAudibleClusters()</a>, <a class="el" href="a05565.html#l00459">getClusterSoundStatus()</a>, <a class="el" href="a05565.html#l00481">soundTraverse()</a>, and <a class="el" href="a05565.html#l00270">update()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr1" doxytag="NLSOUND::CClusteredSound::_AudioPath" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> std::vector&lt;std::pair&lt;<a class="el" href="a03128.html">NLMISC::CVector</a>, <a class="el" href="a03128.html">NLMISC::CVector</a>&gt; &gt; <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr1">NLSOUND::CClusteredSound::_AudioPath</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The segment of all the audio path. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00258">258</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05566.html#l00200">getAudioPath()</a>, and <a class="el" href="a05565.html#l00481">soundTraverse()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundv0" doxytag="NLSOUND::CClusteredSound::_EnvironmentNames" ></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"> char * <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundv0">NLSOUND::CClusteredSound::_EnvironmentNames</a><code> [static, private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Initial value:</b><div class="fragment"><pre>
{
    <span class="stringliteral">"GENERIC"</span>,
    <span class="stringliteral">"PADDEDCELL"</span>,
    <span class="stringliteral">"ROOM"</span>,
    <span class="stringliteral">"BATHROOM"</span>,
    <span class="stringliteral">"LIVINGROOM"</span>,
    <span class="stringliteral">"STONEROOM"</span>,
    <span class="stringliteral">"AUDITORIUM"</span>,
    <span class="stringliteral">"CONCERTHALL"</span>,
    <span class="stringliteral">"CAVE"</span>,
    <span class="stringliteral">"ARENA"</span>,
    <span class="stringliteral">"HANGAR"</span>,
    <span class="stringliteral">"CARPETEDHALLWAY"</span>,
    <span class="stringliteral">"HALLWAY"</span>,
    <span class="stringliteral">"STONECORRIDOR"</span>,
    <span class="stringliteral">"ALLEY"</span>,
    <span class="stringliteral">"FOREST"</span>,
    <span class="stringliteral">"CITY"</span>,
    <span class="stringliteral">"MOUNTAINS"</span>,
    <span class="stringliteral">"QUARRY"</span>,
    <span class="stringliteral">"PLAIN"</span>,
    <span class="stringliteral">"PARKINGLOT"</span>,
    <span class="stringliteral">"SEWERPIPE"</span>,
    <span class="stringliteral">"UNDERWATER"</span>,
    <span class="stringliteral">"DRUGGED"</span>,
    <span class="stringliteral">"DIZZY"</span>,
    <span class="stringliteral">"PSYCHOTIC"</span>,
        NULL
}
</pre></div>The environment name table for init. 
<p>

<p>
Definition at line <a class="el" href="a05565.html#l00051">51</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00222">CClusteredSound()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr2" doxytag="NLSOUND::CClusteredSound::_IdToEaxEnv" ></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::hash_map&lt;<a class="el" href="a05378.html#a236">NLMISC::TStringId</a>, <a class="el" href="a04558.html#a15">uint</a>&gt; <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr2">NLSOUND::CClusteredSound::_IdToEaxEnv</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The mapping for env name Id to EAX environement number. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00267">267</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00222">CClusteredSound()</a>, and <a class="el" href="a05565.html#l00270">update()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr3" doxytag="NLSOUND::CClusteredSound::_IdToMaterial" ></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::hash_map&lt;<a class="el" href="a05378.html#a236">NLMISC::TStringId</a>, <a class="el" href="a04558.html#a15">uint</a>&gt; <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr3">NLSOUND::CClusteredSound::_IdToMaterial</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The mapping for occlusion material name to material number. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00269">269</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00222">CClusteredSound()</a>, and <a class="el" href="a05565.html#l00481">soundTraverse()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr4" doxytag="NLSOUND::CClusteredSound::_LastEnv" ></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="a02363.html#NLSOUND_1_1CClusteredSoundr4">NLSOUND::CClusteredSound::_LastEnv</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The last setted environement. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00256">256</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundv1" doxytag="NLSOUND::CClusteredSound::_MaterialNames" ></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"> char * <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundv1">NLSOUND::CClusteredSound::_MaterialNames</a><code> [static, private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<b>Initial value:</b><div class="fragment"><pre> 
{
        <span class="stringliteral">"SINGLEWINDOW"</span>,
        <span class="stringliteral">"DOUBLEWINDOW"</span>,
        <span class="stringliteral">"THINDOOR"</span>,
        <span class="stringliteral">"THICKDOOR"</span>,
        <span class="stringliteral">"WOODWALL"</span>,
        <span class="stringliteral">"BRICKWALL"</span>,
        <span class="stringliteral">"STONEWALL"</span>,
        <span class="stringliteral">"CURTAIN"</span>,
        NULL
}
</pre></div>The material name table for init. 
<p>

<p>
Definition at line <a class="el" href="a05565.html#l00081">81</a> of file <a class="el" href="a05565.html">clustered_sound.cpp</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00222">CClusteredSound()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr5" doxytag="NLSOUND::CClusteredSound::_MaxEarDistance" ></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="a02363.html#NLSOUND_1_1CClusteredSoundr5">NLSOUND::CClusteredSound::_MaxEarDistance</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Maximum earing distance. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00244">244</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00957">addAudibleCluster()</a>, <a class="el" href="a05565.html#l00242">init()</a>, and <a class="el" href="a05565.html#l00481">soundTraverse()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr6" doxytag="NLSOUND::CClusteredSound::_MinGain" ></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="a02363.html#NLSOUND_1_1CClusteredSoundr6">NLSOUND::CClusteredSound::_MinGain</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Minimum gain. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00246">246</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00242">init()</a>, and <a class="el" href="a05565.html#l00481">soundTraverse()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr7" doxytag="NLSOUND::CClusteredSound::_NextTraversalStep" ></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="a02363.html#NLSOUND_1_1CClusteredSoundw1">TClusterTravContextMap</a> <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">NLSOUND::CClusteredSound::_NextTraversalStep</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The cluster for the next travesal step. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00254">254</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00941">addNextTraverse()</a>, and <a class="el" href="a05565.html#l00481">soundTraverse()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr8" doxytag="NLSOUND::CClusteredSound::_PortalInterpolate" ></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="a02363.html#NLSOUND_1_1CClusteredSoundr8">NLSOUND::CClusteredSound::_PortalInterpolate</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Interpolation distance when listener is near a portal. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00242">242</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00242">init()</a>, <a class="el" href="a05565.html#l00982">interpolateSourceDirection()</a>, and <a class="el" href="a05565.html#l00481">soundTraverse()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr9" doxytag="NLSOUND::CClusteredSound::_RootCluster" ></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="a02362.html">NL3D::CCluster</a>* <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr9">NLSOUND::CClusteredSound::_RootCluster</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The root cluster of the scene. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00248">248</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00242">init()</a>, <a class="el" href="a05565.html#l00481">soundTraverse()</a>, and <a class="el" href="a05565.html#l00270">update()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr10" doxytag="NLSOUND::CClusteredSound::_Scene" ></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="a03348.html">NL3D::CScene</a>* <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">NLSOUND::CClusteredSound::_Scene</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The scene of interest. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00240">240</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr11" doxytag="NLSOUND::CClusteredSound::_SoundGroupToSound" ></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::hash_map&lt;<a class="el" href="a05378.html#a236">NLMISC::TStringId</a>, <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>&gt; <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr11">NLSOUND::CClusteredSound::_SoundGroupToSound</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The sound_group to sound assoc. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00264">264</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.
<p>
Referenced by <a class="el" href="a05565.html#l00242">init()</a>, and <a class="el" href="a05565.html#l00270">update()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NLSOUND_1_1CClusteredSoundr12" doxytag="NLSOUND::CClusteredSound::_Sources" ></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::hash_map&lt;<a class="el" href="a05378.html#a236">NLMISC::TStringId</a>, <a class="el" href="a02364.html">CClusterSound</a>&gt; <a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr12">NLSOUND::CClusteredSound::_Sources</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The current cluster playing source indexed with sound group id. 
<p>

<p>
Definition at line <a class="el" href="a05566.html#l00261">261</a> of file <a class="el" href="a05566.html">clustered_sound.h</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a05566.html">clustered_sound.h</a><li><a class="el" href="a05565.html">clustered_sound.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 14:34:54 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>