OctreeHelper.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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" rel="noopener">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"><a href="Octree.html">Octree</a></span>, color : <span class="param-type">number | <a href="Color.html">Color</a> | 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">
  37. <strong>octree</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The octree to visualize.</p>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td class="name">
  45. <strong>color</strong>
  46. </td>
  47. <td class="description last">
  48. <p>The helper's color.</p>
  49. <p>Default is <code>0xffff00</code>.</p>
  50. </td>
  51. </tr>
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. <h2 class="subsection-title">Properties</h2>
  57. <div class="member">
  58. <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>
  59. <div class="description">
  60. <p>The helper's color.</p>
  61. </div>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="octree" translate="no">.<a href="#octree">octree</a><span class="type-signature"> : <a href="Octree.html">Octree</a></span> </h3>
  65. <div class="description">
  66. <p>The octree to visualize.</p>
  67. </div>
  68. </div>
  69. <h2 class="subsection-title">Methods</h2>
  70. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  71. <div class="method">
  72. <div class="description">
  73. <p>Frees the GPU-related resources allocated by this instance. Call this
  74. method whenever this instance is no longer used in your app.</p>
  75. </div>
  76. </div>
  77. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  78. <div class="method">
  79. <div class="description">
  80. <p>Updates the helper. This method must be called whenever the Octree's
  81. structure is changed.</p>
  82. </div>
  83. </div>
  84. <h2 class="subsection-title">Source</h2>
  85. <p>
  86. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/helpers/OctreeHelper.js" translate="no" target="_blank" rel="noopener">examples/jsm/helpers/OctreeHelper.js</a>
  87. </p>
  88. </article>
  89. </section>
  90. <script src="../scripts/linenumber.js"></script>
  91. <script src="../scripts/page.js"></script>
  92. </body>
  93. </html>
粤ICP备19079148号