1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" />
7    <title>UpdateAmbientParam</title>
8  </head>
9  <body>
10    <h1><CODE><a href="../../../nw/Overview.html">nw</a>::<a href="../../../nw/snd/Overview.html">snd</a>::<a href="../../../nw/snd/Sound3DEngine/Overview.html">Sound3DEngine</a>::UpdateAmbientParam</CODE> Member Function</h1>
11    <h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nw/snd/snd_Sound3DEngine.h&gt;
14protected:
15virtual void UpdateAmbientParam(
16     const <a href="../../../nw/snd/Sound3DManager/Overview.html">Sound3DManager</a> * sound3DManager,
17     const <a href="../../../nw/snd/Sound3DParam/Overview.html">Sound3DParam</a> * sound3DParam,
18     <span>u32</span> soundId,
19     <span>u32</span> updateFlag,
20     <a href="../../../nw/snd/SoundAmbientParam/Overview.html">SoundAmbientParam</a> * ambientParam
21);
22</pre>
23    </div>
24    <h2>Arguments</h2>
25    <div class="section">
26      <table class="arguments">
27        <thead>
28          <tr>
29            <td width="15" />
30            <th>Name</th>
31            <td>Description</td>
32          </tr>
33        </thead>
34        <tr>
35          <td>in</td>
36          <th>sound3DManager</th>
37          <td>The 3D Sound Manager.</td>
38        </tr>
39        <tr>
40          <td>in</td>
41          <th>sound3DParam</th>
42          <td>The 3D sound parameter.</td>
43        </tr>
44        <tr>
45          <td>in</td>
46          <th>soundId</th>
47          <td>Sound ID.</td>
48        </tr>
49        <tr>
50          <td>in</td>
51          <th>updateFlag</th>
52          <td>A flag that shows which parameters to update.</td>
53        </tr>
54        <tr>
55          <td>out</td>
56          <th>ambientParam</th>
57          <td>Parameter structure that stores the results of the calculation.</td>
58        </tr> </table>
59    </div>
60    <h2>Return Values</h2>
61    <div class="section">
62                None.
63               </div>
64    <h2>Description</h2>
65    <div class="section">
66      <p>Calculates 3D sound parameters.</p><p>This function is called when a sound is started and when it is updated in each frame.</p><p>Override this function when creating a customized 3D sound engine class and store the parameter calculation results in ambientParam. The stored values will be reflected in the sound processing at each frame.</p><p>3D sound listener and 3D sound actor information is used to calculate the parameters. 3D sound listeners can be obtained from sound3DManager. Additionally, the sound3DParam parameter structure, used during calculation, includes actor coordinates and the 3D sound settings for each sound.</p><p>updateFlag is a bit flag that shows which parameters must be calculated. The parameters in the ambientParam structure that correspond to each of the flags are updated with respect to the sound. Operations are undefined when a parameter that does not have its flag set is updated.</p><p><itemizedlist><listitem><para>UPDATE_VOLUME ... ambientParam.volume <br /></para></listitem><listitem><para>UPDATE_PAN ... ambientParam.pan <br /></para></listitem><listitem><para>UPDATE_PRIORITY ... ambientParam.priority <br /></para></listitem><listitem><para>UPDATE_PITCH ... ambientParam.pitch <br /></para></listitem></itemizedlist></p><p>When this function is called to calculate priorities before sound playback begins, UPDATE_START_PRIORITY is set in updateFlag. (UPDATE_PRIORITY is also set at this time.)</p><p>The results from the previous cycle of 3D sound calculations are stored in the ambientParam structure passed as an argument. When overriding the <CODE>UpdateAmbientParam</CODE> function, you can avoid sudden parameter changes by comparing the values passed here with the values calculated in the current cycle. This comparison allows you to suppress popping and crackling noises.</p></div>
67    <h2>See Also</h2>
68    <div class="section">
69      <p class="reference"><CODE><a href="../../../nw/snd/Sound3DManager/Overview.html">Sound3DManager</a></CODE> Class<br /><CODE><a href="../../../nw/snd/Sound3DParam/Overview.html">Sound3DParam</a></CODE> Structure<br /><CODE><a href="../../../nw/snd/SoundAmbientParam/Overview.html">SoundAmbientParam</a></CODE> Class<br /> </p>
70    </div>
71    <h2>Revision History</h2>
72    <div class="section">
73      <dl class="history">
74        <dt>2010/03/12</dt>
75        <dd>Initial version.<br />
76        </dd>
77      </dl>
78    </div>
79  <hr><p>CONFIDENTIAL</p></body>
80</html>
81