SampleNode.html 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SampleNode - 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">SampleNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Class representing a node that samples a value using a provided callback function.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="SampleNode" translate="no">new <a href="#SampleNode">SampleNode</a><span class="signature">( callback : <span class="param-type">function</span>, uvNode : <span class="param-type">Node.&lt;vec2></span> )</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Creates an instance of SampleNode.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name"><code>callback</code></td>
  30. <td class="description last"><p>The function to be called when sampling. Should accept a UV node and return a value.</p></td>
  31. </tr>
  32. <tr>
  33. <td class="name"><code>uvNode</code></td>
  34. <td class="description last"><p>The UV node to be used in the texture sampling.<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="isSampleNode" translate="no">.<a href="#isSampleNode">isSampleNode</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="uvNode" translate="no">.<a href="#uvNode">uvNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;(vec2|vec3)></span> </h3>
  49. <div class="description">
  50. <p>Represents the texture coordinates.<br/>Default is <code>null</code>.</p>
  51. </div>
  52. </div>
  53. <div class="member">
  54. <h3 class="name" id=".type" translate="no">.<a href="#.type">type</a><span class="type-signature"> : string</span> <span class="type-signature">(readonly) </span></h3>
  55. <div class="description">
  56. <p>Returns the type of the node.</p>
  57. </div>
  58. </div>
  59. <h2 class="subsection-title">Methods</h2>
  60. <h3 class="name name-method" id="sample" translate="no">.<a href="#sample">sample</a><span class="signature">( uv : <span class="param-type">Node.&lt;vec2></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  61. <div class="method">
  62. <div class="description">
  63. <p>Calls the callback function with the provided UV node.</p>
  64. </div>
  65. <table class="params">
  66. <tbody>
  67. <tr>
  68. <td class="name"><code>uv</code></td>
  69. <td class="description last"><p>The UV node or value to be passed to the callback.</p></td>
  70. </tr>
  71. </tbody>
  72. </table>
  73. <dl class="details">
  74. <dt class="tag-returns"><strong>Returns:</strong> The result of the callback function.</dt>
  75. </dl>
  76. </div>
  77. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">()</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  78. <div class="method">
  79. <div class="description">
  80. <p>Sets up the node by sampling with the default UV accessor.</p>
  81. </div>
  82. <dl class="details">
  83. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#setup">Node#setup</a></dt>
  84. </dl>
  85. <dl class="details">
  86. <dt class="tag-returns"><strong>Returns:</strong> The result of the callback function when called with the UV node.</dt>
  87. </dl>
  88. </div>
  89. <h2 class="subsection-title">Source</h2>
  90. <p>
  91. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/utils/SampleNode.js" target="_blank" rel="noopener" translate="no">src/nodes/utils/SampleNode.js</a>
  92. </p>
  93. </article>
  94. </section>
  95. <script src="../scripts/linenumber.js"></script>
  96. <script src="../scripts/page.js"></script>
  97. </body>
  98. </html>
粤ICP备19079148号