| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>CurvePath - 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>
- <p class="inheritance" translate="no"><a href="Curve.html">Curve</a> → </p>
- <h1 translate="no">CurvePath</h1>
- <section>
- <header>
- <div class="class-description"><p>A base class extending <a href="Curve.html">Curve</a>. <code>CurvePath</code> is simply an
- array of connected curves, but retains the API of a curve.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="CurvePath" translate="no">new <a href="#CurvePath">CurvePath</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new curve path.</p>
- </div>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="autoClose" translate="no">.<a href="#autoClose">autoClose</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Whether the path should automatically be closed
- by a line curve.</p>
- <p>Default is <code>false</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="curves" translate="no">.<a href="#curves">curves</a><span class="type-signature"> : Array.<<a href="Curve.html">Curve</a>></span> </h3>
- <div class="description">
- <p>An array of curves defining the
- path.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="add" translate="no">.<a href="#add">add</a><span class="signature">( curve : <span class="param-type"><a href="Curve.html">Curve</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds a curve to this curve path.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>curve</strong>
- </td>
- <td class="description last">
- <p>The curve to add.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="closePath" translate="no">.<a href="#closePath">closePath</a><span class="signature">()</span><span class="type-signature"> : <a href="CurvePath.html">CurvePath</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Adds a line curve to close the path.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this curve path.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getCurveLengths" translate="no">.<a href="#getCurveLengths">getCurveLengths</a><span class="signature">()</span><span class="type-signature"> : Array.<number></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns list of cumulative curve lengths of the defined curves.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The curve lengths.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getPoint" translate="no">.<a href="#getPoint">getPoint</a><span class="signature">( t : <span class="param-type">number</span>, optionalTarget : <span class="param-type"><a href="Vector2.html">Vector2</a> | <a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Vector2.html">Vector2</a> | <a href="Vector3.html">Vector3</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>This method returns a vector in 2D or 3D space (depending on the curve definitions)
- for the given interpolation factor.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>t</strong>
- </td>
- <td class="description last">
- <p>A interpolation factor representing a position on the curve. Must be in the range <code>[0,1]</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>optionalTarget</strong>
- </td>
- <td class="description last">
- <p>The optional target vector the result is written to.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Curve.html#getPoint">Curve#getPoint</a></dt>
- </dl>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The position on the curve. It can be a 2D or 3D vector depending on the curve definition.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/extras/core/CurvePath.js" translate="no" target="_blank" rel="noopener">src/extras/core/CurvePath.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|