| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>StructNode - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → </p>
- <h1 translate="no">StructNode</h1>
- <section>
- <header>
- <div class="class-description"><p>StructNode allows to create custom structures with multiple members.
- This can also be used to define structures in attribute and uniform data.</p></div>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">// Define a custom struct
- const BoundingBox = struct( { min: 'vec3', max: 'vec3' } );
- // Create a new instance of the struct
- const bb = BoundingBox( vec3( 0 ), vec3( 1 ) ); // style 1
- const bb = BoundingBox( { min: vec3( 0 ), max: vec3( 1 ) } ); // style 2
- // Access the struct members
- const min = bb.get( 'min' );
- // Assign a new value to a member
- min.assign( vec3() );
- </code></pre></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="StructNode" translate="no">new <a href="#StructNode">StructNode</a><span class="signature">()</span> </h3>
- <div class="method">
- </div>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <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>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|