MathNode.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MathNode - 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">MathNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This node represents a variety of mathematical methods available in shaders.
  17. They are divided into three categories:</p>
  18. <ul>
  19. <li>Methods with one input like <code>sin</code>, <code>cos</code> or <code>normalize</code>.</li>
  20. <li>Methods with two inputs like <code>dot</code>, <code>cross</code> or <code>pow</code>.</li>
  21. <li>Methods with three inputs like <code>mix</code>, <code>clamp</code> or <code>smoothstep</code>.</li>
  22. </ul></div>
  23. </header>
  24. <article>
  25. <div class="container-overview">
  26. <h2>Constructor</h2>
  27. <h3 class="name name-method" id="MathNode" translate="no">new <a href="#MathNode">MathNode</a><span class="signature">( method : <span class="param-type">string</span>, aNode : <span class="param-type"><a href="Node.html">Node</a></span>, bNode : <span class="param-type"><a href="Node.html">Node</a></span>, cNode : <span class="param-type"><a href="Node.html">Node</a></span> )</span> </h3>
  28. <div class="method">
  29. <div class="description">
  30. <p>Constructs a new math node.</p>
  31. </div>
  32. <table class="params">
  33. <tbody>
  34. <tr>
  35. <td class="name">
  36. <strong>method</strong>
  37. </td>
  38. <td class="description last">
  39. <p>The method name.</p>
  40. </td>
  41. </tr>
  42. <tr>
  43. <td class="name">
  44. <strong>aNode</strong>
  45. </td>
  46. <td class="description last">
  47. <p>The first input.</p>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td class="name">
  52. <strong>bNode</strong>
  53. </td>
  54. <td class="description last">
  55. <p>The second input.</p>
  56. <p>Default is <code>null</code>.</p>
  57. </td>
  58. </tr>
  59. <tr>
  60. <td class="name">
  61. <strong>cNode</strong>
  62. </td>
  63. <td class="description last">
  64. <p>The third input.</p>
  65. <p>Default is <code>null</code>.</p>
  66. </td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. </div>
  71. </div>
  72. <h2 class="subsection-title">Properties</h2>
  73. <div class="member">
  74. <h3 class="name" id="aNode" translate="no">.<a href="#aNode">aNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  75. <div class="description">
  76. <p>The first input.</p>
  77. </div>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="bNode" translate="no">.<a href="#bNode">bNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  81. <div class="description">
  82. <p>The second input.</p>
  83. <p>Default is <code>null</code>.</p>
  84. </div>
  85. </div>
  86. <div class="member">
  87. <h3 class="name" id="cNode" translate="no">.<a href="#cNode">cNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  88. <div class="description">
  89. <p>The third input.</p>
  90. <p>Default is <code>null</code>.</p>
  91. </div>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="isMathNode" translate="no">.<a href="#isMathNode">isMathNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  95. <div class="description">
  96. <p>This flag can be used for type testing.</p>
  97. <p>Default is <code>true</code>.</p>
  98. </div>
  99. </div>
  100. <div class="member">
  101. <h3 class="name" id="method" translate="no">.<a href="#method">method</a><span class="type-signature"> : string</span> </h3>
  102. <div class="description">
  103. <p>The method name.</p>
  104. </div>
  105. </div>
  106. <h2 class="subsection-title">Methods</h2>
  107. <h3 class="name name-method" id="getInputType" translate="no">.<a href="#getInputType">getInputType</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : string</span> </h3>
  108. <div class="method">
  109. <div class="description">
  110. <p>The input type is inferred from the node types of the input nodes.</p>
  111. </div>
  112. <table class="params">
  113. <tbody>
  114. <tr>
  115. <td class="name">
  116. <strong>builder</strong>
  117. </td>
  118. <td class="description last">
  119. <p>The current node builder.</p>
  120. </td>
  121. </tr>
  122. </tbody>
  123. </table>
  124. <dl class="details">
  125. <dt class="tag-returns"><strong>Returns:</strong> The input type.</dt>
  126. </dl>
  127. </div>
  128. <h3 class="name name-method" id="getNodeType" translate="no">.<a href="#getNodeType">getNodeType</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : string</span> </h3>
  129. <div class="method">
  130. <div class="description">
  131. <p>The selected method as well as the input type determine the node type of this node.</p>
  132. </div>
  133. <table class="params">
  134. <tbody>
  135. <tr>
  136. <td class="name">
  137. <strong>builder</strong>
  138. </td>
  139. <td class="description last">
  140. <p>The current node builder.</p>
  141. </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 node type.</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/math/MathNode.js" translate="no" target="_blank" rel="noopener">src/nodes/math/MathNode.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号