MorphBlendMesh.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Mesh] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">A mesh that can blend together multiple animated morph targets.</div>
  14. <h2>Example</h2>
  15. [example:webgl_morphtargets_md2_control morphtargets / md2 / controll]
  16. <h2>Constructor</h2>
  17. <h3>[name]([page:Geometry geometry], [page:Material material])</h3>
  18. <div>
  19. geometry — An instance of [page:Geometry].<br />
  20. material — An instance of [page:Material] (optional).
  21. </div>
  22. <h2>Properties</h2>
  23. <h3>[property:object animationsMap]</h3>
  24. <div>
  25. An object of named animations as added by [page:MorphBlendMesh.createAnimation].
  26. </div>
  27. <h3>[property:array animationsList]</h3>
  28. <div>
  29. The list of animations as added by [page:MorphBlendMesh.createAnimation].
  30. </div>
  31. <h2>Methods</h2>
  32. <h3>[method:null setAnimationWeight]([page:String name], [page:Float weight])</h3>
  33. <div>
  34. name -- The name of the animation<br />
  35. weight -- Weight of the animation, typically 0-1
  36. </div>
  37. <div>
  38. Set the weight of how much this animation will apply to the overall morph. 0 is off, 1 is full weight.
  39. </div>
  40. <h3>[method:null setAnimationFPS]([page:String name], [page:Float fps])</h3>
  41. <div>
  42. name -- The name of the animation <br />
  43. fps -- The number of frames (morphTargets) per second
  44. </div>
  45. <div>
  46. A frame is typically 1 morph target.
  47. </div>
  48. <h3>[method:null createAnimation]([page:String name], [page:Integer start], [page:Integer end], [page:Float fps])</h3>
  49. <div>
  50. name -- The name of the animation <br />
  51. start -- The starting frame (morph)<br />
  52. end -- The ending frame (morph)<br />
  53. fps -- How many frames (morphs) to play per second
  54. </div>
  55. <div>
  56. Creates an animation object that gets added to both the [page:MorphBlendMesh.animationsMap animationsMap] and
  57. [page:MorphBlendMesh.animationsList animationsList].<br/><br/>
  58. Animation object:<br/><br/>
  59. startFrame -- Starting frame<br/>
  60. endFrame -- Ending frame<br/>
  61. length -- The number of frames<br/>
  62. fps -- The frames per second<br/>
  63. duration -- The length of the animation in seconds<br/>
  64. lastFrame -- The previous frame that was played<br/>
  65. currentFrame -- The current frame<br/>
  66. active -- Whether or not the animation is being played<br/>
  67. time -- The time in seconds of the animation<br/>
  68. direction -- Which way to play the animation<br/>
  69. weight -- The weight of the animation<br/>
  70. directionBackwards -- Is playing backwards<br/>
  71. mirroredLoop -- Loop back and forth
  72. </div>
  73. <h3>[method:null playAnimation]([page:String name])</h3>
  74. <div>
  75. name -- The name of the animation
  76. </div>
  77. <div>
  78. Sets the animation to active and animation time to 0
  79. </div>
  80. <h3>[method:null update]([page:Float delta])</h3>
  81. <div>
  82. delta -- Time in seconds
  83. </div>
  84. <div>
  85. Updates and plays the animation
  86. </div>
  87. <h3>[method:null autoCreateAnimations]([page:Float fps])</h3>
  88. <div>
  89. fps -- Frames per second
  90. </div>
  91. <div>
  92. Goes through the geometry's morphTargets and generates animations based on the morphTargets' names. Names
  93. are of the form "walk_01", "walk_02", "walk_03", etc or "run001", "run002", "run003".
  94. </div>
  95. <h3>[method:null setAnimationDuration]([page:String name], [page:Float duration])</h3>
  96. <div>
  97. name -- The name of the animation <br />
  98. duration -- How long in seconds to play the animation
  99. </div>
  100. <div>
  101. Updates the animation object with proper values to update the duration.
  102. </div>
  103. <h3>[method:null setAnimationDirectionForward]([page:String name])</h3>
  104. <div>
  105. name -- The name of the animation
  106. </div>
  107. <div>
  108. Sets the animation to play forwards
  109. </div>
  110. <h3>[method:null setAnimationDirectionBackward]([page:String name])</h3>
  111. <div>
  112. name -- The name of the animation
  113. </div>
  114. <div>
  115. Sets the animation to play backwards
  116. </div>
  117. <h3>[method:Float getAnimationDuration]([page:String name])</h3>
  118. <div>
  119. name -- The name of the animation
  120. </div>
  121. <div>
  122. Returns the duration in seconds of the animation. Returns -1 if it can't be found.
  123. </div>
  124. <h3>[method:Float getAnimationTime]([page:String name])</h3>
  125. <div>
  126. name -- The name of the animation
  127. </div>
  128. <div>
  129. Returns the current time position of the animation.
  130. </div>
  131. <h3>[method:null setAnimationTime]([page:String name], [page:Float time])</h3>
  132. <div>
  133. name -- The name of the animation <br />
  134. time -- The time in seconds
  135. </div>
  136. <div>
  137. Sets the current time position of the animation
  138. </div>
  139. <h3>[method:null stopAnimation]([page:String name])</h3>
  140. <div>
  141. name -- The name of the animation
  142. </div>
  143. <div>
  144. Stops the playback of the animation
  145. </div>
  146. <h2>Source</h2>
  147. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  148. </body>
  149. </html>