MorphAnimMesh.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MorphAnimMesh - 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">MorphAnimMesh</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A special type of an animated mesh with a simple interface
  17. for animation playback. It allows to playback just one animation
  18. without any transitions or fading between animation changes.</p></div>
  19. </header>
  20. <article>
  21. <h2 class="subsection-title">Import</h2>
  22. <p><span translate="no">MorphAnimMesh</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>
  23. <pre><code class="language-js">import { MorphAnimMesh } from 'three/addons/misc/MorphAnimMesh.js';</code></pre>
  24. <div class="container-overview">
  25. <h2>Constructor</h2>
  26. <h3 class="name name-method" id="MorphAnimMesh" translate="no">new <a href="#MorphAnimMesh">MorphAnimMesh</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>
  27. <div class="method">
  28. <div class="description">
  29. <p>Constructs a new morph anim mesh.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name">
  35. <strong>geometry</strong>
  36. </td>
  37. <td class="description last">
  38. <p>The mesh geometry.</p>
  39. </td>
  40. </tr>
  41. <tr>
  42. <td class="name">
  43. <strong>material</strong>
  44. </td>
  45. <td class="description last">
  46. <p>The mesh material.</p>
  47. </td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. </div>
  52. </div>
  53. <h2 class="subsection-title">Properties</h2>
  54. <div class="member">
  55. <h3 class="name" id="activeAction" translate="no">.<a href="#activeAction">activeAction</a><span class="type-signature"> : <a href="AnimationAction.html">AnimationAction</a></span> </h3>
  56. <div class="description">
  57. <p>The current active animation action.</p>
  58. <p>Default is <code>null</code>.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="mixer" translate="no">.<a href="#mixer">mixer</a><span class="type-signature"> : <a href="AnimationMixer.html">AnimationMixer</a></span> </h3>
  63. <div class="description">
  64. <p>The internal animation mixer.</p>
  65. </div>
  66. </div>
  67. <h2 class="subsection-title">Methods</h2>
  68. <h3 class="name name-method" id="playAnimation" translate="no">.<a href="#playAnimation">playAnimation</a><span class="signature">( label : <span class="param-type">string</span>, fps : <span class="param-type">number</span> )</span> </h3>
  69. <div class="method">
  70. <div class="description">
  71. <p>Plays the defined animation clip. The implementation assumes the animation
  72. clips are stored in <a href="Object3D.html#animations">Object3D#animations</a> or the geometry.</p>
  73. </div>
  74. <table class="params">
  75. <tbody>
  76. <tr>
  77. <td class="name">
  78. <strong>label</strong>
  79. </td>
  80. <td class="description last">
  81. <p>The name of the animation clip.</p>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td class="name">
  86. <strong>fps</strong>
  87. </td>
  88. <td class="description last">
  89. <p>The FPS of the animation clip.</p>
  90. </td>
  91. </tr>
  92. </tbody>
  93. </table>
  94. </div>
  95. <h3 class="name name-method" id="setDirectionBackward" translate="no">.<a href="#setDirectionBackward">setDirectionBackward</a><span class="signature">()</span> </h3>
  96. <div class="method">
  97. <div class="description">
  98. <p>Sets the animation playback direction to &quot;backward&quot;.</p>
  99. </div>
  100. </div>
  101. <h3 class="name name-method" id="setDirectionForward" translate="no">.<a href="#setDirectionForward">setDirectionForward</a><span class="signature">()</span> </h3>
  102. <div class="method">
  103. <div class="description">
  104. <p>Sets the animation playback direction to &quot;forward&quot;.</p>
  105. </div>
  106. </div>
  107. <h3 class="name name-method" id="updateAnimation" translate="no">.<a href="#updateAnimation">updateAnimation</a><span class="signature">( delta : <span class="param-type">number</span> )</span> </h3>
  108. <div class="method">
  109. <div class="description">
  110. <p>Updates the animations of the mesh. Must be called inside the animation loop.</p>
  111. </div>
  112. <table class="params">
  113. <tbody>
  114. <tr>
  115. <td class="name">
  116. <strong>delta</strong>
  117. </td>
  118. <td class="description last">
  119. <p>The delta time in seconds.</p>
  120. </td>
  121. </tr>
  122. </tbody>
  123. </table>
  124. </div>
  125. <h2 class="subsection-title">Source</h2>
  126. <p>
  127. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/misc/MorphAnimMesh.js" translate="no" target="_blank" rel="noopener">examples/jsm/misc/MorphAnimMesh.js</a>
  128. </p>
  129. </article>
  130. </section>
  131. <script src="../scripts/linenumber.js"></script>
  132. <script src="../scripts/page.js"></script>
  133. </body>
  134. </html>
粤ICP备19079148号