2
0

MorphBlendMesh.html 4.9 KB

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