AnimationMixer.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  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. <p class="desc">
  12. The AnimationMixer is a player for animations on a particular object in the scene. When
  13. multiple objects in the scene are animated independently, one AnimationMixer may be used for
  14. each object.<br /><br />
  15. For an overview of the different elements of the three.js animation system see the
  16. "Animation System" article in the "Next Steps" section of the manual.
  17. </p>
  18. <h2>Constructor</h2>
  19. <h3>[name]( [param:Object3D rootObject] )</h3>
  20. <p>
  21. [page:Object3D rootObject] - the object whose animations shall be played by this mixer.<br />
  22. </p>
  23. <h2>Properties</h2>
  24. <h3>[property:Number time]</h3>
  25. <p>
  26. The global mixer time (in seconds; starting with 0 on the mixer's creation).
  27. </p>
  28. <h3>[property:Number timeScale]</h3>
  29. <p>
  30. A scaling factor for the global [page:.time mixer time].<br /><br />
  31. Note: Setting the mixer's timeScale to 0 and later back to 1 is a possibility to pause/unpause
  32. all actions that are controlled by this mixer.
  33. </p>
  34. <h2>Methods</h2>
  35. <h3>[method:AnimationAction clipAction]([param:AnimationClip clip], [param:Object3D optionalRoot])</h3>
  36. <p>
  37. Returns an [page:AnimationAction] for the passed clip, optionally using a root object different
  38. from the mixer's default root. The first parameter can be either an [page:AnimationClip] object
  39. or the name of an AnimationClip.<br /><br />
  40. If an action fitting the clip and root parameters doesn't yet exist, it will be created by
  41. this method. Calling this method several times with the same clip and root parameters always
  42. returns the same clip instance.
  43. </p>
  44. <h3>[method:AnimationAction existingAction]([param:AnimationClip clip], [param:Object3D optionalRoot])</h3>
  45. <p>
  46. Returns an existing [page:AnimationAction] for the passed clip, optionally using a root object
  47. different from the mixer's default root.<br /><br />
  48. The first parameter can be either an [page:AnimationClip] object or the name of an AnimationClip.
  49. </p>
  50. <h3>[method:Object3D getRoot]()</h3>
  51. <p>
  52. Returns this mixer's root object.
  53. </p>
  54. <h3>[method:AnimationMixer stopAllAction]()</h3>
  55. <p>
  56. Deactivates all previously scheduled actions on this mixer.
  57. </p>
  58. <h3>[method:AnimationMixer update]([param:Number deltaTimeInSeconds]) </h3>
  59. <p>
  60. Advances the global mixer time and updates the animation.<br /><br />
  61. This is usually done in the render loop, passing [page:Clock.getDelta clock.getDelta] scaled by the mixer's [page:.timeScale timeScale]).
  62. </p>
  63. <h3>[method:AnimationMixer setTime]([param:Number timeInSeconds]) </h3>
  64. <p>
  65. Sets the global mixer to a specific time and updates the animation accordingly.<br /><br />
  66. This is useful when you need to jump to an exact time in an animation. The input parameter will be scaled by the mixer's [page:.timeScale timeScale].
  67. </p>
  68. <h3>[method:null uncacheClip]([param:AnimationClip clip])</h3>
  69. <p>
  70. Deallocates all memory resources for a clip.
  71. </p>
  72. <h3>[method:null uncacheRoot]([param:Object3D root]) </h3>
  73. <p>
  74. Deallocates all memory resources for a root object.
  75. </p>
  76. <h3>[method:null uncacheAction]([param:AnimationClip clip], [param:Object3D optionalRoot])</h3>
  77. <p>
  78. Deallocates all memory resources for an action.
  79. </p>
  80. <h2>Source</h2>
  81. <p>
  82. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  83. </p>
  84. </body>
  85. </html>