SpotLightNode.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SpotLightNode - 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="Node.html">Node</a> → <a href="LightingNode.html">LightingNode</a> → <a href="AnalyticLightNode.html">AnalyticLightNode</a> → </p>
  13. <h1 translate="no">SpotLightNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Module for representing spot lights as nodes.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="SpotLightNode" translate="no">new <a href="#SpotLightNode">SpotLightNode</a><span class="signature">( light : <span class="param-type"><a href="SpotLight.html">SpotLight</a></span> )</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new spot light node.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name">
  30. <strong>light</strong>
  31. </td>
  32. <td class="description last">
  33. <p>The spot light source.</p>
  34. <p>Default is <code>null</code>.</p>
  35. </td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. </div>
  41. <h2 class="subsection-title">Properties</h2>
  42. <div class="member">
  43. <h3 class="name" id="colorNode" translate="no">.<a href="#colorNode">colorNode</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;<a href="Color.html">Color</a>></span> </h3>
  44. <div class="description">
  45. <p>Uniform node representing the light color.</p>
  46. </div>
  47. <dl class="details">
  48. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="AnalyticLightNode.html#colorNode">AnalyticLightNode#colorNode</a></dt>
  49. </dl>
  50. </div>
  51. <div class="member">
  52. <h3 class="name" id="coneCosNode" translate="no">.<a href="#coneCosNode">coneCosNode</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  53. <div class="description">
  54. <p>Uniform node representing the cone cosine.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="cutoffDistanceNode" translate="no">.<a href="#cutoffDistanceNode">cutoffDistanceNode</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  59. <div class="description">
  60. <p>Uniform node representing the cutoff distance.</p>
  61. </div>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="decayExponentNode" translate="no">.<a href="#decayExponentNode">decayExponentNode</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  65. <div class="description">
  66. <p>Uniform node representing the decay exponent.</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="penumbraCosNode" translate="no">.<a href="#penumbraCosNode">penumbraCosNode</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  71. <div class="description">
  72. <p>Uniform node representing the penumbra cosine.</p>
  73. </div>
  74. </div>
  75. <h2 class="subsection-title">Methods</h2>
  76. <h3 class="name name-method" id="getSpotAttenuation" translate="no">.<a href="#getSpotAttenuation">getSpotAttenuation</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span>, angleCosine : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  77. <div class="method">
  78. <div class="description">
  79. <p>Computes the spot attenuation for the given angle.</p>
  80. </div>
  81. <table class="params">
  82. <tbody>
  83. <tr>
  84. <td class="name">
  85. <strong>builder</strong>
  86. </td>
  87. <td class="description last">
  88. <p>The node builder.</p>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class="name">
  93. <strong>angleCosine</strong>
  94. </td>
  95. <td class="description last">
  96. <p>The angle to compute the spot attenuation for.</p>
  97. </td>
  98. </tr>
  99. </tbody>
  100. </table>
  101. <dl class="details">
  102. <dt class="tag-returns"><strong>Returns:</strong> The spot attenuation.</dt>
  103. </dl>
  104. </div>
  105. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
  106. <div class="method">
  107. <div class="description">
  108. <p>Overwritten to updated spot light specific uniforms.</p>
  109. </div>
  110. <table class="params">
  111. <tbody>
  112. <tr>
  113. <td class="name">
  114. <strong>frame</strong>
  115. </td>
  116. <td class="description last">
  117. <p>A reference to the current node frame.</p>
  118. </td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. <dl class="details">
  123. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="AnalyticLightNode.html#update">AnalyticLightNode#update</a></dt>
  124. </dl>
  125. </div>
  126. <h2 class="subsection-title">Source</h2>
  127. <p>
  128. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/lighting/SpotLightNode.js" translate="no" target="_blank" rel="noopener">src/nodes/lighting/SpotLightNode.js</a>
  129. </p>
  130. </article>
  131. </section>
  132. <script src="../scripts/linenumber.js"></script>
  133. <script src="../scripts/page.js"></script>
  134. </body>
  135. </html>
粤ICP备19079148号