CurvePath.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CurvePath - 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. <p class="inheritance" translate="no"><a href="Curve.html">Curve</a> → </p>
  13. <h1 translate="no">CurvePath</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A base class extending <a href="Curve.html">Curve</a>. <code>CurvePath</code> is simply an
  17. array of connected curves, but retains the API of a curve.</p></div>
  18. </header>
  19. <article>
  20. <div class="container-overview">
  21. <h2>Constructor</h2>
  22. <h3 class="name name-method" id="CurvePath" translate="no">new <a href="#CurvePath">CurvePath</a><span class="signature">()</span> </h3>
  23. <div class="method">
  24. <div class="description">
  25. <p>Constructs a new curve path.</p>
  26. </div>
  27. </div>
  28. </div>
  29. <h2 class="subsection-title">Properties</h2>
  30. <div class="member">
  31. <h3 class="name" id="autoClose" translate="no">.<a href="#autoClose">autoClose</a><span class="type-signature"> : boolean</span> </h3>
  32. <div class="description">
  33. <p>Whether the path should automatically be closed
  34. by a line curve.<br/>Default is <code>false</code>.</p>
  35. </div>
  36. </div>
  37. <div class="member">
  38. <h3 class="name" id="curves" translate="no">.<a href="#curves">curves</a><span class="type-signature"> : Array.&lt;<a href="Curve.html">Curve</a>></span> </h3>
  39. <div class="description">
  40. <p>An array of curves defining the
  41. path.</p>
  42. </div>
  43. </div>
  44. <h2 class="subsection-title">Methods</h2>
  45. <h3 class="name name-method" id="add" translate="no">.<a href="#add">add</a><span class="signature">( curve : <span class="param-type">Curve</span> )</span> </h3>
  46. <div class="method">
  47. <div class="description">
  48. <p>Adds a curve to this curve path.</p>
  49. </div>
  50. <table class="params">
  51. <tbody>
  52. <tr>
  53. <td class="name"><code>curve</code></td>
  54. <td class="description last"><p>The curve to add.</p></td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. </div>
  59. <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>
  60. <div class="method">
  61. <div class="description">
  62. <p>Adds a line curve to close the path.</p>
  63. </div>
  64. <dl class="details">
  65. <dt class="tag-returns"><strong>Returns:</strong> A reference to this curve path.</dt>
  66. </dl>
  67. </div>
  68. <h3 class="name name-method" id="getCurveLengths" translate="no">.<a href="#getCurveLengths">getCurveLengths</a><span class="signature">()</span><span class="type-signature"> : Array.&lt;number></span> </h3>
  69. <div class="method">
  70. <div class="description">
  71. <p>Returns list of cumulative curve lengths of the defined curves.</p>
  72. </div>
  73. <dl class="details">
  74. <dt class="tag-returns"><strong>Returns:</strong> The curve lengths.</dt>
  75. </dl>
  76. </div>
  77. <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">Vector2 | Vector3</span> )</span><span class="type-signature"> : <a href="Vector2.html">Vector2</a> | <a href="Vector3.html">Vector3</a></span> </h3>
  78. <div class="method">
  79. <div class="description">
  80. <p>This method returns a vector in 2D or 3D space (depending on the curve definitions)
  81. for the given interpolation factor.</p>
  82. </div>
  83. <table class="params">
  84. <tbody>
  85. <tr>
  86. <td class="name"><code>t</code></td>
  87. <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>
  88. </tr>
  89. <tr>
  90. <td class="name"><code>optionalTarget</code></td>
  91. <td class="description last"><p>The optional target vector the result is written to.</p></td>
  92. </tr>
  93. </tbody>
  94. </table>
  95. <dl class="details">
  96. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Curve.html#getPoint">Curve#getPoint</a></dt>
  97. </dl>
  98. <dl class="details">
  99. <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>
  100. </dl>
  101. </div>
  102. <h2 class="subsection-title">Source</h2>
  103. <p>
  104. <a href="https://github.com/mrdoob/three.js/blob/master/src/extras/core/CurvePath.js" target="_blank" rel="noopener" translate="no">src/extras/core/CurvePath.js</a>
  105. </p>
  106. </article>
  107. </section>
  108. <script src="../scripts/linenumber.js"></script>
  109. <script src="../scripts/page.js"></script>
  110. </body>
  111. </html>
粤ICP备19079148号