CSMFrustum.html 6.8 KB

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