OctreeHelper.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>OctreeHelper - 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="Object3D.html">Object3D</a> → <a href="Line.html">Line</a> → <a href="LineSegments.html">LineSegments</a> → </p>
  13. <h1 translate="no">OctreeHelper</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A helper for visualizing an Octree.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const helper = new OctreeHelper( octree );
  19. scene.add( helper );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">OctreeHelper</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  25. <pre><code class="language-js">import { OctreeHelper } from 'three/addons/helpers/OctreeHelper.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="OctreeHelper" translate="no">new <a href="#OctreeHelper">OctreeHelper</a><span class="signature">( octree : <span class="param-type">Octree</span>, color : <span class="param-type">number | Color | string</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new Octree helper.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name"><code>octree</code></td>
  37. <td class="description last"><p>The octree to visualize.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>color</code></td>
  41. <td class="description last"><p>The helper's color.<br/>Default is <code>0xffff00</code>.</p></td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. <h2 class="subsection-title">Properties</h2>
  48. <div class="member">
  49. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : number | <a href="Color.html">Color</a> | string</span> </h3>
  50. <div class="description">
  51. <p>The helper's color.</p>
  52. </div>
  53. </div>
  54. <div class="member">
  55. <h3 class="name" id="octree" translate="no">.<a href="#octree">octree</a><span class="type-signature"> : <a href="Octree.html">Octree</a></span> </h3>
  56. <div class="description">
  57. <p>The octree to visualize.</p>
  58. </div>
  59. </div>
  60. <h2 class="subsection-title">Methods</h2>
  61. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  62. <div class="method">
  63. <div class="description">
  64. <p>Frees the GPU-related resources allocated by this instance. Call this
  65. method whenever this instance is no longer used in your app.</p>
  66. </div>
  67. </div>
  68. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  69. <div class="method">
  70. <div class="description">
  71. <p>Updates the helper. This method must be called whenever the Octree's
  72. structure is changed.</p>
  73. </div>
  74. </div>
  75. <h2 class="subsection-title">Source</h2>
  76. <p>
  77. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/helpers/OctreeHelper.js" target="_blank" rel="noopener" translate="no">examples/jsm/helpers/OctreeHelper.js</a>
  78. </p>
  79. </article>
  80. </section>
  81. <script src="../scripts/linenumber.js"></script>
  82. <script src="../scripts/page.js"></script>
  83. </body>
  84. </html>
粤ICP备19079148号