diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02363.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a02363.html | 2206 |
1 files changed, 2206 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02363.html b/docs/doxygen/nel/a02363.html new file mode 100644 index 00000000..79d8a918 --- /dev/null +++ b/docs/doxygen/nel/a02363.html @@ -0,0 +1,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 Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLSOUND::CClusteredSound Class Reference</h1><code>#include <<a class="el" href="a05566.html">clustered_sound.h</a>></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< <a class="el" href="a02362.html">NL3D::CCluster</a> *,<br> + <a class="el" href="a02365.html">CClusterSoundStatus</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundw0">TClusterStatusMap</a></td></tr> + +<tr><td class="mdescLeft"> </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< <a class="el" href="a02362.html">NL3D::CCluster</a> *,<br> + <a class="el" href="a02366.html">CSoundTravContext</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundw1">TClusterTravContextMap</a></td></tr> + +<tr><td class="mdescLeft"> </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> </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSounda0">CClusteredSound</a> ()</td></tr> + +<tr><td class="mdescLeft"> </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> & </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< std::pair<<br> + <a class="el" href="a03128.html">NLMISC::CVector</a>, <a class="el" href="a03128.html">NLMISC::CVector</a> > > & </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> * </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> * </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 </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 </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> &listenerPos, const <a class="el" href="a03128.html">NLMISC::CVector</a> &view, const <a class="el" href="a03128.html">NLMISC::CVector</a> &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 </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> &soundStatus)</td></tr> + +<tr><td class="mdescLeft"> </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 </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> &travContext)</td></tr> + +<tr><td class="mdescLeft"> </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> </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> &context, float portalDist, const <a class="el" href="a03128.html">NLMISC::CVector</a> &nearPoint, const <a class="el" href="a03128.html">NLMISC::CVector</a> &realListener, <a class="el" href="a03128.html">NLMISC::CVector</a> &d1, <a class="el" href="a03128.html">NLMISC::CVector</a> &d2, float &<a class="el" href="a04223.html#a663">alpha</a>)</td></tr> + +<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundd3">soundTraverse</a> (const std::vector< <a class="el" href="a02362.html">NL3D::CCluster</a> * > &clusters, <a class="el" href="a02366.html">CSoundTravContext</a> &travContext)</td></tr> + +<tr><td class="mdescLeft"> </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 </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> &box, const <a class="el" href="a03128.html">NLMISC::CVector</a> &pos, <a class="el" href="a03128.html">NLMISC::CVector</a> &nearPos)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundz1297_1">getPolyNearestPos</a> (const std::vector< <a class="el" href="a03128.html">NLMISC::CVector</a> > &poly, const <a class="el" href="a03128.html">NLMISC::CVector</a> &pos, <a class="el" href="a03128.html">NLMISC::CVector</a> &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> </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr0">_AudibleClusters</a></td></tr> + +<tr><td class="mdescLeft"> </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< std::pair< <a class="el" href="a03128.html">NLMISC::CVector</a>,<br> + <a class="el" href="a03128.html">NLMISC::CVector</a> > > </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr1">_AudioPath</a></td></tr> + +<tr><td class="mdescLeft"> </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< <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>,<br> + <a class="el" href="a04558.html#a15">uint</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr2">_IdToEaxEnv</a></td></tr> + +<tr><td class="mdescLeft"> </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< <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>,<br> + <a class="el" href="a04558.html#a15">uint</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr3">_IdToMaterial</a></td></tr> + +<tr><td class="mdescLeft"> </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> </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr4">_LastEnv</a></td></tr> + +<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr5">_MaxEarDistance</a></td></tr> + +<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr6">_MinGain</a></td></tr> + +<tr><td class="mdescLeft"> </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> </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr7">_NextTraversalStep</a></td></tr> + +<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr8">_PortalInterpolate</a></td></tr> + +<tr><td class="mdescLeft"> </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> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr9">_RootCluster</a></td></tr> + +<tr><td class="mdescLeft"> </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> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a></td></tr> + +<tr><td class="mdescLeft"> </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< <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>,<br> + <a class="el" href="a05378.html#a236">NLMISC::TStringId</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr11">_SoundGroupToSound</a></td></tr> + +<tr><td class="mdescLeft"> </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< <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>,<br> + <a class="el" href="a02364.html">CClusterSound</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundr12">_Sources</a></td></tr> + +<tr><td class="mdescLeft"> </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 * </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundv0">_EnvironmentNames</a> []</td></tr> + +<tr><td class="mdescLeft"> </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 * </td><td class="memItemRight" valign=bottom><a class="el" href="a02363.html#NLSOUND_1_1CClusteredSoundv1">_MaterialNames</a> []</td></tr> + +<tr><td class="mdescLeft"> </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<<a class="el" href="a02362.html">NL3D::CCluster</a>*, <a class="el" href="a02365.html">CClusterSoundStatus</a>> <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> + + </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<<a class="el" href="a02362.html">NL3D::CCluster</a>*, <a class="el" href="a02366.html">CSoundTravContext</a>> <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> + + </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 & 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">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor. +<p> + +<p> +Definition at line <a class="el" href="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">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02362.html">NL3D::CCluster</a> * </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> & </td> + <td class="mdname" nowrap> <em>soundStatus</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +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 < _MaxEarDistance); +00961 <a class="code" href="a04199.html#a6">nlassert</a>(soundStatus.Direction.norm() <= 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 < it->second.Dist) +00967 { +00968 it->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">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02362.html">NL3D::CCluster</a> * </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> & </td> + <td class="mdname" nowrap> <em>travContext</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +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<CCluster*, CSoundTravContext>::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->second.Dist > travContext.Dist) +00948 { +00949 it->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">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02156.html">NLMISC::CAABBox</a> & </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> & </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> & </td> + <td class="mdname" nowrap> <em>nearPos</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +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> </td><td>The bounding box description. </td></tr> + <tr><td valign=top><em>pos</em> </td><td>The reference position. </td></tr> + <tr><td valign=top><em>nearPoint</em> </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>& NLSOUND::CClusteredSound::getAudibleClusters </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="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<std::pair<<a class="el" href="a03128.html">NLMISC::CVector</a>, <a class="el" href="a03128.html">NLMISC::CVector</a>> >& NLSOUND::CClusteredSound::getAudioPath </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="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">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02362.html">NL3D::CCluster</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>cluster</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="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> &(it->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">( </td> + <td class="md" nowrap valign="top">const std::vector< <a class="el" href="a03128.html">NLMISC::CVector</a> > & </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> & </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> & </td> + <td class="mdname" nowrap> <em>nearPoint</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +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> </td><td>The polygone description. </td></tr> + <tr><td valign=top><em>pos</em> </td><td>The reference position. </td></tr> + <tr><td valign=top><em>nearPoint</em> </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<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 < minDist) +01113 { +01114 nearPoint = poly[j]; +01115 minDist = d; +01116 } +01117 <span class="comment">// if (projIn /*&& j<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])) < 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>=0 && p<=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 < 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">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="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>-><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">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03348.html">NL3D::CScene</a> * </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 </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 </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 </td> + <td class="mdname" nowrap> <em>minGain</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +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> </td><td>The scene of interest for cluster management. </td></tr> + <tr><td valign=top><em>portalInterpolate</em> </td><td>Ditance from listener to portal for interpolation. </td></tr> + <tr><td valign=top><em>maxEarDist</em> </td><td>The maximum traversal distance to limit graph traversal. </td></tr> + <tr><td valign=top><em>minGain</em> </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()->getPackedSheetPath()+<span class="stringliteral">"sound_groups.packed_sheets"</span>, <a class="code" href="a05381.html#a6">Container</a>, CAudioMixerUser::instance()->getPackedSheetUpdate(), <span class="keyword">false</span>); +00246 +00247 <span class="comment">// copy the container data into internal structure</span> +00248 std::map<std::string, CSoundGroupSerializer>::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->second._SoundGroupAssoc.begin(), first->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>-><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">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02366.html">CSoundTravContext</a> & </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 </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> & </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> & </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> & </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> & </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 & </td> + <td class="mdname" nowrap> <em>alpha</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +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 > <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr8">_PortalInterpolate</a> || <a class="code" href="a04223.html#a663">alpha</a> >= 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() <= 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 < _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">( </td> + <td class="md" nowrap valign="top">const std::vector< <a class="el" href="a02362.html">NL3D::CCluster</a> * > & </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> & </td> + <td class="mdname" nowrap> <em>travContext</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +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<CCluster*, CSoundTravContext> nextTraverse;</span> +00485 std::vector<std::pair<const CCluster*, CSoundTravContext> > 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<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<clusters[i]->getNbPortals(); j++) +00509 { +00510 <a class="code" href="a03103.html">CPortal</a> *portal = clusters[i]->getPortal(j); +00511 <span class="keyword">const</span> std::vector<CVector> &poly = portal-><a class="code" href="a03103.html#NL3D_1_1CPortala7">getPoly</a>(); +00512 +00513 <span class="keywordflow">if</span> (poly.size() < 3) +00514 { +00515 <span class="comment">// only warn once, avoid log flooding !</span> +00516 <span class="keyword">static</span> std::set<std::string> warned; +00517 <span class="keywordflow">if</span> (warned.find(clusters[i]->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]->Name.c_str(), portal-><a class="code" href="a03103.html#NL3D_1_1CPortala4">getName</a>().empty() ? <span class="stringliteral">"no name"</span> : portal-><a class="code" href="a03103.html#NL3D_1_1CPortala4">getName</a>().c_str()); +00521 warned.insert(clusters[i]->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]->getBBox().getCenter() - poly[0]) * normal; +00530 +00531 <span class="keywordflow">if</span> ((dist < 0 && dist2 > 0) || (dist > 0 && dist2 < 0)) +00532 { +00533 <span class="keywordflow">if</span> (portal-><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-><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-><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->getCluster(0) == clusters[i] && dist > 0)</span> +00551 <span class="comment">// if (!portal->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->getCluster(1) == clusters[i] && dist < 0)</span> +00557 <span class="comment">// if (portal->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<CCluster*>(curClusters.back().first); +00580 CSoundTravContext &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<cluster-><a class="code" href="a02362.html#NL3D_1_1CClustera14">getNbPortals</a>(); ++i) +00597 { +00598 <a class="code" href="a03103.html">CPortal</a> *portal = cluster-><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-><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-><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 && travContext.PreviousCluster != otherCluster) <span class="comment">// && (!travContext.FilterUnvisibleChild || otherCluster->AudibleFromFather))</span> +00610 { +00611 <span class="keyword">const</span> vector<CVector> &poly = portal-><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() < 3) +00615 { +00616 <span class="comment">// only warn once, avoid log flooding !</span> +00617 <span class="keyword">static</span> std::set<std::string> warned; +00618 <span class="keywordflow">if</span> (warned.find(cluster-><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-><a class="code" href="a02362.html#NL3D_1_1CClustero8">Name</a>.c_str(), portal-><a class="code" href="a03103.html#NL3D_1_1CPortala4">getName</a>().empty() ? <span class="stringliteral">"no name"</span> : portal-><a class="code" href="a03103.html#NL3D_1_1CPortala4">getName</a>().c_str()); +00622 warned.insert(cluster-><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 > 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 > 340 <span class="comment">/* && otherCluster->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-><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 < <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 < <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-><a class="code" href="a03103.html#NL3D_1_1CPortalz698_1">getOcclusionModelId</a>(); +00689 std::hash_map<NLMISC::TStringId, uint>::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->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->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->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->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 >= 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 < 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 < 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-><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<cluster-><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-><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-><a class="code" href="a02362.html#NL3D_1_1CClustero1">AudibleFromFather</a> && c-><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-><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 < <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-><a class="code" href="a02362.html#NL3D_1_1CClustero4">Father</a> && cluster-><a class="code" href="a02362.html#NL3D_1_1CClustero4">Father</a> != travContext.PreviousCluster && cluster-><a class="code" href="a02362.html#NL3D_1_1CClustero5">FatherAudible</a>) +00872 { +00873 <span class="comment">// if (!travContext.FilterUnvisibleFather || ((1.0f-travContext.Alpha) > travContext.MinGain))</span> +00874 { +00875 <a class="code" href="a02362.html">CCluster</a> *c = cluster-><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-><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->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 > <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">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">NLMISC::CVector</a> & </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> & </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> & </td> + <td class="mdname" nowrap> <em>up</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +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> &clipTrav = <a class="code" href="a02363.html#NLSOUND_1_1CClusteredSoundr10">_Scene</a>-><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<CCluster*> 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>-><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<uint, CClusterSound> newSources; +00306 +00307 { +00308 <span class="comment">// fake the distance for all playing source</span> +00309 <span class="comment">// std::map<std::string, CClusterSound>::iterator first(_Sources.begin()), last(_Sources.end());</span> +00310 std::hash_map<NLMISC::TStringId, CClusterSound>::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->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 &css = first->second; +00323 <a class="code" href="a02362.html">CCluster</a> *cluster = first->first; +00324 NLMISC::TStringId soundGroup; +00325 +00326 soundGroup = cluster-><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<NLMISC::TStringId, CClusterSound>::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 &cs = it->second; +00337 +00338 <span class="keywordflow">if</span> (cs.Distance >= css.Dist) +00339 { +00340 <span class="comment">// this one is better !</span> +00341 cs.Distance = css.Dist; +00342 cs.Source->setPos(listenerPos + css.Direction * css.Dist + CVector(0,0,2)); +00343 <span class="keywordflow">if</span> (css.DistFactor < 1.0f) +00344 cs.Source->setRelativeGain(css.Gain * (1.0f - (css.DistFactor*css.DistFactor*css.DistFactor*css.DistFactor))); +00345 <span class="keywordflow">else</span> +00346 cs.Source->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<NLMISC::TStringId, NLMISC::TStringId>::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->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()->createSource(soundName, <span class="keyword">false</span>, NULL, NULL, cluster); +00366 <span class="keywordflow">if</span> (cs.Source != 0) +00367 { +00368 cs.Source->setPos(listenerPos + css.Direction * css.Dist + CVector(0,0,2)); +00369 <span class="keywordflow">if</span> (css.DistFactor < 1.0f) +00370 cs.Source->setRelativeGain(css.Gain * (1.0f - (css.DistFactor*css.DistFactor))); +00371 <span class="keywordflow">else</span> +00372 cs.Source->setRelativeGain(css.Gain); +00373 cs.Source->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 >= 0x450</span> +00383 <span class="preprocessor"></span> std::hash_map<NLMISC::TStringId, CClusterSound> 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<NLMISC::TStringId, CClusterSound> 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<uint, CClusterSound>::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->second.Source->isPlaying()) +00397 first->second.Source->play(); +00398 +00399 oldSources.erase(first->first); +00400 } +00401 +00402 <span class="keywordflow">while</span> (!oldSources.empty()) +00403 { +00404 CClusterSound &cs = oldSources.begin()->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]->getEnvironmentFxId(); +00416 +00417 IListener *drvListener = static_cast<CListenerUser*>(mixer->getListener())->getListener(); +00418 <span class="keyword">const</span> <a class="code" href="a02156.html">CAABBox</a> &box = vCluster[0]->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<NLMISC::TStringId, uint>::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->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->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> + + </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<std::pair<<a class="el" href="a03128.html">NLMISC::CVector</a>, <a class="el" href="a03128.html">NLMISC::CVector</a>> > <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> + + </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> + + </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<<a class="el" href="a05378.html#a236">NLMISC::TStringId</a>, <a class="el" href="a04558.html#a15">uint</a>> <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> + + </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<<a class="el" href="a05378.html#a236">NLMISC::TStringId</a>, <a class="el" href="a04558.html#a15">uint</a>> <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> + + </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> + + </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> + + </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> + + </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> + + </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> + + </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> + + </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> + + </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> + + </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<<a class="el" href="a05378.html#a236">NLMISC::TStringId</a>, <a class="el" href="a05378.html#a236">NLMISC::TStringId</a>> <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> + + </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<<a class="el" href="a05378.html#a236">NLMISC::TStringId</a>, <a class="el" href="a02364.html">CClusterSound</a>> <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> + + </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> |