SpotLightHelper.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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>
  17. <p>When the spot light or its target are transformed or light properties are
  18. changed, it's necessary to call the <code>update()</code> method of the respective helper.</p></div>
  19. <h2>Code Example</h2>
  20. <div translate="no"><pre><code class="language-js">const spotLight = new THREE.SpotLight( 0xffffff );
  21. spotLight.position.set( 10, 10, 10 );
  22. scene.add( spotLight );
  23. const spotLightHelper = new THREE.SpotLightHelper( spotLight );
  24. scene.add( spotLightHelper );
  25. </code></pre></div>
  26. </header>
  27. <article>
  28. <div class="container-overview">
  29. <h2>Constructor</h2>
  30. <h3 class="name name-method" id="SpotLightHelper" translate="no">new <a href="#SpotLightHelper">SpotLightHelper</a><span class="signature">( light : <span class="param-type"><a href="HemisphereLight.html">HemisphereLight</a></span>, color : <span class="param-type">number | <a href="Color.html">Color</a> | string</span> )</span> </h3>
  31. <div class="method">
  32. <div class="description">
  33. <p>Constructs a new spot light helper.</p>
  34. </div>
  35. <table class="params">
  36. <tbody>
  37. <tr>
  38. <td class="name">
  39. <strong translate="no">light</strong>
  40. </td>
  41. <td class="description last">
  42. <p>The light to be visualized.</p>
  43. </td>
  44. </tr>
  45. <tr>
  46. <td class="name">
  47. <strong translate="no">color</strong>
  48. </td>
  49. <td class="description last">
  50. <p>The helper's color. If not set, the helper will take
  51. the color of the light.</p>
  52. </td>
  53. </tr>
  54. </tbody>
  55. </table>
  56. </div>
  57. </div>
  58. <h2 class="subsection-title">Properties</h2>
  59. <div class="member">
  60. <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>
  61. <div class="description">
  62. <p>The color parameter passed in the constructor.
  63. If not set, the helper will take the color of the light.</p>
  64. </div>
  65. </div>
  66. <div class="member">
  67. <h3 class="name" id="light" translate="no">.<a href="#light">light</a><span class="type-signature"> : <a href="SpotLight.html">SpotLight</a></span> </h3>
  68. <div class="description">
  69. <p>The light being visualized.</p>
  70. </div>
  71. </div>
  72. <h2 class="subsection-title">Methods</h2>
  73. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  74. <div class="method">
  75. <div class="description">
  76. <p>Frees the GPU-related resources allocated by this instance. Call this
  77. method whenever this instance is no longer used in your app.</p>
  78. </div>
  79. </div>
  80. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  81. <div class="method">
  82. <div class="description">
  83. <p>Updates the helper to match the position and direction of the
  84. light being visualized.</p>
  85. </div>
  86. </div>
  87. <h2 class="subsection-title">Source</h2>
  88. <p>
  89. <a href="https://github.com/mrdoob/three.js/blob/master/src/helpers/SpotLightHelper.js" translate="no" target="_blank" rel="noopener">src/helpers/SpotLightHelper.js</a>
  90. </p>
  91. </article>
  92. </section>
  93. <script src="../scripts/linenumber.js"></script>
  94. <script src="../scripts/page.js"></script>
  95. </body>
  96. </html>
粤ICP备19079148号