CurvePath.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.</p>
  35. <p>Default is <code>false</code>.</p>
  36. </div>
  37. </div>
  38. <div class="member">
  39. <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>
  40. <div class="description">
  41. <p>An array of curves defining the
  42. path.</p>
  43. </div>
  44. </div>
  45. <h2 class="subsection-title">Methods</h2>
  46. <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>
  47. <div class="method">
  48. <div class="description">
  49. <p>Adds a curve to this curve path.</p>
  50. </div>
  51. <table class="params">
  52. <tbody>
  53. <tr>
  54. <td class="name">
  55. <strong>curve</strong>
  56. </td>
  57. <td class="description last">
  58. <p>The curve to add.</p>
  59. </td>
  60. </tr>
  61. </tbody>
  62. </table>
  63. </div>
  64. <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>
  65. <div class="method">
  66. <div class="description">
  67. <p>Adds a line curve to close the path.</p>
  68. </div>
  69. <dl class="details">
  70. <dt class="tag-returns"><strong>Returns:</strong> A reference to this curve path.</dt>
  71. </dl>
  72. </div>
  73. <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>
  74. <div class="method">
  75. <div class="description">
  76. <p>Returns list of cumulative curve lengths of the defined curves.</p>
  77. </div>
  78. <dl class="details">
  79. <dt class="tag-returns"><strong>Returns:</strong> The curve lengths.</dt>
  80. </dl>
  81. </div>
  82. <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>
  83. <div class="method">
  84. <div class="description">
  85. <p>This method returns a vector in 2D or 3D space (depending on the curve definitions)
  86. for the given interpolation factor.</p>
  87. </div>
  88. <table class="params">
  89. <tbody>
  90. <tr>
  91. <td class="name">
  92. <strong>t</strong>
  93. </td>
  94. <td class="description last">
  95. <p>A interpolation factor representing a position on the curve. Must be in the range <code>[0,1]</code>.</p>
  96. </td>
  97. </tr>
  98. <tr>
  99. <td class="name">
  100. <strong>optionalTarget</strong>
  101. </td>
  102. <td class="description last">
  103. <p>The optional target vector the result is written to.</p>
  104. </td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. <dl class="details">
  109. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Curve.html#getPoint">Curve#getPoint</a></dt>
  110. </dl>
  111. <dl class="details">
  112. <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>
  113. </dl>
  114. </div>
  115. <h2 class="subsection-title">Source</h2>
  116. <p>
  117. <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>
  118. </p>
  119. </article>
  120. </section>
  121. <script src="../scripts/linenumber.js"></script>
  122. <script src="../scripts/page.js"></script>
  123. </body>
  124. </html>
粤ICP备19079148号