AnimationLoader.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>AnimationLoader - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="Loader.html">Loader</a> → </p>
  13. <h1 translate="no">AnimationLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Class for loading animation clips in the JSON format. The files are internally
  17. loaded via <a href="FileLoader.html">FileLoader</a>.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const loader = new THREE.AnimationLoader();
  20. const animations = await loader.loadAsync( 'animations/animation.js' );
  21. </code></pre></div>
  22. </header>
  23. <article>
  24. <div class="container-overview">
  25. <h2>Constructor</h2>
  26. <h3 class="name name-method" id="AnimationLoader" translate="no">new <a href="#AnimationLoader">AnimationLoader</a><span class="signature">( manager : <span class="param-type">LoadingManager</span> )</span> </h3>
  27. <div class="method">
  28. <div class="description">
  29. <p>Constructs a new animation loader.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name"><code>manager</code></td>
  35. <td class="description last"><p>The loading manager.</p></td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. </div>
  41. <h2 class="subsection-title">Methods</h2>
  42. <h3 class="name name-method" id="load" translate="no">.<a href="#load">load</a><span class="signature">( url : <span class="param-type">string</span>, onLoad : <span class="param-type">function</span>, onProgress : <span class="param-type">onProgressCallback</span>, onError : <span class="param-type">onErrorCallback</span> )</span> </h3>
  43. <div class="method">
  44. <div class="description">
  45. <p>Starts loading from the given URL and pass the loaded animations as an array
  46. holding instances of <a href="AnimationClip.html">AnimationClip</a> to the <code>onLoad()</code> callback.</p>
  47. </div>
  48. <table class="params">
  49. <tbody>
  50. <tr>
  51. <td class="name"><code>url</code></td>
  52. <td class="description last"><p>The path/URL of the file to be loaded. This can also be a data URI.</p></td>
  53. </tr>
  54. <tr>
  55. <td class="name"><code>onLoad</code></td>
  56. <td class="description last"><p>Executed when the loading process has been finished.</p></td>
  57. </tr>
  58. <tr>
  59. <td class="name"><code>onProgress</code></td>
  60. <td class="description last"><p>Executed while the loading is in progress.</p></td>
  61. </tr>
  62. <tr>
  63. <td class="name"><code>onError</code></td>
  64. <td class="description last"><p>Executed when errors occur.</p></td>
  65. </tr>
  66. </tbody>
  67. </table>
  68. <dl class="details">
  69. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  70. </dl>
  71. </div>
  72. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( json : <span class="param-type">Object</span> )</span><span class="type-signature"> : Array.&lt;<a href="AnimationClip.html">AnimationClip</a>></span> </h3>
  73. <div class="method">
  74. <div class="description">
  75. <p>Parses the given JSON object and returns an array of animation clips.</p>
  76. </div>
  77. <table class="params">
  78. <tbody>
  79. <tr>
  80. <td class="name"><code>json</code></td>
  81. <td class="description last"><p>The serialized animation clips.</p></td>
  82. </tr>
  83. </tbody>
  84. </table>
  85. <dl class="details">
  86. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  87. </dl>
  88. <dl class="details">
  89. <dt class="tag-returns"><strong>Returns:</strong> The parsed animation clips.</dt>
  90. </dl>
  91. </div>
  92. <h2 class="subsection-title">Source</h2>
  93. <p>
  94. <a href="https://github.com/mrdoob/three.js/blob/master/src/loaders/AnimationLoader.js" target="_blank" rel="noopener" translate="no">src/loaders/AnimationLoader.js</a>
  95. </p>
  96. </article>
  97. </section>
  98. <script src="../scripts/linenumber.js"></script>
  99. <script src="../scripts/page.js"></script>
  100. </body>
  101. </html>
粤ICP备19079148号