SplitNode.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SplitNode - 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">SplitNode</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. <code>SplitNode</code> represents a property access operation which means it is
  18. used to implement any <code>.xyzw</code>, <code>.rgba</code> and <code>stpq</code> usage on node objects.
  19. For example:</p></div>
  20. <h2>Code Example</h2>
  21. <div translate="no"><pre><code class="language-js">const redValue = color.r;
  22. </code></pre></div>
  23. </header>
  24. <article>
  25. <div class="container-overview">
  26. <h2>Constructor</h2>
  27. <h3 class="name name-method" id="SplitNode" translate="no">new <a href="#SplitNode">SplitNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, components : <span class="param-type">string</span> )</span> </h3>
  28. <div class="method">
  29. <div class="description">
  30. <p>Constructs a new split node.</p>
  31. </div>
  32. <table class="params">
  33. <tbody>
  34. <tr>
  35. <td class="name">
  36. <strong>node</strong>
  37. </td>
  38. <td class="description last">
  39. <p>The node that should be accessed.</p>
  40. </td>
  41. </tr>
  42. <tr>
  43. <td class="name">
  44. <strong>components</strong>
  45. </td>
  46. <td class="description last">
  47. <p>The components that should be accessed.</p>
  48. <p>Default is <code>'x'</code>.</p>
  49. </td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Properties</h2>
  56. <div class="member">
  57. <h3 class="name" id="components" translate="no">.<a href="#components">components</a><span class="type-signature"> : string</span> </h3>
  58. <div class="description">
  59. <p>The components that should be accessed.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="isSplitNode" translate="no">.<a href="#isSplitNode">isSplitNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  64. <div class="description">
  65. <p>This flag can be used for type testing.</p>
  66. <p>Default is <code>true</code>.</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="node" translate="no">.<a href="#node">node</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  71. <div class="description">
  72. <p>The node that should be accessed.</p>
  73. </div>
  74. </div>
  75. <h2 class="subsection-title">Methods</h2>
  76. <h3 class="name name-method" id="getComponentType" translate="no">.<a href="#getComponentType">getComponentType</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : string</span> </h3>
  77. <div class="method">
  78. <div class="description">
  79. <p>Returns the component type of the node's type.</p>
  80. </div>
  81. <table class="params">
  82. <tbody>
  83. <tr>
  84. <td class="name">
  85. <strong>builder</strong>
  86. </td>
  87. <td class="description last">
  88. <p>The current node builder.</p>
  89. </td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. <dl class="details">
  94. <dt class="tag-returns"><strong>Returns:</strong> The component type.</dt>
  95. </dl>
  96. </div>
  97. <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>
  98. <div class="method">
  99. <div class="description">
  100. <p>This method is overwritten since the node type is inferred from requested components.</p>
  101. </div>
  102. <table class="params">
  103. <tbody>
  104. <tr>
  105. <td class="name">
  106. <strong>builder</strong>
  107. </td>
  108. <td class="description last">
  109. <p>The current node builder.</p>
  110. </td>
  111. </tr>
  112. </tbody>
  113. </table>
  114. <dl class="details">
  115. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getNodeType">Node#getNodeType</a></dt>
  116. </dl>
  117. <dl class="details">
  118. <dt class="tag-returns"><strong>Returns:</strong> The node type.</dt>
  119. </dl>
  120. </div>
  121. <h3 class="name name-method" id="getScope" translate="no">.<a href="#getScope">getScope</a><span class="signature">()</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  122. <div class="method">
  123. <div class="description">
  124. <p>Returns the scope of the node.</p>
  125. </div>
  126. <dl class="details">
  127. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getScope">Node#getScope</a></dt>
  128. </dl>
  129. <dl class="details">
  130. <dt class="tag-returns"><strong>Returns:</strong> The scope of the node.</dt>
  131. </dl>
  132. </div>
  133. <h3 class="name name-method" id="getVectorLength" translate="no">.<a href="#getVectorLength">getVectorLength</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  134. <div class="method">
  135. <div class="description">
  136. <p>Returns the vector length which is computed based on the requested components.</p>
  137. </div>
  138. <dl class="details">
  139. <dt class="tag-returns"><strong>Returns:</strong> The vector length.</dt>
  140. </dl>
  141. </div>
  142. <h2 class="subsection-title">Source</h2>
  143. <p>
  144. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/utils/SplitNode.js" translate="no" target="_blank" rel="noopener">src/nodes/utils/SplitNode.js</a>
  145. </p>
  146. </article>
  147. </section>
  148. <script src="../scripts/linenumber.js"></script>
  149. <script src="../scripts/page.js"></script>
  150. </body>
  151. </html>
粤ICP备19079148号