ConstNode.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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"><a href="global.html#any">any</a></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">
  30. <strong>value</strong>
  31. </td>
  32. <td class="description last">
  33. <p>The value of this node. Usually a JS primitive or three.js object (vector, matrix, color).</p>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td class="name">
  38. <strong>nodeType</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The node type. If no explicit type is defined, the node tries to derive the type from its value.</p>
  42. <p>Default is <code>null</code>.</p>
  43. </td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. </div>
  48. </div>
  49. <h2 class="subsection-title">Properties</h2>
  50. <div class="member">
  51. <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>
  52. <div class="description">
  53. <p>This flag can be used for type testing.</p>
  54. <p>Default is <code>true</code>.</p>
  55. </div>
  56. </div>
  57. <h2 class="subsection-title">Methods</h2>
  58. <h3 class="name name-method" id="generateConst" translate="no">.<a href="#generateConst">generateConst</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : string</span> </h3>
  59. <div class="method">
  60. <div class="description">
  61. <p>Generates the shader string of the value with the current node builder.</p>
  62. </div>
  63. <table class="params">
  64. <tbody>
  65. <tr>
  66. <td class="name">
  67. <strong>builder</strong>
  68. </td>
  69. <td class="description last">
  70. <p>The current node builder.</p>
  71. </td>
  72. </tr>
  73. </tbody>
  74. </table>
  75. <dl class="details">
  76. <dt class="tag-returns"><strong>Returns:</strong> The generated value as a shader string.</dt>
  77. </dl>
  78. </div>
  79. <h2 class="subsection-title">Source</h2>
  80. <p>
  81. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/ConstNode.js" translate="no" target="_blank" rel="noopener">src/nodes/core/ConstNode.js</a>
  82. </p>
  83. </article>
  84. </section>
  85. <script src="../scripts/linenumber.js"></script>
  86. <script src="../scripts/page.js"></script>
  87. </body>
  88. </html>
粤ICP备19079148号