InputNode.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>InputNode - 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">InputNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Base class for representing data input nodes.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="InputNode" translate="no">new <a href="#InputNode">InputNode</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. This can be any JS primitive, functions, array buffers or even three.js objects (vector, matrices, colors).</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="isInputNode" translate="no">.<a href="#isInputNode">isInputNode</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. <div class="member">
  48. <h3 class="name" id="precision" translate="no">.<a href="#precision">precision</a><span class="type-signature"> : 'low' | 'medium' | 'high'</span> </h3>
  49. <div class="description">
  50. <p>The precision of the value in the shader.<br/>Default is <code>null</code>.</p>
  51. </div>
  52. </div>
  53. <div class="member">
  54. <h3 class="name" id="value" translate="no">.<a href="#value">value</a><span class="type-signature"> : <a href="global.html#any">any</a></span> </h3>
  55. <div class="description">
  56. <p>The value of this node. This can be any JS primitive, functions, array buffers or even three.js objects (vector, matrices, colors).</p>
  57. </div>
  58. </div>
  59. <h2 class="subsection-title">Methods</h2>
  60. <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>
  61. <div class="method">
  62. <div class="description">
  63. <p>Returns the input type of the node which is by default the node type. Derived modules
  64. might overwrite this method and use a fixed type or compute one analytically.</p>
  65. <p>A typical example for different input and node types are textures. The input type of a
  66. normal RGBA texture is <code>texture</code> whereas its node type is <code>vec4</code>.</p>
  67. </div>
  68. <table class="params">
  69. <tbody>
  70. <tr>
  71. <td class="name"><code>builder</code></td>
  72. <td class="description last"><p>The current node builder.</p></td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. <dl class="details">
  77. <dt class="tag-returns"><strong>Returns:</strong> The input type.</dt>
  78. </dl>
  79. </div>
  80. <h3 class="name name-method" id="setPrecision" translate="no">.<a href="#setPrecision">setPrecision</a><span class="signature">( precision : <span class="param-type">'low' | 'medium' | 'high'</span> )</span><span class="type-signature"> : <a href="InputNode.html">InputNode</a></span> </h3>
  81. <div class="method">
  82. <div class="description">
  83. <p>Sets the precision to the given value. The method can be
  84. overwritten in derived classes if the final precision must be computed
  85. analytically.</p>
  86. </div>
  87. <table class="params">
  88. <tbody>
  89. <tr>
  90. <td class="name"><code>precision</code></td>
  91. <td class="description last"><p>The precision of the input value in the shader.</p></td>
  92. </tr>
  93. </tbody>
  94. </table>
  95. <dl class="details">
  96. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  97. </dl>
  98. </div>
  99. <h2 class="subsection-title">Source</h2>
  100. <p>
  101. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/InputNode.js" target="_blank" rel="noopener" translate="no">src/nodes/core/InputNode.js</a>
  102. </p>
  103. </article>
  104. </section>
  105. <script src="../scripts/linenumber.js"></script>
  106. <script src="../scripts/page.js"></script>
  107. </body>
  108. </html>
粤ICP备19079148号