ConstNode.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ConstNode - 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="InputNode.html">InputNode</a> → </p>
  13. <h1 translate="no">ConstNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Class for representing a constant value in the shader.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="ConstNode" translate="no">new <a href="#ConstNode">ConstNode</a><span class="signature">( value : <span class="param-type">any</span>, nodeType : <span class="param-type">string</span> )</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new input node.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name"><code>value</code></td>
  30. <td class="description last"><p>The value of this node. Usually a JS primitive or three.js object (vector, matrix, color).</p></td>
  31. </tr>
  32. <tr>
  33. <td class="name"><code>nodeType</code></td>
  34. <td class="description last"><p>The node type. If no explicit type is defined, the node tries to derive the type from its value.<br/>Default is <code>null</code>.</p></td>
  35. </tr>
  36. </tbody>
  37. </table>
  38. </div>
  39. </div>
  40. <h2 class="subsection-title">Properties</h2>
  41. <div class="member">
  42. <h3 class="name" id="isConstNode" translate="no">.<a href="#isConstNode">isConstNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  43. <div class="description">
  44. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  45. </div>
  46. </div>
  47. <h2 class="subsection-title">Methods</h2>
  48. <h3 class="name name-method" id="generateConst" translate="no">.<a href="#generateConst">generateConst</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : string</span> </h3>
  49. <div class="method">
  50. <div class="description">
  51. <p>Generates the shader string of the value with the current node builder.</p>
  52. </div>
  53. <table class="params">
  54. <tbody>
  55. <tr>
  56. <td class="name"><code>builder</code></td>
  57. <td class="description last"><p>The current node builder.</p></td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. <dl class="details">
  62. <dt class="tag-returns"><strong>Returns:</strong> The generated value as a shader string.</dt>
  63. </dl>
  64. </div>
  65. <h2 class="subsection-title">Source</h2>
  66. <p>
  67. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/ConstNode.js" target="_blank" rel="noopener" translate="no">src/nodes/core/ConstNode.js</a>
  68. </p>
  69. </article>
  70. </section>
  71. <script src="../scripts/linenumber.js"></script>
  72. <script src="../scripts/page.js"></script>
  73. </body>
  74. </html>
粤ICP备19079148号