ConvertNode.html 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ConvertNode - 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">ConvertNode</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 convert operation during the shader generation process
  18. meaning it converts the data type of a node to a target data type.</p></div>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="ConvertNode" translate="no">new <a href="#ConvertNode">ConvertNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, convertTo : <span class="param-type">string</span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new convert node.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name">
  32. <strong>node</strong>
  33. </td>
  34. <td class="description last">
  35. <p>The node which type should be converted.</p>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td class="name">
  40. <strong>convertTo</strong>
  41. </td>
  42. <td class="description last">
  43. <p>The target node type. Multiple types can be defined by separating them with a <code>|</code> sign.</p>
  44. </td>
  45. </tr>
  46. </tbody>
  47. </table>
  48. </div>
  49. </div>
  50. <h2 class="subsection-title">Properties</h2>
  51. <div class="member">
  52. <h3 class="name" id="convertTo" translate="no">.<a href="#convertTo">convertTo</a><span class="type-signature"> : string</span> </h3>
  53. <div class="description">
  54. <p>The target node type. Multiple types can be defined by separating them with a <code>|</code> sign.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="node" translate="no">.<a href="#node">node</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  59. <div class="description">
  60. <p>The node which type should be converted.</p>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Methods</h2>
  64. <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>
  65. <div class="method">
  66. <div class="description">
  67. <p>This method is overwritten since the implementation tries to infer the best
  68. matching type from the <a href="ConvertNode.html#convertTo">ConvertNode#convertTo</a> property.</p>
  69. </div>
  70. <table class="params">
  71. <tbody>
  72. <tr>
  73. <td class="name">
  74. <strong>builder</strong>
  75. </td>
  76. <td class="description last">
  77. <p>The current node builder.</p>
  78. </td>
  79. </tr>
  80. </tbody>
  81. </table>
  82. <dl class="details">
  83. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getNodeType">Node#getNodeType</a></dt>
  84. </dl>
  85. <dl class="details">
  86. <dt class="tag-returns"><strong>Returns:</strong> The node type.</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/ConvertNode.js" translate="no" target="_blank" rel="noopener">src/nodes/utils/ConvertNode.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号