UniformNode.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>UniformNode - 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> → </p>
  13. <h1 translate="no">UniformNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Class for representing a uniform.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="UniformNode" translate="no">new <a href="#UniformNode">UniformNode</a><span class="signature">( value : <span class="param-type">any</span>, nodeType : <span class="param-type">string</span> )</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new uniform node.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name"><code>value</code></td>
  30. <td class="description last"><p>The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture).</p></td>
  31. </tr>
  32. <tr>
  33. <td class="name"><code>nodeType</code></td>
  34. <td class="description last"><p>The node type. If no explicit type is defined, the node tries to derive the type from its value.<br/>Default is <code>null</code>.</p></td>
  35. </tr>
  36. </tbody>
  37. </table>
  38. </div>
  39. </div>
  40. <h2 class="subsection-title">Properties</h2>
  41. <div class="member">
  42. <h3 class="name" id="groupNode" translate="no">.<a href="#groupNode">groupNode</a><span class="type-signature"> : <a href="UniformGroupNode.html">UniformGroupNode</a></span> </h3>
  43. <div class="description">
  44. <p>The uniform group of this uniform. By default, uniforms are
  45. managed per object but they might belong to a shared group
  46. which is updated per frame or render call.</p>
  47. </div>
  48. </div>
  49. <div class="member">
  50. <h3 class="name" id="isUniformNode" translate="no">.<a href="#isUniformNode">isUniformNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  51. <div class="description">
  52. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  53. </div>
  54. </div>
  55. <div class="member">
  56. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  57. <div class="description">
  58. <p>The name or label of the uniform.<br/>Default is <code>''</code>.</p>
  59. </div>
  60. <dl class="details">
  61. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="InputNode.html#name">InputNode#name</a></dt>
  62. </dl>
  63. </div>
  64. <h2 class="subsection-title">Methods</h2>
  65. <h3 class="name name-method" id="getGroup" translate="no">.<a href="#getGroup">getGroup</a><span class="signature">()</span><span class="type-signature"> : <a href="UniformGroupNode.html">UniformGroupNode</a></span> </h3>
  66. <div class="method">
  67. <div class="description">
  68. <p>Returns the <a href="UniformNode.html#groupNode">UniformNode#groupNode</a>.</p>
  69. </div>
  70. <dl class="details">
  71. <dt class="tag-returns"><strong>Returns:</strong> The uniform group.</dt>
  72. </dl>
  73. </div>
  74. <h3 class="name name-method" id="getUniformHash" translate="no">.<a href="#getUniformHash">getUniformHash</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : string</span> </h3>
  75. <div class="method">
  76. <div class="description">
  77. <p>By default, this method returns the result of <a href="Node.html#getHash">Node#getHash</a> but derived
  78. classes might overwrite this method with a different implementation.</p>
  79. </div>
  80. <table class="params">
  81. <tbody>
  82. <tr>
  83. <td class="name"><code>builder</code></td>
  84. <td class="description last"><p>The current node builder.</p></td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. <dl class="details">
  89. <dt class="tag-returns"><strong>Returns:</strong> The uniform hash.</dt>
  90. </dl>
  91. </div>
  92. <h3 class="name name-method" id="label" translate="no">.<a href="#label">label</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a></span> </h3>
  93. <div class="method">
  94. <div class="description">
  95. <p>Sets the <a href="UniformNode.html#name">UniformNode#name</a> property.</p>
  96. </div>
  97. <table class="params">
  98. <tbody>
  99. <tr>
  100. <td class="name"><code>name</code></td>
  101. <td class="description last"><p>The name of the uniform.</p></td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. <dl class="details">
  106. <dt class="important tag-deprecated"><strong>Deprecated:</strong> Yes</dt>
  107. </dl>
  108. <dl class="details">
  109. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  110. </dl>
  111. </div>
  112. <h3 class="name name-method" id="setGroup" translate="no">.<a href="#setGroup">setGroup</a><span class="signature">( group : <span class="param-type">UniformGroupNode</span> )</span><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a></span> </h3>
  113. <div class="method">
  114. <div class="description">
  115. <p>Sets the <a href="UniformNode.html#groupNode">UniformNode#groupNode</a> property.</p>
  116. </div>
  117. <table class="params">
  118. <tbody>
  119. <tr>
  120. <td class="name"><code>group</code></td>
  121. <td class="description last"><p>The uniform group.</p></td>
  122. </tr>
  123. </tbody>
  124. </table>
  125. <dl class="details">
  126. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  127. </dl>
  128. </div>
  129. <h3 class="name name-method" id="setName" translate="no">.<a href="#setName">setName</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a></span> </h3>
  130. <div class="method">
  131. <div class="description">
  132. <p>Sets the <a href="UniformNode.html#name">UniformNode#name</a> property.</p>
  133. </div>
  134. <table class="params">
  135. <tbody>
  136. <tr>
  137. <td class="name"><code>name</code></td>
  138. <td class="description last"><p>The name of the uniform.</p></td>
  139. </tr>
  140. </tbody>
  141. </table>
  142. <dl class="details">
  143. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  144. </dl>
  145. </div>
  146. <h2 class="subsection-title">Source</h2>
  147. <p>
  148. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/UniformNode.js" target="_blank" rel="noopener" translate="no">src/nodes/core/UniformNode.js</a>
  149. </p>
  150. </article>
  151. </section>
  152. <script src="../scripts/linenumber.js"></script>
  153. <script src="../scripts/page.js"></script>
  154. </body>
  155. </html>
粤ICP备19079148号