MathNode.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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">Node</span>, bNode : <span class="param-type">Node</span>, cNode : <span class="param-type">Node</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"><code>method</code></td>
  36. <td class="description last"><p>The method name.</p></td>
  37. </tr>
  38. <tr>
  39. <td class="name"><code>aNode</code></td>
  40. <td class="description last"><p>The first input.</p></td>
  41. </tr>
  42. <tr>
  43. <td class="name"><code>bNode</code></td>
  44. <td class="description last"><p>The second input.<br/>Default is <code>null</code>.</p></td>
  45. </tr>
  46. <tr>
  47. <td class="name"><code>cNode</code></td>
  48. <td class="description last"><p>The third input.<br/>Default is <code>null</code>.</p></td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. <h2 class="subsection-title">Properties</h2>
  55. <div class="member">
  56. <h3 class="name" id="aNode" translate="no">.<a href="#aNode">aNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  57. <div class="description">
  58. <p>The first input.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="bNode" translate="no">.<a href="#bNode">bNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  63. <div class="description">
  64. <p>The second input.<br/>Default is <code>null</code>.</p>
  65. </div>
  66. </div>
  67. <div class="member">
  68. <h3 class="name" id="cNode" translate="no">.<a href="#cNode">cNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  69. <div class="description">
  70. <p>The third input.<br/>Default is <code>null</code>.</p>
  71. </div>
  72. </div>
  73. <div class="member">
  74. <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>
  75. <div class="description">
  76. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  77. </div>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="method" translate="no">.<a href="#method">method</a><span class="type-signature"> : string</span> </h3>
  81. <div class="description">
  82. <p>The method name.</p>
  83. </div>
  84. </div>
  85. <h2 class="subsection-title">Methods</h2>
  86. <h3 class="name name-method" id="getInputType" translate="no">.<a href="#getInputType">getInputType</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : string</span> </h3>
  87. <div class="method">
  88. <div class="description">
  89. <p>The input type is inferred from the node types of the input nodes.</p>
  90. </div>
  91. <table class="params">
  92. <tbody>
  93. <tr>
  94. <td class="name"><code>builder</code></td>
  95. <td class="description last"><p>The current node builder.</p></td>
  96. </tr>
  97. </tbody>
  98. </table>
  99. <dl class="details">
  100. <dt class="tag-returns"><strong>Returns:</strong> The input type.</dt>
  101. </dl>
  102. </div>
  103. <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>
  104. <div class="method">
  105. <div class="description">
  106. <p>The selected method as well as the input type determine the node type of this node.</p>
  107. </div>
  108. <table class="params">
  109. <tbody>
  110. <tr>
  111. <td class="name"><code>builder</code></td>
  112. <td class="description last"><p>The current node builder.</p></td>
  113. </tr>
  114. </tbody>
  115. </table>
  116. <dl class="details">
  117. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#getNodeType">TempNode#getNodeType</a></dt>
  118. </dl>
  119. <dl class="details">
  120. <dt class="tag-returns"><strong>Returns:</strong> The node type.</dt>
  121. </dl>
  122. </div>
  123. <h2 class="subsection-title">Source</h2>
  124. <p>
  125. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/math/MathNode.js" target="_blank" rel="noopener" translate="no">src/nodes/math/MathNode.js</a>
  126. </p>
  127. </article>
  128. </section>
  129. <script src="../scripts/linenumber.js"></script>
  130. <script src="../scripts/page.js"></script>
  131. </body>
  132. </html>
粤ICP备19079148号