FlipNode.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>FlipNode - 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">FlipNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This module is part of the TSL core and usually not used in app level code.
  17. It represents a flip operation during the shader generation process
  18. meaning it flips normalized values with the following formula:</p>
  19. <pre class="prettyprint source"><code>x = 1 - x;
  20. </code></pre>
  21. <p><code>FlipNode</code> is internally used to implement any <code>flipXYZW()</code>, <code>flipRGBA()</code> and
  22. <code>flipSTPQ()</code> method invocations on node objects. For example:</p>
  23. <pre><code class="language-js">uvNode = uvNode.flipY();
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="FlipNode" translate="no">new <a href="#FlipNode">FlipNode</a><span class="signature">( sourceNode : <span class="param-type"><a href="Node.html">Node</a></span>, components : <span class="param-type">string</span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new flip node.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name">
  38. <strong translate="no">sourceNode</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The node which component(s) should be flipped.</p>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="name">
  46. <strong translate="no">components</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The components that should be flipped e.g. <code>'x'</code> or <code>'xy'</code>.</p>
  50. </td>
  51. </tr>
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. <h2 class="subsection-title">Properties</h2>
  57. <div class="member">
  58. <h3 class="name" id="components" translate="no">.<a href="#components">components</a><span class="type-signature"> : string</span> </h3>
  59. <div class="description">
  60. <p>The components that should be flipped e.g. <code>'x'</code> or <code>'xy'</code>.</p>
  61. </div>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="sourceNode" translate="no">.<a href="#sourceNode">sourceNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  65. <div class="description">
  66. <p>The node which component(s) should be flipped.</p>
  67. </div>
  68. </div>
  69. <h2 class="subsection-title">Methods</h2>
  70. <h3 class="name name-method" id="generateNodeType" translate="no">.<a href="#generateNodeType">generateNodeType</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : string</span> </h3>
  71. <div class="method">
  72. <div class="description">
  73. <p>This method is overwritten since the node type is inferred from the source node.</p>
  74. </div>
  75. <table class="params">
  76. <tbody>
  77. <tr>
  78. <td class="name">
  79. <strong translate="no">builder</strong>
  80. </td>
  81. <td class="description last">
  82. <p>The current node builder.</p>
  83. </td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. <dl class="details">
  88. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#generateNodeType">TempNode#generateNodeType</a></dt>
  89. </dl>
  90. <dl class="details">
  91. <dt class="tag-returns"><strong>Returns:</strong> The node type.</dt>
  92. </dl>
  93. </div>
  94. <h2 class="subsection-title">Source</h2>
  95. <p>
  96. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/utils/FlipNode.js" translate="no" target="_blank" rel="noopener">src/nodes/utils/FlipNode.js</a>
  97. </p>
  98. </article>
  99. </section>
  100. <script src="../scripts/linenumber.js"></script>
  101. <script src="../scripts/page.js"></script>
  102. </body>
  103. </html>
粤ICP备19079148号