ReflectorNode.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ReflectorNode - 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="InputNode.html">InputNode</a> → <a href="UniformNode.html">UniformNode</a> → <a href="TextureNode.html">TextureNode</a> → </p>
  13. <h1 translate="no">ReflectorNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This node can be used to implement mirror-like flat reflective surfaces.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const groundReflector = reflector();
  19. material.colorNode = groundReflector;
  20. const plane = new Mesh( geometry, material );
  21. plane.add( groundReflector.target );
  22. </code></pre></div>
  23. </header>
  24. <article>
  25. <div class="container-overview">
  26. <h2>Constructor</h2>
  27. <h3 class="name name-method" id="ReflectorNode" translate="no">new <a href="#ReflectorNode">ReflectorNode</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  28. <div class="method">
  29. <div class="description">
  30. <p>Constructs a new reflector node.</p>
  31. </div>
  32. <table class="params">
  33. <tbody>
  34. <tr>
  35. <td class="name"><code>parameters</code></td>
  36. <td class="description last"><p>An object holding configuration parameters.<br/>Default is <code>{}</code>.</p>
  37. <h6>Properties</h6>
  38. <table class="params">
  39. <tbody>
  40. <tr>
  41. <td class="name"><code>target</code></td>
  42. <td class="description last"><p>The 3D object the reflector is linked to.<br/>Default is <code>new Object3D()</code>.</p></td>
  43. </tr>
  44. <tr>
  45. <td class="name"><code>resolutionScale</code></td>
  46. <td class="description last"><p>The resolution scale.<br/>Default is <code>1</code>.</p></td>
  47. </tr>
  48. <tr>
  49. <td class="name"><code>generateMipmaps</code></td>
  50. <td class="description last"><p>Whether mipmaps should be generated or not.<br/>Default is <code>false</code>.</p></td>
  51. </tr>
  52. <tr>
  53. <td class="name"><code>bounces</code></td>
  54. <td class="description last"><p>Whether reflectors can render other reflector nodes or not.<br/>Default is <code>true</code>.</p></td>
  55. </tr>
  56. <tr>
  57. <td class="name"><code>depth</code></td>
  58. <td class="description last"><p>Whether depth data should be generated or not.<br/>Default is <code>false</code>.</p></td>
  59. </tr>
  60. <tr>
  61. <td class="name"><code>samples</code></td>
  62. <td class="description last"><p>Anti-Aliasing samples of the internal render-target.</p></td>
  63. </tr>
  64. <tr>
  65. <td class="name"><code>defaultTexture</code></td>
  66. <td class="description last"><p>The default texture node.</p></td>
  67. </tr>
  68. <tr>
  69. <td class="name"><code>reflector</code></td>
  70. <td class="description last"><p>The reflector base node.</p></td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. </td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. </div>
  79. </div>
  80. <h2 class="subsection-title">Properties</h2>
  81. <div class="member">
  82. <h3 class="name" id="reflector" translate="no">.<a href="#reflector">reflector</a><span class="type-signature"> : <a href="ReflectorBaseNode.html">ReflectorBaseNode</a></span> </h3>
  83. <div class="description">
  84. <p>A reference to the internal reflector node.</p>
  85. </div>
  86. </div>
  87. <div class="member">
  88. <h3 class="name" id="target" translate="no">.<a href="#target">target</a><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
  89. <div class="description">
  90. <p>A reference to 3D object the reflector is linked to.</p>
  91. </div>
  92. </div>
  93. <h2 class="subsection-title">Methods</h2>
  94. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  95. <div class="method">
  96. <div class="description">
  97. <p>Frees internal resources. Should be called when the node is no longer in use.</p>
  98. </div>
  99. <dl class="details">
  100. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TextureNode.html#dispose">TextureNode#dispose</a></dt>
  101. </dl>
  102. </div>
  103. <h3 class="name name-method" id="getDepthNode" translate="no">.<a href="#getDepthNode">getDepthNode</a><span class="signature">()</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  104. <div class="method">
  105. <div class="description">
  106. <p>Returns a node representing the mirror's depth. That can be used
  107. to implement more advanced reflection effects like distance attenuation.</p>
  108. </div>
  109. <dl class="details">
  110. <dt class="tag-returns"><strong>Returns:</strong> The depth node.</dt>
  111. </dl>
  112. </div>
  113. <h2 class="subsection-title">Source</h2>
  114. <p>
  115. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/utils/ReflectorNode.js" target="_blank" rel="noopener" translate="no">src/nodes/utils/ReflectorNode.js</a>
  116. </p>
  117. </article>
  118. </section>
  119. <script src="../scripts/linenumber.js"></script>
  120. <script src="../scripts/page.js"></script>
  121. </body>
  122. </html>
粤ICP备19079148号