Animation.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../../list.js"></script>
  6. <script src="../../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../../page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <div class="desc">This class animates an object based on an hierarchy.This hierarchy can be Object3Ds or bones.</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]([page:Object3d root], [page:String name])</h3>
  14. <div>
  15. root -- The mesh to animate. <br />
  16. name -- The name of the animation
  17. </div>
  18. <div>
  19. Creates an animation for root. The animation data is gathered from AnimationHandler based on its name.
  20. </div>
  21. <h2>Properties</h2>
  22. <h3>.[page:Object3d root]</h3>
  23. <div>
  24. The root object of the animation.
  25. </div>
  26. <h3>.[page:Object data]</h3>
  27. <div>
  28. The data containing the animation
  29. </div>
  30. <h3>.[page:Array hierarchy]</h3>
  31. <div>
  32. The objects that are influenced by the animation.
  33. </div>
  34. <h3>.[page:number currentTime]</h3>
  35. <div>
  36. The time elapsed since the last start/restart of the animation.
  37. </div>
  38. <h3>.[page:number timeScale]</h3>
  39. <div>
  40. The timez
  41. </div>
  42. <h3>.[page:boolean isPlaying]</h3>
  43. <div>
  44. Indicates whether the animation is playing. This shouldn't be adapted by user code.
  45. </div>
  46. <h3>.[page:boolean isPaused]</h3>
  47. <div>
  48. Indicates whether the animation is paused. This shouldn't be adapted by user code.
  49. </div>
  50. <h3>.[page:boolean loop]</h3>
  51. <div>
  52. Set to make the animation restart when the animation ends.
  53. </div>
  54. <h3>.[page:number interpolationType]</h3>
  55. <div>
  56. The type to indicate how to interpolate between 2 data points.
  57. </div>
  58. <h3>.[page:array points]</h3>
  59. <div>
  60. This should be removed from the code.(TODO).
  61. </div>
  62. <h3>.[page:Vector3 target]</h3>
  63. <div>
  64. This should be removed from the code.(TODO).
  65. </div>
  66. <h2>Methods</h2>
  67. <h3>.play([page:Number startTime])</h3>
  68. <div>
  69. Starts the animation from a moment startTime in the animation.
  70. </div>
  71. <h3>.pause() </h3>
  72. <div>
  73. Pauses the animation or restarts the animation after pausing it.
  74. </div>
  75. <h3>.stop()</h3>
  76. <div>
  77. Stops the animation.
  78. </div>
  79. <h3>.update([page:Number deltaTimeMS]) [page:todo]</h3>
  80. <div>
  81. deltaTimeMS -- The time of the between the previous frame and this frame in miliseconds.
  82. </div>
  83. <div>
  84. Updates the animation in time. This shouldn't be called by user code. The animationHandler calls this method.
  85. </div>
  86. <h3>.interpolateCatmullRom([page:Array points], [page:Number scale]) [page:array]</h3>
  87. <div>
  88. points -- The 4 control point to calculate CatMullRom <br />
  89. scale -- The scale between the previous key and the nex key
  90. </div>
  91. <div>
  92. Interpolates the point based on the key. Is used in update.
  93. </div>
  94. <h3>.getNextKeyWith([page:String type], [page:Object h], [page:Number key]) [page:Object]</h3>
  95. <div>
  96. type -- The animationtype for the key. Can be "pos", "rot" and "scl".<br />
  97. h -- The object of the hierarchy that catins the key <br />
  98. key -- The index of the next possible key.
  99. </div>
  100. <div>
  101. Gets the next key. Is used in Update.
  102. </div>
  103. <h3>.getPrevKeyWith([page:String type], [page:Object h], [page:Number key]) [page:Object]</h3>
  104. <div>
  105. type -- The animationtype for the key. Can be "pos", "rot" and "scl".<br />
  106. h -- The object of the hierarchy that contains the key. <br />
  107. key -- The index of the prev possible key.
  108. </div>
  109. <div>
  110. Gets the previous key. Is used in Update.
  111. </div>
  112. <h2>Source</h2>
  113. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  114. </body>
  115. </html>