Animation.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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>[property:Object3d root]</h3>
  23. <div>
  24. The root object of the animation.
  25. </div>
  26. <h3>[property:Object data]</h3>
  27. <div>
  28. The data containing the animation
  29. </div>
  30. <h3>[property:Array hierarchy]</h3>
  31. <div>
  32. The objects that are influenced by the animation.
  33. </div>
  34. <h3>[property:number currentTime]</h3>
  35. <div>
  36. The time elapsed since the last start/restart of the animation.
  37. </div>
  38. <h3>[property:number timeScale]</h3>
  39. <div>
  40. The timez
  41. </div>
  42. <h3>[property:boolean isPlaying]</h3>
  43. <div>
  44. Indicates whether the animation is playing. This shouldn't be adapted by user code.
  45. </div>
  46. <h3>[property:boolean isPaused]</h3>
  47. <div>
  48. Indicates whether the animation is paused. This shouldn't be adapted by user code.
  49. </div>
  50. <h3>[property:boolean loop]</h3>
  51. <div>
  52. Set to make the animation restart when the animation ends.
  53. </div>
  54. <h3>[property:number interpolationType]</h3>
  55. <div>
  56. The type to indicate how to interpolate between 2 data points.
  57. </div>
  58. <h2>Methods</h2>
  59. <h3>[method:null play]([page:Number startTime])</h3>
  60. <div>
  61. Starts the animation from a moment startTime in the animation.
  62. </div>
  63. <h3>[method:null stop]()</h3>
  64. <div>
  65. Stops the animation.
  66. </div>
  67. <h3>[method:Boolean update]([page:Number deltaTimeMS])</h3>
  68. <div>
  69. deltaTimeMS -- The time of the between the previous frame and this frame in miliseconds.
  70. </div>
  71. <div>
  72. Updates the animation in time. This shouldn't be called by user code. The animationHandler calls this method.
  73. </div>
  74. <h3>[method:array interpolateCatmullRom]([page:Array points], [page:Number scale])</h3>
  75. <div>
  76. points -- The 4 control point to calculate CatMullRom <br />
  77. scale -- The scale between the previous key and the nex key
  78. </div>
  79. <div>
  80. Interpolates the point based on the key. Is used in update.
  81. </div>
  82. <h3>[method:Object getNextKeyWith]([page:String type], [page:Object h], [page:Number key])</h3>
  83. <div>
  84. type -- The animationtype for the key. Can be "pos", "rot" and "scl".<br />
  85. h -- The object of the hierarchy that catins the key <br />
  86. key -- The index of the next possible key.
  87. </div>
  88. <div>
  89. Gets the next key. Is used in Update.
  90. </div>
  91. <h3>[method:Object getPrevKeyWith]([page:String type], [page:Object h], [page:Number key])</h3>
  92. <div>
  93. type -- The animationtype for the key. Can be "pos", "rot" and "scl".<br />
  94. h -- The object of the hierarchy that contains the key. <br />
  95. key -- The index of the prev possible key.
  96. </div>
  97. <div>
  98. Gets the previous key. Is used in Update.
  99. </div>
  100. <h2>Source</h2>
  101. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  102. </body>
  103. </html>