FlipNode.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. <p><code>FlipNode</code> is internally used to implement any <code>flipXYZW()</code>, <code>flipRGBA()</code> and
  20. <code>flipSTPQ()</code> method invocations on node objects. For example:</p>
  21. <pre><code class="language-js">uvNode = uvNode.flipY();
  22. </code></pre></div>
  23. <h2>Code Example</h2>
  24. <div translate="no"><pre class="prettyprint source"><code>x = 1 - x;
  25. </code></pre></div>
  26. </header>
  27. <article>
  28. <div class="container-overview">
  29. <h2>Constructor</h2>
  30. <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>
  31. <div class="method">
  32. <div class="description">
  33. <p>Constructs a new flip node.</p>
  34. </div>
  35. <table class="params">
  36. <tbody>
  37. <tr>
  38. <td class="name">
  39. <strong>sourceNode</strong>
  40. </td>
  41. <td class="description last">
  42. <p>The node which component(s) should be flipped.</p>
  43. </td>
  44. </tr>
  45. <tr>
  46. <td class="name">
  47. <strong>components</strong>
  48. </td>
  49. <td class="description last">
  50. <p>The components that should be flipped e.g. <code>'x'</code> or <code>'xy'</code>.</p>
  51. </td>
  52. </tr>
  53. </tbody>
  54. </table>
  55. </div>
  56. </div>
  57. <h2 class="subsection-title">Properties</h2>
  58. <div class="member">
  59. <h3 class="name" id="components" translate="no">.<a href="#components">components</a><span class="type-signature"> : string</span> </h3>
  60. <div class="description">
  61. <p>The components that should be flipped e.g. <code>'x'</code> or <code>'xy'</code>.</p>
  62. </div>
  63. </div>
  64. <div class="member">
  65. <h3 class="name" id="sourceNode" translate="no">.<a href="#sourceNode">sourceNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  66. <div class="description">
  67. <p>The node which component(s) should be flipped.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Methods</h2>
  71. <h3 class="name name-method" id="getNodeType" translate="no">.<a href="#getNodeType">getNodeType</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : string</span> </h3>
  72. <div class="method">
  73. <div class="description">
  74. <p>This method is overwritten since the node type is inferred from the source node.</p>
  75. </div>
  76. <table class="params">
  77. <tbody>
  78. <tr>
  79. <td class="name">
  80. <strong>builder</strong>
  81. </td>
  82. <td class="description last">
  83. <p>The current node builder.</p>
  84. </td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. <dl class="details">
  89. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#getNodeType">TempNode#getNodeType</a></dt>
  90. </dl>
  91. <dl class="details">
  92. <dt class="tag-returns"><strong>Returns:</strong> The node type.</dt>
  93. </dl>
  94. </div>
  95. <h2 class="subsection-title">Source</h2>
  96. <p>
  97. <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>
  98. </p>
  99. </article>
  100. </section>
  101. <script src="../scripts/linenumber.js"></script>
  102. <script src="../scripts/page.js"></script>
  103. </body>
  104. </html>
粤ICP备19079148号