SplitNode.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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">Node</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"><code>node</code></td>
  36. <td class="description last"><p>The node that should be accessed.</p></td>
  37. </tr>
  38. <tr>
  39. <td class="name"><code>components</code></td>
  40. <td class="description last"><p>The components that should be accessed.<br/>Default is <code>'x'</code>.</p></td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. <h2 class="subsection-title">Properties</h2>
  47. <div class="member">
  48. <h3 class="name" id="components" translate="no">.<a href="#components">components</a><span class="type-signature"> : string</span> </h3>
  49. <div class="description">
  50. <p>The components that should be accessed.</p>
  51. </div>
  52. </div>
  53. <div class="member">
  54. <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>
  55. <div class="description">
  56. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  57. </div>
  58. </div>
  59. <div class="member">
  60. <h3 class="name" id="node" translate="no">.<a href="#node">node</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  61. <div class="description">
  62. <p>The node that should be accessed.</p>
  63. </div>
  64. </div>
  65. <h2 class="subsection-title">Methods</h2>
  66. <h3 class="name name-method" id="getComponentType" translate="no">.<a href="#getComponentType">getComponentType</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : string</span> </h3>
  67. <div class="method">
  68. <div class="description">
  69. <p>Returns the component type of the node's type.</p>
  70. </div>
  71. <table class="params">
  72. <tbody>
  73. <tr>
  74. <td class="name"><code>builder</code></td>
  75. <td class="description last"><p>The current node builder.</p></td>
  76. </tr>
  77. </tbody>
  78. </table>
  79. <dl class="details">
  80. <dt class="tag-returns"><strong>Returns:</strong> The component type.</dt>
  81. </dl>
  82. </div>
  83. <h3 class="name name-method" id="getNodeType" translate="no">.<a href="#getNodeType">getNodeType</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : string</span> </h3>
  84. <div class="method">
  85. <div class="description">
  86. <p>This method is overwritten since the node type is inferred from requested components.</p>
  87. </div>
  88. <table class="params">
  89. <tbody>
  90. <tr>
  91. <td class="name"><code>builder</code></td>
  92. <td class="description last"><p>The current node builder.</p></td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. <dl class="details">
  97. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getNodeType">Node#getNodeType</a></dt>
  98. </dl>
  99. <dl class="details">
  100. <dt class="tag-returns"><strong>Returns:</strong> The node type.</dt>
  101. </dl>
  102. </div>
  103. <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>
  104. <div class="method">
  105. <div class="description">
  106. <p>Returns the scope of the node.</p>
  107. </div>
  108. <dl class="details">
  109. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#getScope">Node#getScope</a></dt>
  110. </dl>
  111. <dl class="details">
  112. <dt class="tag-returns"><strong>Returns:</strong> The scope of the node.</dt>
  113. </dl>
  114. </div>
  115. <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>
  116. <div class="method">
  117. <div class="description">
  118. <p>Returns the vector length which is computed based on the requested components.</p>
  119. </div>
  120. <dl class="details">
  121. <dt class="tag-returns"><strong>Returns:</strong> The vector length.</dt>
  122. </dl>
  123. </div>
  124. <h2 class="subsection-title">Source</h2>
  125. <p>
  126. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/utils/SplitNode.js" target="_blank" rel="noopener" translate="no">src/nodes/utils/SplitNode.js</a>
  127. </p>
  128. </article>
  129. </section>
  130. <script src="../scripts/linenumber.js"></script>
  131. <script src="../scripts/page.js"></script>
  132. </body>
  133. </html>
粤ICP备19079148号