StructNode.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>StructNode - 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">StructNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>StructNode allows to create custom structures with multiple members.
  17. This can also be used to define structures in attribute and uniform data.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">// Define a custom struct
  20. const BoundingBox = struct( { min: 'vec3', max: 'vec3' } );
  21. // Create a new instance of the struct
  22. const bb = BoundingBox( vec3( 0 ), vec3( 1 ) ); // style 1
  23. const bb = BoundingBox( { min: vec3( 0 ), max: vec3( 1 ) } ); // style 2
  24. // Access the struct members
  25. const min = bb.get( 'min' );
  26. // Assign a new value to a member
  27. min.assign( vec3() );
  28. </code></pre></div>
  29. </header>
  30. <article>
  31. <div class="container-overview">
  32. <h2>Constructor</h2>
  33. <h3 class="name name-method" id="StructNode" translate="no">new <a href="#StructNode">StructNode</a><span class="signature">()</span> </h3>
  34. <div class="method">
  35. </div>
  36. </div>
  37. <h2 class="subsection-title">Source</h2>
  38. <p>
  39. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/StructNode.js" translate="no" target="_blank" rel="noopener">src/nodes/core/StructNode.js</a>
  40. </p>
  41. </article>
  42. </section>
  43. <script src="../scripts/linenumber.js"></script>
  44. <script src="../scripts/page.js"></script>
  45. </body>
  46. </html>
粤ICP备19079148号