UniformNode.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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"><a href="global.html#any">any</a></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">
  30. <strong>value</strong>
  31. </td>
  32. <td class="description last">
  33. <p>The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture).</p>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td class="name">
  38. <strong>nodeType</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The node type. If no explicit type is defined, the node tries to derive the type from its value.</p>
  42. <p>Default is <code>null</code>.</p>
  43. </td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. </div>
  48. </div>
  49. <h2 class="subsection-title">Properties</h2>
  50. <div class="member">
  51. <h3 class="name" id="groupNode" translate="no">.<a href="#groupNode">groupNode</a><span class="type-signature"> : <a href="UniformGroupNode.html">UniformGroupNode</a></span> </h3>
  52. <div class="description">
  53. <p>The uniform group of this uniform. By default, uniforms are
  54. managed per object but they might belong to a shared group
  55. which is updated per frame or render call.</p>
  56. </div>
  57. </div>
  58. <div class="member">
  59. <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>
  60. <div class="description">
  61. <p>This flag can be used for type testing.</p>
  62. <p>Default is <code>true</code>.</p>
  63. </div>
  64. </div>
  65. <div class="member">
  66. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  67. <div class="description">
  68. <p>The name or label of the uniform.</p>
  69. <p>Default is <code>''</code>.</p>
  70. </div>
  71. <dl class="details">
  72. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="InputNode.html#name">InputNode#name</a></dt>
  73. </dl>
  74. </div>
  75. <h2 class="subsection-title">Methods</h2>
  76. <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>
  77. <div class="method">
  78. <div class="description">
  79. <p>Returns the <a href="UniformNode.html#groupNode">UniformNode#groupNode</a>.</p>
  80. </div>
  81. <dl class="details">
  82. <dt class="tag-returns"><strong>Returns:</strong> The uniform group.</dt>
  83. </dl>
  84. </div>
  85. <h3 class="name name-method" id="getUniformHash" translate="no">.<a href="#getUniformHash">getUniformHash</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : string</span> </h3>
  86. <div class="method">
  87. <div class="description">
  88. <p>By default, this method returns the result of <a href="Node.html#getHash">Node#getHash</a> but derived
  89. classes might overwrite this method with a different implementation.</p>
  90. </div>
  91. <table class="params">
  92. <tbody>
  93. <tr>
  94. <td class="name">
  95. <strong>builder</strong>
  96. </td>
  97. <td class="description last">
  98. <p>The current node builder.</p>
  99. </td>
  100. </tr>
  101. </tbody>
  102. </table>
  103. <dl class="details">
  104. <dt class="tag-returns"><strong>Returns:</strong> The uniform hash.</dt>
  105. </dl>
  106. </div>
  107. <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>
  108. <div class="method">
  109. <div class="description">
  110. <p>Sets the <a href="UniformNode.html#name">UniformNode#name</a> property.</p>
  111. </div>
  112. <table class="params">
  113. <tbody>
  114. <tr>
  115. <td class="name">
  116. <strong>name</strong>
  117. </td>
  118. <td class="description last">
  119. <p>The name of the uniform.</p>
  120. </td>
  121. </tr>
  122. </tbody>
  123. </table>
  124. <dl class="details">
  125. <dt class="important tag-deprecated"><strong>Deprecated:</strong> Yes</dt>
  126. </dl>
  127. <dl class="details">
  128. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  129. </dl>
  130. </div>
  131. <h3 class="name name-method" id="setGroup" translate="no">.<a href="#setGroup">setGroup</a><span class="signature">( group : <span class="param-type"><a href="UniformGroupNode.html">UniformGroupNode</a></span> )</span><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a></span> </h3>
  132. <div class="method">
  133. <div class="description">
  134. <p>Sets the <a href="UniformNode.html#groupNode">UniformNode#groupNode</a> property.</p>
  135. </div>
  136. <table class="params">
  137. <tbody>
  138. <tr>
  139. <td class="name">
  140. <strong>group</strong>
  141. </td>
  142. <td class="description last">
  143. <p>The uniform group.</p>
  144. </td>
  145. </tr>
  146. </tbody>
  147. </table>
  148. <dl class="details">
  149. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  150. </dl>
  151. </div>
  152. <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>
  153. <div class="method">
  154. <div class="description">
  155. <p>Sets the <a href="UniformNode.html#name">UniformNode#name</a> property.</p>
  156. </div>
  157. <table class="params">
  158. <tbody>
  159. <tr>
  160. <td class="name">
  161. <strong>name</strong>
  162. </td>
  163. <td class="description last">
  164. <p>The name of the uniform.</p>
  165. </td>
  166. </tr>
  167. </tbody>
  168. </table>
  169. <dl class="details">
  170. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  171. </dl>
  172. </div>
  173. <h2 class="subsection-title">Source</h2>
  174. <p>
  175. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/UniformNode.js" translate="no" target="_blank" rel="noopener">src/nodes/core/UniformNode.js</a>
  176. </p>
  177. </article>
  178. </section>
  179. <script src="../scripts/linenumber.js"></script>
  180. <script src="../scripts/page.js"></script>
  181. </body>
  182. </html>
粤ICP备19079148号