MorphAnimMesh.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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">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">BufferGeometry</span>, material : <span class="param-type">Material | Array.&lt;Material></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"><code>geometry</code></td>
  35. <td class="description last"><p>The mesh geometry.</p></td>
  36. </tr>
  37. <tr>
  38. <td class="name"><code>material</code></td>
  39. <td class="description last"><p>The mesh material.</p></td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <h2 class="subsection-title">Properties</h2>
  46. <div class="member">
  47. <h3 class="name" id="activeAction" translate="no">.<a href="#activeAction">activeAction</a><span class="type-signature"> : <a href="AnimationAction.html">AnimationAction</a></span> </h3>
  48. <div class="description">
  49. <p>The current active animation action.<br/>Default is <code>null</code>.</p>
  50. </div>
  51. </div>
  52. <div class="member">
  53. <h3 class="name" id="mixer" translate="no">.<a href="#mixer">mixer</a><span class="type-signature"> : <a href="AnimationMixer.html">AnimationMixer</a></span> </h3>
  54. <div class="description">
  55. <p>The internal animation mixer.</p>
  56. </div>
  57. </div>
  58. <h2 class="subsection-title">Methods</h2>
  59. <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>
  60. <div class="method">
  61. <div class="description">
  62. <p>Plays the defined animation clip. The implementation assumes the animation
  63. clips are stored in <a href="Object3D.html#animations">Object3D#animations</a> or the geometry.</p>
  64. </div>
  65. <table class="params">
  66. <tbody>
  67. <tr>
  68. <td class="name"><code>label</code></td>
  69. <td class="description last"><p>The name of the animation clip.</p></td>
  70. </tr>
  71. <tr>
  72. <td class="name"><code>fps</code></td>
  73. <td class="description last"><p>The FPS of the animation clip.</p></td>
  74. </tr>
  75. </tbody>
  76. </table>
  77. </div>
  78. <h3 class="name name-method" id="setDirectionBackward" translate="no">.<a href="#setDirectionBackward">setDirectionBackward</a><span class="signature">()</span> </h3>
  79. <div class="method">
  80. <div class="description">
  81. <p>Sets the animation playback direction to &quot;backward&quot;.</p>
  82. </div>
  83. </div>
  84. <h3 class="name name-method" id="setDirectionForward" translate="no">.<a href="#setDirectionForward">setDirectionForward</a><span class="signature">()</span> </h3>
  85. <div class="method">
  86. <div class="description">
  87. <p>Sets the animation playback direction to &quot;forward&quot;.</p>
  88. </div>
  89. </div>
  90. <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>
  91. <div class="method">
  92. <div class="description">
  93. <p>Updates the animations of the mesh. Must be called inside the animation loop.</p>
  94. </div>
  95. <table class="params">
  96. <tbody>
  97. <tr>
  98. <td class="name"><code>delta</code></td>
  99. <td class="description last"><p>The delta time in seconds.</p></td>
  100. </tr>
  101. </tbody>
  102. </table>
  103. </div>
  104. <h2 class="subsection-title">Source</h2>
  105. <p>
  106. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/misc/MorphAnimMesh.js" target="_blank" rel="noopener" translate="no">examples/jsm/misc/MorphAnimMesh.js</a>
  107. </p>
  108. </article>
  109. </section>
  110. <script src="../scripts/linenumber.js"></script>
  111. <script src="../scripts/page.js"></script>
  112. </body>
  113. </html>
粤ICP备19079148号