1
0

SpotLightNode.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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">SpotLight</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"><code>light</code></td>
  30. <td class="description last"><p>The spot light source.<br/>Default is <code>null</code>.</p></td>
  31. </tr>
  32. </tbody>
  33. </table>
  34. </div>
  35. </div>
  36. <h2 class="subsection-title">Properties</h2>
  37. <div class="member">
  38. <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>
  39. <div class="description">
  40. <p>Uniform node representing the light color.</p>
  41. </div>
  42. <dl class="details">
  43. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="AnalyticLightNode.html#colorNode">AnalyticLightNode#colorNode</a></dt>
  44. </dl>
  45. </div>
  46. <div class="member">
  47. <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>
  48. <div class="description">
  49. <p>Uniform node representing the cone cosine.</p>
  50. </div>
  51. </div>
  52. <div class="member">
  53. <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>
  54. <div class="description">
  55. <p>Uniform node representing the cutoff distance.</p>
  56. </div>
  57. </div>
  58. <div class="member">
  59. <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>
  60. <div class="description">
  61. <p>Uniform node representing the decay exponent.</p>
  62. </div>
  63. </div>
  64. <div class="member">
  65. <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>
  66. <div class="description">
  67. <p>Uniform node representing the penumbra cosine.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Methods</h2>
  71. <h3 class="name name-method" id="getSpotAttenuation" translate="no">.<a href="#getSpotAttenuation">getSpotAttenuation</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span>, angleCosine : <span class="param-type">Node.&lt;float></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  72. <div class="method">
  73. <div class="description">
  74. <p>Computes the spot attenuation for the given angle.</p>
  75. </div>
  76. <table class="params">
  77. <tbody>
  78. <tr>
  79. <td class="name"><code>builder</code></td>
  80. <td class="description last"><p>The node builder.</p></td>
  81. </tr>
  82. <tr>
  83. <td class="name"><code>angleCosine</code></td>
  84. <td class="description last"><p>The angle to compute the spot attenuation for.</p></td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. <dl class="details">
  89. <dt class="tag-returns"><strong>Returns:</strong> The spot attenuation.</dt>
  90. </dl>
  91. </div>
  92. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( frame : <span class="param-type">NodeFrame</span> )</span> </h3>
  93. <div class="method">
  94. <div class="description">
  95. <p>Overwritten to updated spot light specific uniforms.</p>
  96. </div>
  97. <table class="params">
  98. <tbody>
  99. <tr>
  100. <td class="name"><code>frame</code></td>
  101. <td class="description last"><p>A reference to the current node frame.</p></td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. <dl class="details">
  106. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="AnalyticLightNode.html#update">AnalyticLightNode#update</a></dt>
  107. </dl>
  108. </div>
  109. <h2 class="subsection-title">Source</h2>
  110. <p>
  111. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/lighting/SpotLightNode.js" target="_blank" rel="noopener" translate="no">src/nodes/lighting/SpotLightNode.js</a>
  112. </p>
  113. </article>
  114. </section>
  115. <script src="../scripts/linenumber.js"></script>
  116. <script src="../scripts/page.js"></script>
  117. </body>
  118. </html>
粤ICP备19079148号