CodeNode.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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;Node></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"><code>code</code></td>
  32. <td class="description last"><p>The native code.<br/>Default is <code>''</code>.</p></td>
  33. </tr>
  34. <tr>
  35. <td class="name"><code>includes</code></td>
  36. <td class="description last"><p>An array of includes.<br/>Default is <code>[]</code>.</p></td>
  37. </tr>
  38. <tr>
  39. <td class="name"><code>language</code></td>
  40. <td class="description last"><p>The used language.<br/>Default is <code>''</code>.</p></td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. <h2 class="subsection-title">Properties</h2>
  47. <div class="member">
  48. <h3 class="name" id="code" translate="no">.<a href="#code">code</a><span class="type-signature"> : string</span> </h3>
  49. <div class="description">
  50. <p>The native code.<br/>Default is <code>''</code>.</p>
  51. </div>
  52. </div>
  53. <div class="member">
  54. <h3 class="name" id="global" translate="no">.<a href="#global">global</a><span class="type-signature"> : boolean</span> </h3>
  55. <div class="description">
  56. <p>This flag is used for global cache.<br/>Default is <code>true</code>.</p>
  57. </div>
  58. <dl class="details">
  59. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#global">Node#global</a></dt>
  60. </dl>
  61. </div>
  62. <div class="member">
  63. <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>
  64. <div class="description">
  65. <p>An array of includes<br/>Default is <code>[]</code>.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <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>
  70. <div class="description">
  71. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <h3 class="name" id="language" translate="no">.<a href="#language">language</a><span class="type-signature"> : 'js' | 'wgsl' | 'glsl'</span> </h3>
  76. <div class="description">
  77. <p>The used language.<br/>Default is <code>''</code>.</p>
  78. </div>
  79. </div>
  80. <h2 class="subsection-title">Methods</h2>
  81. <h3 class="name name-method" id="getIncludes" translate="no">.<a href="#getIncludes">getIncludes</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : Array.&lt;<a href="Node.html">Node</a>></span> </h3>
  82. <div class="method">
  83. <div class="description">
  84. <p>Returns the includes of this code node.</p>
  85. </div>
  86. <table class="params">
  87. <tbody>
  88. <tr>
  89. <td class="name"><code>builder</code></td>
  90. <td class="description last"><p>The current node builder.</p></td>
  91. </tr>
  92. </tbody>
  93. </table>
  94. <dl class="details">
  95. <dt class="tag-returns"><strong>Returns:</strong> The includes.</dt>
  96. </dl>
  97. </div>
  98. <h3 class="name name-method" id="setIncludes" translate="no">.<a href="#setIncludes">setIncludes</a><span class="signature">( includes : <span class="param-type">Array.&lt;Node></span> )</span><span class="type-signature"> : <a href="CodeNode.html">CodeNode</a></span> </h3>
  99. <div class="method">
  100. <div class="description">
  101. <p>Sets the includes of this code node.</p>
  102. </div>
  103. <table class="params">
  104. <tbody>
  105. <tr>
  106. <td class="name"><code>includes</code></td>
  107. <td class="description last"><p>The includes to set.</p></td>
  108. </tr>
  109. </tbody>
  110. </table>
  111. <dl class="details">
  112. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  113. </dl>
  114. </div>
  115. <h2 class="subsection-title">Source</h2>
  116. <p>
  117. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/code/CodeNode.js" target="_blank" rel="noopener" translate="no">src/nodes/code/CodeNode.js</a>
  118. </p>
  119. </article>
  120. </section>
  121. <script src="../scripts/linenumber.js"></script>
  122. <script src="../scripts/page.js"></script>
  123. </body>
  124. </html>
粤ICP备19079148号