PositionalAudioHelper.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Object3D] &rarr; [page:Line] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">This helper displays the directional cone of a [page:PositionalAudio].</p>
  13. <h2>Import</h2>
  14. <p>
  15. [name] is an add-on, and must be imported explicitly.
  16. See [link:#manual/introduction/Installation Installation / Addons].
  17. </p>
  18. <code>
  19. import { PositionalAudioHelper } from 'three/addons/helpers/PositionalAudioHelper.js';
  20. </code>
  21. <h2>Code Example</h2>
  22. <code>
  23. const positionalAudio = new THREE.PositionalAudio( listener );
  24. positionalAudio.setDirectionalCone( 180, 230, 0.1 );
  25. const helper = new PositionalAudioHelper( positionalAudio );
  26. positionalAudio.add( helper );
  27. </code>
  28. <h2>Examples</h2>
  29. <div>[example:webaudio_orientation webaudio / orientation ]</div>
  30. <h2>Constructor</h2>
  31. <h3>[name]( [param:PositionalAudio audio], [param:Number range] )</h3>
  32. <p>
  33. [page:PositionalAudio audio] -- The [page:PositionalAudio] to be visualized. <br /><br/>
  34. [page:Number range] -- (optional) The range of the directional cone. <br /><br/>
  35. [page:Number divisionsInnerAngle] -- (optional) The amount of divisions of the inner part of the directional cone. <br /><br/>
  36. [page:Number divisionsOuterAngle] -- (optional) The amount of divisions of the outer part of the directional cone. <br /><br/>
  37. </p>
  38. <h2>Properties</h2>
  39. <p>See the base [page:Object3D] class for common properties.</p>
  40. <h3>[property:PositionalAudio audio]</h3>
  41. <p>[page:PositionalAudio] to be visualized.</p>
  42. <h3>[property:Number range]</h3>
  43. <p>The range of the directional cone.</p>
  44. <h3>[property:Number divisionsInnerAngle]</h3>
  45. <p>The amount of divisions of the inner part of the directional cone.</p>
  46. <h3>[property:Number divisionsOuterAngle]</h3>
  47. <p>The amount of divisions of the outer part of the directional cone.</p>
  48. <h2>Methods</h2>
  49. <p>See the base [page:Line] class for common methods.</p>
  50. <h3>[method:undefined update]()</h3>
  51. <p>Updates the helper.</p>
  52. <h3>[method:undefined dispose]()</h3>
  53. <p>
  54. Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
  55. </p>
  56. <h2>Source</h2>
  57. <p>
  58. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/helpers/PositionalAudioHelper.js examples/jsm/helpers/PositionalAudioHelper.js]
  59. </p>
  60. </body>
  61. </html>