ArrayNode.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ArrayNode - 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="TempNode.html">TempNode</a> → </p>
  13. <h1 translate="no">ArrayNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>ArrayNode represents a collection of nodes, typically created using the <a href="TSL.html#array">array</a> function.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const colors = array( [
  19. vec3( 1, 0, 0 ),
  20. vec3( 0, 1, 0 ),
  21. vec3( 0, 0, 1 )
  22. ] );
  23. const redColor = tintColors.element( 0 );
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="ArrayNode" translate="no">new <a href="#ArrayNode">ArrayNode</a><span class="signature">( nodeType : <span class="param-type">string</span>, count : <span class="param-type">number</span>, values : <span class="param-type">Array.&lt;Node></span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new array node.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name"><code>nodeType</code></td>
  38. <td class="description last"><p>The data type of the elements.</p></td>
  39. </tr>
  40. <tr>
  41. <td class="name"><code>count</code></td>
  42. <td class="description last"><p>Size of the array.</p></td>
  43. </tr>
  44. <tr>
  45. <td class="name"><code>values</code></td>
  46. <td class="description last"><p>Array default values.<br/>Default is <code>null</code>.</p></td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. </div>
  51. </div>
  52. <h2 class="subsection-title">Properties</h2>
  53. <div class="member">
  54. <h3 class="name" id="count" translate="no">.<a href="#count">count</a><span class="type-signature"> : number</span> </h3>
  55. <div class="description">
  56. <p>Array size.</p>
  57. </div>
  58. </div>
  59. <div class="member">
  60. <h3 class="name" id="isArrayNode" translate="no">.<a href="#isArrayNode">isArrayNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  61. <div class="description">
  62. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  63. </div>
  64. </div>
  65. <div class="member">
  66. <h3 class="name" id="values" translate="no">.<a href="#values">values</a><span class="type-signature"> : Array.&lt;<a href="Node.html">Node</a>></span> </h3>
  67. <div class="description">
  68. <p>Array default values.</p>
  69. </div>
  70. </div>
  71. <h2 class="subsection-title">Methods</h2>
  72. <h3 class="name name-method" id="generate" translate="no">.<a href="#generate">generate</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : string</span> </h3>
  73. <div class="method">
  74. <div class="description">
  75. <p>This method builds the output node and returns the resulting array as a shader string.</p>
  76. </div>
  77. <table class="params">
  78. <tbody>
  79. <tr>
  80. <td class="name"><code>builder</code></td>
  81. <td class="description last"><p>The current node builder.</p></td>
  82. </tr>
  83. </tbody>
  84. </table>
  85. <dl class="details">
  86. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#generate">TempNode#generate</a></dt>
  87. </dl>
  88. <dl class="details">
  89. <dt class="tag-returns"><strong>Returns:</strong> The generated shader string.</dt>
  90. </dl>
  91. </div>
  92. <h3 class="name name-method" id="getArrayCount" translate="no">.<a href="#getArrayCount">getArrayCount</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : number</span> </h3>
  93. <div class="method">
  94. <div class="description">
  95. <p>Returns the number of elements in the node array.</p>
  96. </div>
  97. <table class="params">
  98. <tbody>
  99. <tr>
  100. <td class="name"><code>builder</code></td>
  101. <td class="description last"><p>The current node builder.</p></td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. <dl class="details">
  106. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#getArrayCount">TempNode#getArrayCount</a></dt>
  107. </dl>
  108. <dl class="details">
  109. <dt class="tag-returns"><strong>Returns:</strong> The number of elements in the node array.</dt>
  110. </dl>
  111. </div>
  112. <h3 class="name name-method" id="getElementType" translate="no">.<a href="#getElementType">getElementType</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : string</span> </h3>
  113. <div class="method">
  114. <div class="description">
  115. <p>Returns the node's type.</p>
  116. </div>
  117. <table class="params">
  118. <tbody>
  119. <tr>
  120. <td class="name"><code>builder</code></td>
  121. <td class="description last"><p>The current node builder.</p></td>
  122. </tr>
  123. </tbody>
  124. </table>
  125. <dl class="details">
  126. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#getElementType">TempNode#getElementType</a></dt>
  127. </dl>
  128. <dl class="details">
  129. <dt class="tag-returns"><strong>Returns:</strong> The type of the node.</dt>
  130. </dl>
  131. </div>
  132. <h3 class="name name-method" id="getNodeType" translate="no">.<a href="#getNodeType">getNodeType</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : string</span> </h3>
  133. <div class="method">
  134. <div class="description">
  135. <p>Returns the node's type.</p>
  136. </div>
  137. <table class="params">
  138. <tbody>
  139. <tr>
  140. <td class="name"><code>builder</code></td>
  141. <td class="description last"><p>The current node builder.</p></td>
  142. </tr>
  143. </tbody>
  144. </table>
  145. <dl class="details">
  146. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#getNodeType">TempNode#getNodeType</a></dt>
  147. </dl>
  148. <dl class="details">
  149. <dt class="tag-returns"><strong>Returns:</strong> The type of the node.</dt>
  150. </dl>
  151. </div>
  152. <h2 class="subsection-title">Source</h2>
  153. <p>
  154. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/ArrayNode.js" target="_blank" rel="noopener" translate="no">src/nodes/core/ArrayNode.js</a>
  155. </p>
  156. </article>
  157. </section>
  158. <script src="../scripts/linenumber.js"></script>
  159. <script src="../scripts/page.js"></script>
  160. </body>
  161. </html>
粤ICP备19079148号