1
0

CodeNode.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CodeNode - 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> → </p>
  13. <h1 translate="no">CodeNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class represents native code sections. It is the base
  17. class for modules like <a href="FunctionNode.html">FunctionNode</a> which allows to implement
  18. functions with native shader languages.</p></div>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="CodeNode" translate="no">new <a href="#CodeNode">CodeNode</a><span class="signature">( code : <span class="param-type">string</span>, includes : <span class="param-type">Array.&lt;<a href="Node.html">Node</a>></span>, language : <span class="param-type">'js' | 'wgsl' | 'glsl'</span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new code node.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name">
  32. <strong>code</strong>
  33. </td>
  34. <td class="description last">
  35. <p>The native code.</p>
  36. <p>Default is <code>''</code>.</p>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="name">
  41. <strong>includes</strong>
  42. </td>
  43. <td class="description last">
  44. <p>An array of includes.</p>
  45. <p>Default is <code>[]</code>.</p>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td class="name">
  50. <strong>language</strong>
  51. </td>
  52. <td class="description last">
  53. <p>The used language.</p>
  54. <p>Default is <code>''</code>.</p>
  55. </td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61. <h2 class="subsection-title">Properties</h2>
  62. <div class="member">
  63. <h3 class="name" id="code" translate="no">.<a href="#code">code</a><span class="type-signature"> : string</span> </h3>
  64. <div class="description">
  65. <p>The native code.</p>
  66. <p>Default is <code>''</code>.</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="global" translate="no">.<a href="#global">global</a><span class="type-signature"> : boolean</span> </h3>
  71. <div class="description">
  72. <p>This flag is used for global cache.</p>
  73. <p>Default is <code>true</code>.</p>
  74. </div>
  75. <dl class="details">
  76. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#global">Node#global</a></dt>
  77. </dl>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="includes" translate="no">.<a href="#includes">includes</a><span class="type-signature"> : Array.&lt;<a href="Node.html">Node</a>></span> </h3>
  81. <div class="description">
  82. <p>An array of includes</p>
  83. <p>Default is <code>[]</code>.</p>
  84. </div>
  85. </div>
  86. <div class="member">
  87. <h3 class="name" id="isCodeNode" translate="no">.<a href="#isCodeNode">isCodeNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  88. <div class="description">
  89. <p>This flag can be used for type testing.</p>
  90. <p>Default is <code>true</code>.</p>
  91. </div>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="language" translate="no">.<a href="#language">language</a><span class="type-signature"> : 'js' | 'wgsl' | 'glsl'</span> </h3>
  95. <div class="description">
  96. <p>The used language.</p>
  97. <p>Default is <code>''</code>.</p>
  98. </div>
  99. </div>
  100. <h2 class="subsection-title">Methods</h2>
  101. <h3 class="name name-method" id="getIncludes" translate="no">.<a href="#getIncludes">getIncludes</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : Array.&lt;<a href="Node.html">Node</a>></span> </h3>
  102. <div class="method">
  103. <div class="description">
  104. <p>Returns the includes of this code node.</p>
  105. </div>
  106. <table class="params">
  107. <tbody>
  108. <tr>
  109. <td class="name">
  110. <strong>builder</strong>
  111. </td>
  112. <td class="description last">
  113. <p>The current node builder.</p>
  114. </td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. <dl class="details">
  119. <dt class="tag-returns"><strong>Returns:</strong> The includes.</dt>
  120. </dl>
  121. </div>
  122. <h3 class="name name-method" id="setIncludes" translate="no">.<a href="#setIncludes">setIncludes</a><span class="signature">( includes : <span class="param-type">Array.&lt;<a href="Node.html">Node</a>></span> )</span><span class="type-signature"> : <a href="CodeNode.html">CodeNode</a></span> </h3>
  123. <div class="method">
  124. <div class="description">
  125. <p>Sets the includes of this code node.</p>
  126. </div>
  127. <table class="params">
  128. <tbody>
  129. <tr>
  130. <td class="name">
  131. <strong>includes</strong>
  132. </td>
  133. <td class="description last">
  134. <p>The includes to set.</p>
  135. </td>
  136. </tr>
  137. </tbody>
  138. </table>
  139. <dl class="details">
  140. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  141. </dl>
  142. </div>
  143. <h2 class="subsection-title">Source</h2>
  144. <p>
  145. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/code/CodeNode.js" translate="no" target="_blank" rel="noopener">src/nodes/code/CodeNode.js</a>
  146. </p>
  147. </article>
  148. </section>
  149. <script src="../scripts/linenumber.js"></script>
  150. <script src="../scripts/page.js"></script>
  151. </body>
  152. </html>
粤ICP备19079148号