Interpolant.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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" target="_blank" rel="noopener">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">
  38. <strong>parameterPositions</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The parameter positions hold the interpolation factors.</p>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="name">
  46. <strong>sampleValues</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The sample values.</p>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="name">
  54. <strong>sampleSize</strong>
  55. </td>
  56. <td class="description last">
  57. <p>The sample size</p>
  58. </td>
  59. </tr>
  60. <tr>
  61. <td class="name">
  62. <strong>resultBuffer</strong>
  63. </td>
  64. <td class="description last">
  65. <p>The result buffer.</p>
  66. </td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. </div>
  71. </div>
  72. <h2 class="subsection-title">Properties</h2>
  73. <div class="member">
  74. <h3 class="name" id="DefaultSettings_" translate="no">.<a href="#DefaultSettings_">DefaultSettings_</a><span class="type-signature"> : Object</span> </h3>
  75. <div class="description">
  76. <p>The default settings object.</p>
  77. </div>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="parameterPositions" translate="no">.<a href="#parameterPositions">parameterPositions</a><span class="type-signature"> : TypedArray</span> </h3>
  81. <div class="description">
  82. <p>The parameter positions.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="resultBuffer" translate="no">.<a href="#resultBuffer">resultBuffer</a><span class="type-signature"> : TypedArray</span> </h3>
  87. <div class="description">
  88. <p>The result buffer.</p>
  89. </div>
  90. </div>
  91. <div class="member">
  92. <h3 class="name" id="sampleValues" translate="no">.<a href="#sampleValues">sampleValues</a><span class="type-signature"> : TypedArray</span> </h3>
  93. <div class="description">
  94. <p>The sample values.</p>
  95. </div>
  96. </div>
  97. <div class="member">
  98. <h3 class="name" id="settings" translate="no">.<a href="#settings">settings</a><span class="type-signature"> : Object</span> </h3>
  99. <div class="description">
  100. <p>The interpolation settings.</p>
  101. <p>Default is <code>null</code>.</p>
  102. </div>
  103. </div>
  104. <div class="member">
  105. <h3 class="name" id="valueSize" translate="no">.<a href="#valueSize">valueSize</a><span class="type-signature"> : TypedArray</span> </h3>
  106. <div class="description">
  107. <p>The value size.</p>
  108. </div>
  109. </div>
  110. <h2 class="subsection-title">Methods</h2>
  111. <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>
  112. <div class="method">
  113. <div class="description">
  114. <p>Copies a sample value to the result buffer.</p>
  115. </div>
  116. <table class="params">
  117. <tbody>
  118. <tr>
  119. <td class="name">
  120. <strong>index</strong>
  121. </td>
  122. <td class="description last">
  123. <p>An index into the sample value buffer.</p>
  124. </td>
  125. </tr>
  126. </tbody>
  127. </table>
  128. <dl class="details">
  129. <dt class="tag-returns"><strong>Returns:</strong> The result buffer.</dt>
  130. </dl>
  131. </div>
  132. <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>
  133. <div class="method">
  134. <div class="description">
  135. <p>Evaluate the interpolant at position <code>t</code>.</p>
  136. </div>
  137. <table class="params">
  138. <tbody>
  139. <tr>
  140. <td class="name">
  141. <strong>t</strong>
  142. </td>
  143. <td class="description last">
  144. <p>The interpolation factor.</p>
  145. </td>
  146. </tr>
  147. </tbody>
  148. </table>
  149. <dl class="details">
  150. <dt class="tag-returns"><strong>Returns:</strong> The result buffer.</dt>
  151. </dl>
  152. </div>
  153. <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>
  154. <div class="method">
  155. <div class="description">
  156. <p>Returns the interpolation settings.</p>
  157. </div>
  158. <dl class="details">
  159. <dt class="tag-returns"><strong>Returns:</strong> The interpolation settings.</dt>
  160. </dl>
  161. </div>
  162. <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>
  163. <div class="method">
  164. <div class="description">
  165. <p>Copies a sample value to the result buffer.</p>
  166. </div>
  167. <table class="params">
  168. <tbody>
  169. <tr>
  170. <td class="name">
  171. <strong>i1</strong>
  172. </td>
  173. <td class="description last">
  174. <p>An index into the sample value buffer.</p>
  175. </td>
  176. </tr>
  177. <tr>
  178. <td class="name">
  179. <strong>t0</strong>
  180. </td>
  181. <td class="description last">
  182. <p>The previous interpolation factor.</p>
  183. </td>
  184. </tr>
  185. <tr>
  186. <td class="name">
  187. <strong>t</strong>
  188. </td>
  189. <td class="description last">
  190. <p>The current interpolation factor.</p>
  191. </td>
  192. </tr>
  193. <tr>
  194. <td class="name">
  195. <strong>t1</strong>
  196. </td>
  197. <td class="description last">
  198. <p>The next interpolation factor.</p>
  199. </td>
  200. </tr>
  201. </tbody>
  202. </table>
  203. <dl class="details">
  204. <dt class="tag-returns"><strong>Returns:</strong> The result buffer.</dt>
  205. </dl>
  206. </div>
  207. <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>
  208. <div class="method">
  209. <div class="description">
  210. <p>Optional method that is executed when the interval has changed.</p>
  211. </div>
  212. <table class="params">
  213. <tbody>
  214. <tr>
  215. <td class="name">
  216. <strong>i1</strong>
  217. </td>
  218. <td class="description last">
  219. <p>An index into the sample value buffer.</p>
  220. </td>
  221. </tr>
  222. <tr>
  223. <td class="name">
  224. <strong>t0</strong>
  225. </td>
  226. <td class="description last">
  227. <p>The previous interpolation factor.</p>
  228. </td>
  229. </tr>
  230. <tr>
  231. <td class="name">
  232. <strong>t</strong>
  233. </td>
  234. <td class="description last">
  235. <p>The current interpolation factor.</p>
  236. </td>
  237. </tr>
  238. </tbody>
  239. </table>
  240. </div>
  241. <h2 class="subsection-title">Source</h2>
  242. <p>
  243. <a href="https://github.com/mrdoob/three.js/blob/master/src/math/Interpolant.js" translate="no" target="_blank" rel="noopener">src/math/Interpolant.js</a>
  244. </p>
  245. </article>
  246. </section>
  247. <script src="../scripts/linenumber.js"></script>
  248. <script src="../scripts/page.js"></script>
  249. </body>
  250. </html>
粤ICP备19079148号