StructTypeNode.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>StructTypeNode - 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">StructTypeNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Represents a struct type node in the node-based system.
  17. This class is used to define and manage the layout and types of struct members.
  18. It extends the base Node class and provides methods to get the length of the struct,
  19. retrieve member types, and generate the struct type for a builder.</p></div>
  20. </header>
  21. <article>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="StructTypeNode" translate="no">new <a href="#StructTypeNode">StructTypeNode</a><span class="signature">( membersLayout : <span class="param-type">Object</span>, name : <span class="param-type">string</span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Creates an instance of StructTypeNode.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong translate="no">membersLayout</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The layout of the members for the struct.</p>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="name">
  41. <strong translate="no">name</strong>
  42. </td>
  43. <td class="description last">
  44. <p>The optional name of the struct.</p>
  45. <p>Default is <code>null</code>.</p>
  46. </td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. </div>
  51. </div>
  52. <h2 class="subsection-title">Properties</h2>
  53. <div class="member">
  54. <h3 class="name" id="isStructTypeNode" translate="no">.<a href="#isStructTypeNode">isStructTypeNode</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.</p>
  57. <p>Default is <code>true</code>.</p>
  58. </div>
  59. </div>
  60. <div class="member">
  61. <h3 class="name" id="membersLayout" translate="no">.<a href="#membersLayout">membersLayout</a><span class="type-signature"> : Array.&lt;{name: string, type: string, atomic: boolean}></span> </h3>
  62. <div class="description">
  63. <p>The layout of the members for the struct</p>
  64. </div>
  65. </div>
  66. <div class="member">
  67. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  68. <div class="description">
  69. <p>The name of the struct.</p>
  70. <p>Default is <code>null</code>.</p>
  71. </div>
  72. <dl class="details">
  73. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#name">Node#name</a></dt>
  74. </dl>
  75. </div>
  76. <h2 class="subsection-title">Methods</h2>
  77. <h3 class="name name-method" id="getLength" translate="no">.<a href="#getLength">getLength</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  78. <div class="method">
  79. <div class="description">
  80. <p>Returns the length of the struct in 4-byte elements (e.g. float or int components).
  81. The length is calculated by summing the lengths of the struct's members, accounting for memory alignment.
  82. To get the size in bytes, multiply the returned value by 4.</p>
  83. </div>
  84. <dl class="details">
  85. <dt class="tag-returns"><strong>Returns:</strong> The length of the struct in 4-byte elements.</dt>
  86. </dl>
  87. </div>
  88. <h2 class="subsection-title">Source</h2>
  89. <p>
  90. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/StructTypeNode.js" translate="no" target="_blank" rel="noopener">src/nodes/core/StructTypeNode.js</a>
  91. </p>
  92. </article>
  93. </section>
  94. <script src="../scripts/linenumber.js"></script>
  95. <script src="../scripts/page.js"></script>
  96. </body>
  97. </html>
粤ICP备19079148号