FrustumArray.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>FrustumArray - 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. <h1 translate="no">FrustumArray</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>FrustumArray is used to determine if an object is visible in at least one camera
  16. from an array of cameras. This is particularly useful for multi-view renderers.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="FrustumArray" translate="no">new <a href="#FrustumArray">FrustumArray</a><span class="signature">()</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new frustum array.</p>
  25. </div>
  26. </div>
  27. </div>
  28. <h2 class="subsection-title">Properties</h2>
  29. <div class="member">
  30. <h3 class="name" id="coordinateSystem" translate="no">.<a href="#coordinateSystem">coordinateSystem</a><span class="type-signature"> : <a href="global.html#WebGLCoordinateSystem">WebGLCoordinateSystem</a> | <a href="global.html#WebGPUCoordinateSystem">WebGPUCoordinateSystem</a></span> </h3>
  31. <div class="description">
  32. <p>The coordinate system to use.</p>
  33. <p>Default is <code>WebGLCoordinateSystem</code>.</p>
  34. </div>
  35. </div>
  36. <h2 class="subsection-title">Methods</h2>
  37. <h3 class="name name-method" id="clone" translate="no">.<a href="#clone">clone</a><span class="signature">()</span><span class="type-signature"> : <a href="FrustumArray.html">FrustumArray</a></span> </h3>
  38. <div class="method">
  39. <div class="description">
  40. <p>Returns a new frustum array with copied values from this instance.</p>
  41. </div>
  42. <dl class="details">
  43. <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
  44. </dl>
  45. </div>
  46. <h3 class="name name-method" id="containsPoint" translate="no">.<a href="#containsPoint">containsPoint</a><span class="signature">( point : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
  47. <div class="method">
  48. <div class="description">
  49. <p>Returns <code>true</code> if the given point lies within any cached frustum.</p>
  50. <p><a href="FrustumArray.html#setFromArrayCamera">FrustumArray#setFromArrayCamera</a> must be called once per render before this method.</p>
  51. </div>
  52. <table class="params">
  53. <tbody>
  54. <tr>
  55. <td class="name">
  56. <strong translate="no">point</strong>
  57. </td>
  58. <td class="description last">
  59. <p>The point to test.</p>
  60. </td>
  61. </tr>
  62. </tbody>
  63. </table>
  64. <dl class="details">
  65. <dt class="tag-returns"><strong>Returns:</strong> Whether the point is visible in any camera.</dt>
  66. </dl>
  67. </div>
  68. <h3 class="name name-method" id="copy" translate="no">.<a href="#copy">copy</a><span class="signature">( frustumArray : <span class="param-type"><a href="FrustumArray.html">FrustumArray</a></span> )</span><span class="type-signature"> : <a href="FrustumArray.html">FrustumArray</a></span> </h3>
  69. <div class="method">
  70. <div class="description">
  71. <p>Copies the values of the given frustum array to this instance.</p>
  72. </div>
  73. <table class="params">
  74. <tbody>
  75. <tr>
  76. <td class="name">
  77. <strong translate="no">frustumArray</strong>
  78. </td>
  79. <td class="description last">
  80. <p>The frustum array to copy.</p>
  81. </td>
  82. </tr>
  83. </tbody>
  84. </table>
  85. <dl class="details">
  86. <dt class="tag-returns"><strong>Returns:</strong> A reference to this frustum array.</dt>
  87. </dl>
  88. </div>
  89. <h3 class="name name-method" id="intersectsBox" translate="no">.<a href="#intersectsBox">intersectsBox</a><span class="signature">( box : <span class="param-type"><a href="Box3.html">Box3</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
  90. <div class="method">
  91. <div class="description">
  92. <p>Returns <code>true</code> if the given bounding box is intersecting any cached frustum.</p>
  93. <p><a href="FrustumArray.html#setFromArrayCamera">FrustumArray#setFromArrayCamera</a> must be called once per render before this method.</p>
  94. </div>
  95. <table class="params">
  96. <tbody>
  97. <tr>
  98. <td class="name">
  99. <strong translate="no">box</strong>
  100. </td>
  101. <td class="description last">
  102. <p>The bounding box to test.</p>
  103. </td>
  104. </tr>
  105. </tbody>
  106. </table>
  107. <dl class="details">
  108. <dt class="tag-returns"><strong>Returns:</strong> Whether the box is visible in any camera.</dt>
  109. </dl>
  110. </div>
  111. <h3 class="name name-method" id="intersectsObject" translate="no">.<a href="#intersectsObject">intersectsObject</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
  112. <div class="method">
  113. <div class="description">
  114. <p>Returns <code>true</code> if the 3D object's bounding sphere is intersecting any cached frustum.</p>
  115. <p><a href="FrustumArray.html#setFromArrayCamera">FrustumArray#setFromArrayCamera</a> must be called once per render before this method.</p>
  116. </div>
  117. <table class="params">
  118. <tbody>
  119. <tr>
  120. <td class="name">
  121. <strong translate="no">object</strong>
  122. </td>
  123. <td class="description last">
  124. <p>The 3D object to test.</p>
  125. </td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. <dl class="details">
  130. <dt class="tag-returns"><strong>Returns:</strong> Whether the 3D object is visible in any camera.</dt>
  131. </dl>
  132. </div>
  133. <h3 class="name name-method" id="intersectsSphere" translate="no">.<a href="#intersectsSphere">intersectsSphere</a><span class="signature">( sphere : <span class="param-type"><a href="Sphere.html">Sphere</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
  134. <div class="method">
  135. <div class="description">
  136. <p>Returns <code>true</code> if the given bounding sphere is intersecting any cached frustum.</p>
  137. <p><a href="FrustumArray.html#setFromArrayCamera">FrustumArray#setFromArrayCamera</a> must be called once per render before this method.</p>
  138. </div>
  139. <table class="params">
  140. <tbody>
  141. <tr>
  142. <td class="name">
  143. <strong translate="no">sphere</strong>
  144. </td>
  145. <td class="description last">
  146. <p>The bounding sphere to test.</p>
  147. </td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. <dl class="details">
  152. <dt class="tag-returns"><strong>Returns:</strong> Whether the sphere is visible in any camera.</dt>
  153. </dl>
  154. </div>
  155. <h3 class="name name-method" id="intersectsSprite" translate="no">.<a href="#intersectsSprite">intersectsSprite</a><span class="signature">( sprite : <span class="param-type"><a href="Sprite.html">Sprite</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
  156. <div class="method">
  157. <div class="description">
  158. <p>Returns <code>true</code> if the given sprite is intersecting any cached frustum.</p>
  159. <p><a href="FrustumArray.html#setFromArrayCamera">FrustumArray#setFromArrayCamera</a> must be called once per render before this method.</p>
  160. </div>
  161. <table class="params">
  162. <tbody>
  163. <tr>
  164. <td class="name">
  165. <strong translate="no">sprite</strong>
  166. </td>
  167. <td class="description last">
  168. <p>The sprite to test.</p>
  169. </td>
  170. </tr>
  171. </tbody>
  172. </table>
  173. <dl class="details">
  174. <dt class="tag-returns"><strong>Returns:</strong> Whether the sprite is visible in any camera.</dt>
  175. </dl>
  176. </div>
  177. <h3 class="name name-method" id="setFromArrayCamera" translate="no">.<a href="#setFromArrayCamera">setFromArrayCamera</a><span class="signature">( cameraArray : <span class="param-type"><a href="ArrayCamera.html">ArrayCamera</a></span> )</span><span class="type-signature"> : <a href="FrustumArray.html">FrustumArray</a></span> </h3>
  178. <div class="method">
  179. <div class="description">
  180. <p>Computes and caches a frustum for each camera of the given array camera.</p>
  181. </div>
  182. <table class="params">
  183. <tbody>
  184. <tr>
  185. <td class="name">
  186. <strong translate="no">cameraArray</strong>
  187. </td>
  188. <td class="description last">
  189. <p>The array camera whose sub-cameras define the frustums.</p>
  190. </td>
  191. </tr>
  192. </tbody>
  193. </table>
  194. <dl class="details">
  195. <dt class="tag-returns"><strong>Returns:</strong> A reference to this frustum array.</dt>
  196. </dl>
  197. </div>
  198. <h2 class="subsection-title">Source</h2>
  199. <p>
  200. <a href="https://github.com/mrdoob/three.js/blob/master/src/math/FrustumArray.js" translate="no" target="_blank" rel="noopener">src/math/FrustumArray.js</a>
  201. </p>
  202. </article>
  203. </section>
  204. <script src="../scripts/linenumber.js"></script>
  205. <script src="../scripts/page.js"></script>
  206. </body>
  207. </html>
粤ICP备19079148号