SpotLightHelper.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SpotLightHelper - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Object3D.html">Object3D</a> → </p>
  13. <h1 translate="no">SpotLightHelper</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This displays a cone shaped helper object for a <a href="SpotLight.html">SpotLight</a>.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const spotLight = new THREE.SpotLight( 0xffffff );
  19. spotLight.position.set( 10, 10, 10 );
  20. scene.add( spotLight );
  21. const spotLightHelper = new THREE.SpotLightHelper( spotLight );
  22. scene.add( spotLightHelper );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="SpotLightHelper" translate="no">new <a href="#SpotLightHelper">SpotLightHelper</a><span class="signature">( light : <span class="param-type">HemisphereLight</span>, color : <span class="param-type">number | Color | string</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new spot light helper.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name"><code>light</code></td>
  37. <td class="description last"><p>The light to be visualized.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>color</code></td>
  41. <td class="description last"><p>The helper's color. If not set, the helper will take
  42. the color of the light.</p></td>
  43. </tr>
  44. </tbody>
  45. </table>
  46. </div>
  47. </div>
  48. <h2 class="subsection-title">Properties</h2>
  49. <div class="member">
  50. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : number | <a href="Color.html">Color</a> | string</span> </h3>
  51. <div class="description">
  52. <p>The color parameter passed in the constructor.
  53. If not set, the helper will take the color of the light.</p>
  54. </div>
  55. </div>
  56. <div class="member">
  57. <h3 class="name" id="light" translate="no">.<a href="#light">light</a><span class="type-signature"> : <a href="SpotLight.html">SpotLight</a></span> </h3>
  58. <div class="description">
  59. <p>The light being visualized.</p>
  60. </div>
  61. </div>
  62. <h2 class="subsection-title">Methods</h2>
  63. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  64. <div class="method">
  65. <div class="description">
  66. <p>Frees the GPU-related resources allocated by this instance. Call this
  67. method whenever this instance is no longer used in your app.</p>
  68. </div>
  69. </div>
  70. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  71. <div class="method">
  72. <div class="description">
  73. <p>Updates the helper to match the position and direction of the
  74. light being visualized.</p>
  75. </div>
  76. </div>
  77. <h2 class="subsection-title">Source</h2>
  78. <p>
  79. <a href="https://github.com/mrdoob/three.js/blob/master/src/helpers/SpotLightHelper.js" target="_blank" rel="noopener" translate="no">src/helpers/SpotLightHelper.js</a>
  80. </p>
  81. </article>
  82. </section>
  83. <script src="../scripts/linenumber.js"></script>
  84. <script src="../scripts/page.js"></script>
  85. </body>
  86. </html>
粤ICP备19079148号