SpotLightHelper.html 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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"><a href="HemisphereLight.html">HemisphereLight</a></span>, color : <span class="param-type">number | <a href="Color.html">Color</a> | 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">
  37. <strong>light</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The light to be visualized.</p>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td class="name">
  45. <strong>color</strong>
  46. </td>
  47. <td class="description last">
  48. <p>The helper's color. If not set, the helper will take
  49. the color of the light.</p>
  50. </td>
  51. </tr>
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. <h2 class="subsection-title">Properties</h2>
  57. <div class="member">
  58. <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>
  59. <div class="description">
  60. <p>The color parameter passed in the constructor.
  61. If not set, the helper will take the color of the light.</p>
  62. </div>
  63. </div>
  64. <div class="member">
  65. <h3 class="name" id="light" translate="no">.<a href="#light">light</a><span class="type-signature"> : <a href="SpotLight.html">SpotLight</a></span> </h3>
  66. <div class="description">
  67. <p>The light being visualized.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Methods</h2>
  71. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  72. <div class="method">
  73. <div class="description">
  74. <p>Frees the GPU-related resources allocated by this instance. Call this
  75. method whenever this instance is no longer used in your app.</p>
  76. </div>
  77. </div>
  78. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  79. <div class="method">
  80. <div class="description">
  81. <p>Updates the helper to match the position and direction of the
  82. light being visualized.</p>
  83. </div>
  84. </div>
  85. <h2 class="subsection-title">Source</h2>
  86. <p>
  87. <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>
  88. </p>
  89. </article>
  90. </section>
  91. <script src="../scripts/linenumber.js"></script>
  92. <script src="../scripts/page.js"></script>
  93. </body>
  94. </html>
粤ICP备19079148号