Interpolant.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Interpolant - 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">Interpolant</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>Abstract base class of interpolants over parametric samples.</p>
  16. <p>The parameter domain is one dimensional, typically the time or a path
  17. along a curve defined by the data.</p>
  18. <p>The sample values can have any dimensionality and derived classes may
  19. apply special interpretations to the data.</p>
  20. <p>This class provides the interval seek in a Template Method, deferring
  21. the actual interpolation to derived classes.</p>
  22. <p>Time complexity is O(1) for linear access crossing at most two points
  23. and O(log N) for random access, where N is the number of positions.</p>
  24. <p>References: <a href="http://www.oodesign.com/template-method-pattern.html">http://www.oodesign.com/template-method-pattern.html</a></p></div>
  25. </header>
  26. <article>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="Interpolant" translate="no">new <a href="#Interpolant">Interpolant</a><span class="signature">( parameterPositions : <span class="param-type">TypedArray</span>, sampleValues : <span class="param-type">TypedArray</span>, sampleSize : <span class="param-type">number</span>, resultBuffer : <span class="param-type">TypedArray</span> )</span> <span class="type-signature">(abstract) </span></h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new interpolant.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name"><code>parameterPositions</code></td>
  38. <td class="description last"><p>The parameter positions hold the interpolation factors.</p></td>
  39. </tr>
  40. <tr>
  41. <td class="name"><code>sampleValues</code></td>
  42. <td class="description last"><p>The sample values.</p></td>
  43. </tr>
  44. <tr>
  45. <td class="name"><code>sampleSize</code></td>
  46. <td class="description last"><p>The sample size</p></td>
  47. </tr>
  48. <tr>
  49. <td class="name"><code>resultBuffer</code></td>
  50. <td class="description last"><p>The result buffer.</p></td>
  51. </tr>
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. <h2 class="subsection-title">Properties</h2>
  57. <div class="member">
  58. <h3 class="name" id="DefaultSettings_" translate="no">.<a href="#DefaultSettings_">DefaultSettings_</a><span class="type-signature"> : Object</span> </h3>
  59. <div class="description">
  60. <p>The default settings object.</p>
  61. </div>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="parameterPositions" translate="no">.<a href="#parameterPositions">parameterPositions</a><span class="type-signature"> : TypedArray</span> </h3>
  65. <div class="description">
  66. <p>The parameter positions.</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="resultBuffer" translate="no">.<a href="#resultBuffer">resultBuffer</a><span class="type-signature"> : TypedArray</span> </h3>
  71. <div class="description">
  72. <p>The result buffer.</p>
  73. </div>
  74. </div>
  75. <div class="member">
  76. <h3 class="name" id="sampleValues" translate="no">.<a href="#sampleValues">sampleValues</a><span class="type-signature"> : TypedArray</span> </h3>
  77. <div class="description">
  78. <p>The sample values.</p>
  79. </div>
  80. </div>
  81. <div class="member">
  82. <h3 class="name" id="settings" translate="no">.<a href="#settings">settings</a><span class="type-signature"> : Object</span> </h3>
  83. <div class="description">
  84. <p>The interpolation settings.<br/>Default is <code>null</code>.</p>
  85. </div>
  86. </div>
  87. <div class="member">
  88. <h3 class="name" id="valueSize" translate="no">.<a href="#valueSize">valueSize</a><span class="type-signature"> : TypedArray</span> </h3>
  89. <div class="description">
  90. <p>The value size.</p>
  91. </div>
  92. </div>
  93. <h2 class="subsection-title">Methods</h2>
  94. <h3 class="name name-method" id="copySampleValue_" translate="no">.<a href="#copySampleValue_">copySampleValue_</a><span class="signature">( index : <span class="param-type">number</span> )</span><span class="type-signature"> : TypedArray</span> </h3>
  95. <div class="method">
  96. <div class="description">
  97. <p>Copies a sample value to the result buffer.</p>
  98. </div>
  99. <table class="params">
  100. <tbody>
  101. <tr>
  102. <td class="name"><code>index</code></td>
  103. <td class="description last"><p>An index into the sample value buffer.</p></td>
  104. </tr>
  105. </tbody>
  106. </table>
  107. <dl class="details">
  108. <dt class="tag-returns"><strong>Returns:</strong> The result buffer.</dt>
  109. </dl>
  110. </div>
  111. <h3 class="name name-method" id="evaluate" translate="no">.<a href="#evaluate">evaluate</a><span class="signature">( t : <span class="param-type">number</span> )</span><span class="type-signature"> : TypedArray</span> </h3>
  112. <div class="method">
  113. <div class="description">
  114. <p>Evaluate the interpolant at position <code>t</code>.</p>
  115. </div>
  116. <table class="params">
  117. <tbody>
  118. <tr>
  119. <td class="name"><code>t</code></td>
  120. <td class="description last"><p>The interpolation factor.</p></td>
  121. </tr>
  122. </tbody>
  123. </table>
  124. <dl class="details">
  125. <dt class="tag-returns"><strong>Returns:</strong> The result buffer.</dt>
  126. </dl>
  127. </div>
  128. <h3 class="name name-method" id="getSettings_" translate="no">.<a href="#getSettings_">getSettings_</a><span class="signature">()</span><span class="type-signature"> : Object</span> </h3>
  129. <div class="method">
  130. <div class="description">
  131. <p>Returns the interpolation settings.</p>
  132. </div>
  133. <dl class="details">
  134. <dt class="tag-returns"><strong>Returns:</strong> The interpolation settings.</dt>
  135. </dl>
  136. </div>
  137. <h3 class="name name-method" id="interpolate_" translate="no">.<a href="#interpolate_">interpolate_</a><span class="signature">( i1 : <span class="param-type">number</span>, t0 : <span class="param-type">number</span>, t : <span class="param-type">number</span>, t1 : <span class="param-type">number</span> )</span><span class="type-signature"> : TypedArray</span> <span class="type-signature">(abstract) </span></h3>
  138. <div class="method">
  139. <div class="description">
  140. <p>Copies a sample value to the result buffer.</p>
  141. </div>
  142. <table class="params">
  143. <tbody>
  144. <tr>
  145. <td class="name"><code>i1</code></td>
  146. <td class="description last"><p>An index into the sample value buffer.</p></td>
  147. </tr>
  148. <tr>
  149. <td class="name"><code>t0</code></td>
  150. <td class="description last"><p>The previous interpolation factor.</p></td>
  151. </tr>
  152. <tr>
  153. <td class="name"><code>t</code></td>
  154. <td class="description last"><p>The current interpolation factor.</p></td>
  155. </tr>
  156. <tr>
  157. <td class="name"><code>t1</code></td>
  158. <td class="description last"><p>The next interpolation factor.</p></td>
  159. </tr>
  160. </tbody>
  161. </table>
  162. <dl class="details">
  163. <dt class="tag-returns"><strong>Returns:</strong> The result buffer.</dt>
  164. </dl>
  165. </div>
  166. <h3 class="name name-method" id="intervalChanged_" translate="no">.<a href="#intervalChanged_">intervalChanged_</a><span class="signature">( i1 : <span class="param-type">number</span>, t0 : <span class="param-type">number</span>, t : <span class="param-type">number</span> )</span> </h3>
  167. <div class="method">
  168. <div class="description">
  169. <p>Optional method that is executed when the interval has changed.</p>
  170. </div>
  171. <table class="params">
  172. <tbody>
  173. <tr>
  174. <td class="name"><code>i1</code></td>
  175. <td class="description last"><p>An index into the sample value buffer.</p></td>
  176. </tr>
  177. <tr>
  178. <td class="name"><code>t0</code></td>
  179. <td class="description last"><p>The previous interpolation factor.</p></td>
  180. </tr>
  181. <tr>
  182. <td class="name"><code>t</code></td>
  183. <td class="description last"><p>The current interpolation factor.</p></td>
  184. </tr>
  185. </tbody>
  186. </table>
  187. </div>
  188. <h2 class="subsection-title">Source</h2>
  189. <p>
  190. <a href="https://github.com/mrdoob/three.js/blob/master/src/math/Interpolant.js" target="_blank" rel="noopener" translate="no">src/math/Interpolant.js</a>
  191. </p>
  192. </article>
  193. </section>
  194. <script src="../scripts/linenumber.js"></script>
  195. <script src="../scripts/page.js"></script>
  196. </body>
  197. </html>
粤ICP备19079148号