| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>CSMFrustum - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <h1 translate="no">CSMFrustum</h1>
- <section>
- <header>
- <div class="class-description"><p>Represents the frustum of a CSM instance.</p></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <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>
- <pre><code class="language-js">import { CSMFrustum } from 'three/addons/csm/CSMFrustum.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <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>
- <div class="method">
- <div class="description">
- <p>Constructs a new CSM frustum.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>data</code></td>
- <td class="description last"><p>The CSM data.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="vertices" translate="no">.<a href="#vertices">vertices</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>An object representing the vertices of the near and
- far plane in view space.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="zNear" translate="no">.<a href="#zNear">zNear</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The zNear value. This value depends on whether the CSM
- is used with WebGL or WebGPU. Both API use different
- conventions for their projection matrices.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <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>
- <div class="method">
- <div class="description">
- <p>Setups this CSM frustum from the given projection matrix and max far value.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>projectionMatrix</code></td>
- <td class="description last"><p>The projection matrix, usually of the scene's camera.</p></td>
- </tr>
- <tr>
- <td class="name"><code>maxFar</code></td>
- <td class="description last"><p>The maximum far value.</p></td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> An object representing the vertices of the near and far plane in view space.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="split" translate="no">.<a href="#split">split</a><span class="signature">( breaks : <span class="param-type">Array.<number></span>, target : <span class="param-type">Array.<CSMFrustum></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Splits the CSM frustum by the given array. The new CSM frustum are pushed into the given
- target array.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>breaks</code></td>
- <td class="description last"><p>An array of numbers in the range <code>[0,1]</code> the defines how the
- CSM frustum should be split up.</p></td>
- </tr>
- <tr>
- <td class="name"><code>target</code></td>
- <td class="description last"><p>The target array that holds the new CSM frustums.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- <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>
- <div class="method">
- <div class="description">
- <p>Transforms the given target CSM frustum into the different coordinate system defined by the
- given camera matrix.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>cameraMatrix</code></td>
- <td class="description last"><p>The matrix that defines the new coordinate system.</p></td>
- </tr>
- <tr>
- <td class="name"><code>target</code></td>
- <td class="description last"><p>The CSM to convert.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- <h2 class="subsection-title">Type Definitions</h2>
- <div class="member">
- <h3 class="name" id="~Data" translate="no">.<a href="#~Data">Data</a> </h3>
- <div class="description">
- <p>Constructor data of <code>CSMFrustum</code>.</p>
- </div>
- <h5 class="subsection-title">Properties:</h5>
- <table class="props">
- <thead>
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Attributes</th>
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="name"><code>webGL</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="description last"><p>Whether this CSM frustum is used with WebGL or WebGPU.</p></td>
- </tr>
- <tr>
- <td class="name"><code>projectionMatrix</code></td>
- <td class="type">
- <span class="param-type"><a href="Matrix4.html">Matrix4</a></span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="description last"><p>A projection matrix usually of the scene's camera.</p></td>
- </tr>
- <tr>
- <td class="name"><code>maxFar</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="description last"><p>The maximum far value.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <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>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|