CSMFrustum.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CSMFrustum - 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">CSMFrustum</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>Represents the frustum of a CSM instance.</p></div>
  16. </header>
  17. <article>
  18. <h2 class="subsection-title">Import</h2>
  19. <p><span translate="no">CSMFrustum</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>
  20. <pre><code class="language-js">import { CSMFrustum } from 'three/addons/csm/CSMFrustum.js';</code></pre>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="CSMFrustum" translate="no">new <a href="#CSMFrustum">CSMFrustum</a><span class="signature">( data : <span class="param-type"><a href="CSMFrustum.html#~Data">CSMFrustum~Data</a></span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new CSM frustum.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name">
  32. <strong>data</strong>
  33. </td>
  34. <td class="description last">
  35. <p>The CSM data.</p>
  36. </td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. <h2 class="subsection-title">Properties</h2>
  43. <div class="member">
  44. <h3 class="name" id="vertices" translate="no">.<a href="#vertices">vertices</a><span class="type-signature"> : Object</span> </h3>
  45. <div class="description">
  46. <p>An object representing the vertices of the near and
  47. far plane in view space.</p>
  48. </div>
  49. </div>
  50. <div class="member">
  51. <h3 class="name" id="zNear" translate="no">.<a href="#zNear">zNear</a><span class="type-signature"> : number</span> </h3>
  52. <div class="description">
  53. <p>The zNear value. This value depends on whether the CSM
  54. is used with WebGL or WebGPU. Both API use different
  55. conventions for their projection matrices.</p>
  56. </div>
  57. </div>
  58. <h2 class="subsection-title">Methods</h2>
  59. <h3 class="name name-method" id="setFromProjectionMatrix" translate="no">.<a href="#setFromProjectionMatrix">setFromProjectionMatrix</a><span class="signature">( projectionMatrix : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span>, maxFar : <span class="param-type">number</span> )</span><span class="type-signature"> : Object</span> </h3>
  60. <div class="method">
  61. <div class="description">
  62. <p>Setups this CSM frustum from the given projection matrix and max far value.</p>
  63. </div>
  64. <table class="params">
  65. <tbody>
  66. <tr>
  67. <td class="name">
  68. <strong>projectionMatrix</strong>
  69. </td>
  70. <td class="description last">
  71. <p>The projection matrix, usually of the scene's camera.</p>
  72. </td>
  73. </tr>
  74. <tr>
  75. <td class="name">
  76. <strong>maxFar</strong>
  77. </td>
  78. <td class="description last">
  79. <p>The maximum far value.</p>
  80. </td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. <dl class="details">
  85. <dt class="tag-returns"><strong>Returns:</strong> An object representing the vertices of the near and far plane in view space.</dt>
  86. </dl>
  87. </div>
  88. <h3 class="name name-method" id="split" translate="no">.<a href="#split">split</a><span class="signature">( breaks : <span class="param-type">Array.&lt;number></span>, target : <span class="param-type">Array.&lt;<a href="CSMFrustum.html">CSMFrustum</a>></span> )</span> </h3>
  89. <div class="method">
  90. <div class="description">
  91. <p>Splits the CSM frustum by the given array. The new CSM frustum are pushed into the given
  92. target array.</p>
  93. </div>
  94. <table class="params">
  95. <tbody>
  96. <tr>
  97. <td class="name">
  98. <strong>breaks</strong>
  99. </td>
  100. <td class="description last">
  101. <p>An array of numbers in the range <code>[0,1]</code> the defines how the
  102. CSM frustum should be split up.</p>
  103. </td>
  104. </tr>
  105. <tr>
  106. <td class="name">
  107. <strong>target</strong>
  108. </td>
  109. <td class="description last">
  110. <p>The target array that holds the new CSM frustums.</p>
  111. </td>
  112. </tr>
  113. </tbody>
  114. </table>
  115. </div>
  116. <h3 class="name name-method" id="toSpace" translate="no">.<a href="#toSpace">toSpace</a><span class="signature">( cameraMatrix : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span>, target : <span class="param-type"><a href="CSMFrustum.html">CSMFrustum</a></span> )</span> </h3>
  117. <div class="method">
  118. <div class="description">
  119. <p>Transforms the given target CSM frustum into the different coordinate system defined by the
  120. given camera matrix.</p>
  121. </div>
  122. <table class="params">
  123. <tbody>
  124. <tr>
  125. <td class="name">
  126. <strong>cameraMatrix</strong>
  127. </td>
  128. <td class="description last">
  129. <p>The matrix that defines the new coordinate system.</p>
  130. </td>
  131. </tr>
  132. <tr>
  133. <td class="name">
  134. <strong>target</strong>
  135. </td>
  136. <td class="description last">
  137. <p>The CSM to convert.</p>
  138. </td>
  139. </tr>
  140. </tbody>
  141. </table>
  142. </div>
  143. <h2 class="subsection-title">Type Definitions</h2>
  144. <div class="member">
  145. <h3 class="name" id="~Data" translate="no">.<a href="#~Data">Data</a> </h3>
  146. <div class="description">
  147. <p>Constructor data of <code>CSMFrustum</code>.</p>
  148. </div>
  149. <table class="props">
  150. <tbody>
  151. <tr>
  152. <td class="name">
  153. <strong>webGL</strong>
  154. <br>
  155. <span class="param-type">boolean</span>
  156. </td>
  157. <td class="description last">
  158. <p>Whether this CSM frustum is used with WebGL or WebGPU.</p>
  159. </td>
  160. </tr>
  161. <tr>
  162. <td class="name">
  163. <strong>projectionMatrix</strong>
  164. <br>
  165. <span class="param-type"><a href="Matrix4.html">Matrix4</a></span>
  166. </td>
  167. <td class="description last">
  168. <p>A projection matrix usually of the scene's camera.</p>
  169. </td>
  170. </tr>
  171. <tr>
  172. <td class="name">
  173. <strong>maxFar</strong>
  174. <br>
  175. <span class="param-type">number</span>
  176. </td>
  177. <td class="description last">
  178. <p>The maximum far value.</p>
  179. </td>
  180. </tr>
  181. </tbody>
  182. </table>
  183. </div>
  184. <h2 class="subsection-title">Source</h2>
  185. <p>
  186. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/csm/CSMFrustum.js" translate="no" target="_blank" rel="noopener">examples/jsm/csm/CSMFrustum.js</a>
  187. </p>
  188. </article>
  189. </section>
  190. <script src="../scripts/linenumber.js"></script>
  191. <script src="../scripts/page.js"></script>
  192. </body>
  193. </html>
粤ICP备19079148号