MorphBlendMesh.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MorphBlendMesh - 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="EventDispatcher.html">EventDispatcher</a> → <a href="Object3D.html">Object3D</a> → <a href="Mesh.html">Mesh</a> → </p>
  13. <h1 translate="no">MorphBlendMesh</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A special type of an animated mesh with a more advanced interface
  17. for animation playback. Unlike <a href="MorphAnimMesh.html">MorphAnimMesh</a>. It allows to
  18. playback more than one morph animation at the same time but without
  19. fading options.</p></div>
  20. </header>
  21. <article>
  22. <h2 class="subsection-title">Import</h2>
  23. <p><span translate="no">MorphBlendMesh</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  24. <pre><code class="language-js">import { MorphBlendMesh } from 'three/addons/misc/MorphBlendMesh.js';</code></pre>
  25. <div class="container-overview">
  26. <h2>Constructor</h2>
  27. <h3 class="name name-method" id="MorphBlendMesh" translate="no">new <a href="#MorphBlendMesh">MorphBlendMesh</a><span class="signature">( geometry : <span class="param-type"><a href="BufferGeometry.html">BufferGeometry</a></span>, material : <span class="param-type"><a href="Material.html">Material</a> | Array.&lt;<a href="Material.html">Material</a>></span> )</span> </h3>
  28. <div class="method">
  29. <div class="description">
  30. <p>Constructs a new morph blend mesh.</p>
  31. </div>
  32. <table class="params">
  33. <tbody>
  34. <tr>
  35. <td class="name">
  36. <strong>geometry</strong>
  37. </td>
  38. <td class="description last">
  39. <p>The mesh geometry.</p>
  40. </td>
  41. </tr>
  42. <tr>
  43. <td class="name">
  44. <strong>material</strong>
  45. </td>
  46. <td class="description last">
  47. <p>The mesh material.</p>
  48. </td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. <h2 class="subsection-title">Properties</h2>
  55. <div class="member">
  56. <h3 class="name" id="animationsList" translate="no">.<a href="#animationsList">animationsList</a><span class="type-signature"> : Array.&lt;Object></span> </h3>
  57. <div class="description">
  58. <p>A list of animations.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="animationsMap" translate="no">.<a href="#animationsMap">animationsMap</a><span class="type-signature"> : Object.&lt;string, Object></span> </h3>
  63. <div class="description">
  64. <p>A dictionary of animations.</p>
  65. </div>
  66. </div>
  67. <h2 class="subsection-title">Methods</h2>
  68. <h3 class="name name-method" id="autoCreateAnimations" translate="no">.<a href="#autoCreateAnimations">autoCreateAnimations</a><span class="signature">( fps : <span class="param-type">number</span> )</span> </h3>
  69. <div class="method">
  70. <div class="description">
  71. <p>Automatically creates animations based on the values in
  72. <a href="Mesh.html#morphTargetDictionary">Mesh#morphTargetDictionary</a>.</p>
  73. </div>
  74. <table class="params">
  75. <tbody>
  76. <tr>
  77. <td class="name">
  78. <strong>fps</strong>
  79. </td>
  80. <td class="description last">
  81. <p>The FPS of all animations.</p>
  82. </td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. </div>
  87. <h3 class="name name-method" id="createAnimation" translate="no">.<a href="#createAnimation">createAnimation</a><span class="signature">( name : <span class="param-type">string</span>, start : <span class="param-type">number</span>, end : <span class="param-type">number</span>, fps : <span class="param-type">number</span> )</span> </h3>
  88. <div class="method">
  89. <div class="description">
  90. <p>Creates a new animation.</p>
  91. </div>
  92. <table class="params">
  93. <tbody>
  94. <tr>
  95. <td class="name">
  96. <strong>name</strong>
  97. </td>
  98. <td class="description last">
  99. <p>The animation name.</p>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td class="name">
  104. <strong>start</strong>
  105. </td>
  106. <td class="description last">
  107. <p>The start time.</p>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td class="name">
  112. <strong>end</strong>
  113. </td>
  114. <td class="description last">
  115. <p>The end time.</p>
  116. </td>
  117. </tr>
  118. <tr>
  119. <td class="name">
  120. <strong>fps</strong>
  121. </td>
  122. <td class="description last">
  123. <p>The FPS.</p>
  124. </td>
  125. </tr>
  126. </tbody>
  127. </table>
  128. </div>
  129. <h3 class="name name-method" id="getAnimationDuration" translate="no">.<a href="#getAnimationDuration">getAnimationDuration</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : number</span> </h3>
  130. <div class="method">
  131. <div class="description">
  132. <p>Returns the duration for the defined animation.</p>
  133. </div>
  134. <table class="params">
  135. <tbody>
  136. <tr>
  137. <td class="name">
  138. <strong>name</strong>
  139. </td>
  140. <td class="description last">
  141. <p>The animation name.</p>
  142. </td>
  143. </tr>
  144. </tbody>
  145. </table>
  146. <dl class="details">
  147. <dt class="tag-returns"><strong>Returns:</strong> The duration.</dt>
  148. </dl>
  149. </div>
  150. <h3 class="name name-method" id="getAnimationTime" translate="no">.<a href="#getAnimationTime">getAnimationTime</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : number</span> </h3>
  151. <div class="method">
  152. <div class="description">
  153. <p>Returns the time for the defined animation.</p>
  154. </div>
  155. <table class="params">
  156. <tbody>
  157. <tr>
  158. <td class="name">
  159. <strong>name</strong>
  160. </td>
  161. <td class="description last">
  162. <p>The animation name.</p>
  163. </td>
  164. </tr>
  165. </tbody>
  166. </table>
  167. <dl class="details">
  168. <dt class="tag-returns"><strong>Returns:</strong> The time.</dt>
  169. </dl>
  170. </div>
  171. <h3 class="name name-method" id="playAnimation" translate="no">.<a href="#playAnimation">playAnimation</a><span class="signature">( name : <span class="param-type">string</span> )</span> </h3>
  172. <div class="method">
  173. <div class="description">
  174. <p>Plays the defined animation.</p>
  175. </div>
  176. <table class="params">
  177. <tbody>
  178. <tr>
  179. <td class="name">
  180. <strong>name</strong>
  181. </td>
  182. <td class="description last">
  183. <p>The animation name.</p>
  184. </td>
  185. </tr>
  186. </tbody>
  187. </table>
  188. </div>
  189. <h3 class="name name-method" id="setAnimationDirectionBackward" translate="no">.<a href="#setAnimationDirectionBackward">setAnimationDirectionBackward</a><span class="signature">( name : <span class="param-type">string</span> )</span> </h3>
  190. <div class="method">
  191. <div class="description">
  192. <p>Sets the animation playback direction to &quot;backward&quot; for the
  193. defined animation.</p>
  194. </div>
  195. <table class="params">
  196. <tbody>
  197. <tr>
  198. <td class="name">
  199. <strong>name</strong>
  200. </td>
  201. <td class="description last">
  202. <p>The animation name.</p>
  203. </td>
  204. </tr>
  205. </tbody>
  206. </table>
  207. </div>
  208. <h3 class="name name-method" id="setAnimationDirectionForward" translate="no">.<a href="#setAnimationDirectionForward">setAnimationDirectionForward</a><span class="signature">( name : <span class="param-type">string</span> )</span> </h3>
  209. <div class="method">
  210. <div class="description">
  211. <p>Sets the animation playback direction to &quot;forward&quot; for the
  212. defined animation.</p>
  213. </div>
  214. <table class="params">
  215. <tbody>
  216. <tr>
  217. <td class="name">
  218. <strong>name</strong>
  219. </td>
  220. <td class="description last">
  221. <p>The animation name.</p>
  222. </td>
  223. </tr>
  224. </tbody>
  225. </table>
  226. </div>
  227. <h3 class="name name-method" id="setAnimationDuration" translate="no">.<a href="#setAnimationDuration">setAnimationDuration</a><span class="signature">( name : <span class="param-type">string</span>, duration : <span class="param-type">number</span> )</span> </h3>
  228. <div class="method">
  229. <div class="description">
  230. <p>Sets the duration to the given value for the defined animation.</p>
  231. </div>
  232. <table class="params">
  233. <tbody>
  234. <tr>
  235. <td class="name">
  236. <strong>name</strong>
  237. </td>
  238. <td class="description last">
  239. <p>The animation name.</p>
  240. </td>
  241. </tr>
  242. <tr>
  243. <td class="name">
  244. <strong>duration</strong>
  245. </td>
  246. <td class="description last">
  247. <p>The duration to set.</p>
  248. </td>
  249. </tr>
  250. </tbody>
  251. </table>
  252. </div>
  253. <h3 class="name name-method" id="setAnimationFPS" translate="no">.<a href="#setAnimationFPS">setAnimationFPS</a><span class="signature">( name : <span class="param-type">string</span>, fps : <span class="param-type">number</span> )</span> </h3>
  254. <div class="method">
  255. <div class="description">
  256. <p>Sets the FPS to the given value for the defined animation.</p>
  257. </div>
  258. <table class="params">
  259. <tbody>
  260. <tr>
  261. <td class="name">
  262. <strong>name</strong>
  263. </td>
  264. <td class="description last">
  265. <p>The animation name.</p>
  266. </td>
  267. </tr>
  268. <tr>
  269. <td class="name">
  270. <strong>fps</strong>
  271. </td>
  272. <td class="description last">
  273. <p>The FPS to set.</p>
  274. </td>
  275. </tr>
  276. </tbody>
  277. </table>
  278. </div>
  279. <h3 class="name name-method" id="setAnimationTime" translate="no">.<a href="#setAnimationTime">setAnimationTime</a><span class="signature">( name : <span class="param-type">string</span>, time : <span class="param-type">number</span> )</span> </h3>
  280. <div class="method">
  281. <div class="description">
  282. <p>Sets the time to the given value for the defined animation.</p>
  283. </div>
  284. <table class="params">
  285. <tbody>
  286. <tr>
  287. <td class="name">
  288. <strong>name</strong>
  289. </td>
  290. <td class="description last">
  291. <p>The animation name.</p>
  292. </td>
  293. </tr>
  294. <tr>
  295. <td class="name">
  296. <strong>time</strong>
  297. </td>
  298. <td class="description last">
  299. <p>The time to set.</p>
  300. </td>
  301. </tr>
  302. </tbody>
  303. </table>
  304. </div>
  305. <h3 class="name name-method" id="setAnimationWeight" translate="no">.<a href="#setAnimationWeight">setAnimationWeight</a><span class="signature">( name : <span class="param-type">string</span>, weight : <span class="param-type">number</span> )</span> </h3>
  306. <div class="method">
  307. <div class="description">
  308. <p>Sets the weight to the given value for the defined animation.</p>
  309. </div>
  310. <table class="params">
  311. <tbody>
  312. <tr>
  313. <td class="name">
  314. <strong>name</strong>
  315. </td>
  316. <td class="description last">
  317. <p>The animation name.</p>
  318. </td>
  319. </tr>
  320. <tr>
  321. <td class="name">
  322. <strong>weight</strong>
  323. </td>
  324. <td class="description last">
  325. <p>The weight to set.</p>
  326. </td>
  327. </tr>
  328. </tbody>
  329. </table>
  330. </div>
  331. <h3 class="name name-method" id="stopAnimation" translate="no">.<a href="#stopAnimation">stopAnimation</a><span class="signature">( name : <span class="param-type">string</span> )</span> </h3>
  332. <div class="method">
  333. <div class="description">
  334. <p>Stops the defined animation.</p>
  335. </div>
  336. <table class="params">
  337. <tbody>
  338. <tr>
  339. <td class="name">
  340. <strong>name</strong>
  341. </td>
  342. <td class="description last">
  343. <p>The animation name.</p>
  344. </td>
  345. </tr>
  346. </tbody>
  347. </table>
  348. </div>
  349. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( delta : <span class="param-type">number</span> )</span> </h3>
  350. <div class="method">
  351. <div class="description">
  352. <p>Updates the animations of the mesh.</p>
  353. </div>
  354. <table class="params">
  355. <tbody>
  356. <tr>
  357. <td class="name">
  358. <strong>delta</strong>
  359. </td>
  360. <td class="description last">
  361. <p>The delta time in seconds.</p>
  362. </td>
  363. </tr>
  364. </tbody>
  365. </table>
  366. </div>
  367. <h2 class="subsection-title">Source</h2>
  368. <p>
  369. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/misc/MorphBlendMesh.js" translate="no" target="_blank" rel="noopener">examples/jsm/misc/MorphBlendMesh.js</a>
  370. </p>
  371. </article>
  372. </section>
  373. <script src="../scripts/linenumber.js"></script>
  374. <script src="../scripts/page.js"></script>
  375. </body>
  376. </html>
粤ICP备19079148号