RendererReferenceNode.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>RendererReferenceNode - 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="ReferenceBaseNode.html">ReferenceBaseNode</a> → </p>
  13. <h1 translate="no">RendererReferenceNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This node is a special type of reference node which is intended
  17. for linking renderer properties with node values.</p>
  18. <p>When changing <code>renderer.toneMappingExposure</code>, the node value of <code>exposureNode</code> will
  19. automatically be updated.</p></div>
  20. <h2>Code Example</h2>
  21. <div translate="no"><pre><code class="language-js">const exposureNode = rendererReference( 'toneMappingExposure', 'float', renderer );
  22. </code></pre></div>
  23. </header>
  24. <article>
  25. <div class="container-overview">
  26. <h2>Constructor</h2>
  27. <h3 class="name name-method" id="RendererReferenceNode" translate="no">new <a href="#RendererReferenceNode">RendererReferenceNode</a><span class="signature">( property : <span class="param-type">string</span>, inputType : <span class="param-type">string</span>, renderer : <span class="param-type"><a href="Renderer.html">Renderer</a></span> )</span> </h3>
  28. <div class="method">
  29. <div class="description">
  30. <p>Constructs a new renderer reference node.</p>
  31. </div>
  32. <table class="params">
  33. <tbody>
  34. <tr>
  35. <td class="name">
  36. <strong>property</strong>
  37. </td>
  38. <td class="description last">
  39. <p>The name of the property the node refers to.</p>
  40. </td>
  41. </tr>
  42. <tr>
  43. <td class="name">
  44. <strong>inputType</strong>
  45. </td>
  46. <td class="description last">
  47. <p>The uniform type that should be used to represent the property value.</p>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td class="name">
  52. <strong>renderer</strong>
  53. </td>
  54. <td class="description last">
  55. <p>The renderer the property belongs to. When no renderer is set,
  56. the node refers to the renderer of the current state.</p>
  57. <p>Default is <code>null</code>.</p>
  58. </td>
  59. </tr>
  60. </tbody>
  61. </table>
  62. </div>
  63. </div>
  64. <h2 class="subsection-title">Properties</h2>
  65. <div class="member">
  66. <h3 class="name" id="renderer" translate="no">.<a href="#renderer">renderer</a><span class="type-signature"> : <a href="Renderer.html">Renderer</a></span> </h3>
  67. <div class="description">
  68. <p>The renderer the property belongs to. When no renderer is set,
  69. the node refers to the renderer of the current state.</p>
  70. <p>Default is <code>null</code>.</p>
  71. </div>
  72. </div>
  73. <h2 class="subsection-title">Methods</h2>
  74. <h3 class="name name-method" id="updateReference" translate="no">.<a href="#updateReference">updateReference</a><span class="signature">( state : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a> | <a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : Object</span> </h3>
  75. <div class="method">
  76. <div class="description">
  77. <p>Updates the reference based on the given state. The state is only evaluated
  78. <a href="RendererReferenceNode.html#renderer">RendererReferenceNode#renderer</a> is not set.</p>
  79. </div>
  80. <table class="params">
  81. <tbody>
  82. <tr>
  83. <td class="name">
  84. <strong>state</strong>
  85. </td>
  86. <td class="description last">
  87. <p>The current state.</p>
  88. </td>
  89. </tr>
  90. </tbody>
  91. </table>
  92. <dl class="details">
  93. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="ReferenceBaseNode.html#updateReference">ReferenceBaseNode#updateReference</a></dt>
  94. </dl>
  95. <dl class="details">
  96. <dt class="tag-returns"><strong>Returns:</strong> The updated reference.</dt>
  97. </dl>
  98. </div>
  99. <h2 class="subsection-title">Source</h2>
  100. <p>
  101. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/accessors/RendererReferenceNode.js" translate="no" target="_blank" rel="noopener">src/nodes/accessors/RendererReferenceNode.js</a>
  102. </p>
  103. </article>
  104. </section>
  105. <script src="../scripts/linenumber.js"></script>
  106. <script src="../scripts/page.js"></script>
  107. </body>
  108. </html>
粤ICP备19079148号