| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>AnimationMixer - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <h1 translate="no">AnimationMixer</h1>
- <section>
- <header>
- <div class="class-description"><p><code>AnimationMixer</code> is a player for animations on a particular object in
- the scene. When multiple objects in the scene are animated independently,
- one <code>AnimationMixer</code> may be used for each object.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="AnimationMixer" translate="no">new <a href="#AnimationMixer">AnimationMixer</a><span class="signature">( root : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new animation mixer.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>root</strong>
- </td>
- <td class="description last">
- <p>The object whose animations shall be played by this mixer.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="time" translate="no">.<a href="#time">time</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The global mixer time (in seconds; starting with <code>0</code> on the mixer's creation).</p>
- <p>Default is <code>0</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="timeScale" translate="no">.<a href="#timeScale">timeScale</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>A scaling factor for the global time.</p>
- <p>Note: Setting this member to <code>0</code> and later back to <code>1</code> is a
- possibility to pause/unpause all actions that are controlled by this
- mixer.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="clipAction" translate="no">.<a href="#clipAction">clipAction</a><span class="signature">( clip : <span class="param-type"><a href="AnimationClip.html">AnimationClip</a> | string</span>, optionalRoot : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, blendMode : <span class="param-type"><a href="global.html#NormalAnimationBlendMode">NormalAnimationBlendMode</a> | <a href="global.html#AdditiveAnimationBlendMode">AdditiveAnimationBlendMode</a></span> )</span><span class="type-signature"> : <a href="AnimationAction.html">AnimationAction</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an instance of <a href="AnimationAction.html">AnimationAction</a> for the passed clip.</p>
- <p>If an action fitting the clip and root parameters doesn't yet exist, it
- will be created by this method. Calling this method several times with the
- same clip and root parameters always returns the same action.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>clip</strong>
- </td>
- <td class="description last">
- <p>An animation clip or alternatively the name of the animation clip.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>optionalRoot</strong>
- </td>
- <td class="description last">
- <p>An alternative root object.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>blendMode</strong>
- </td>
- <td class="description last">
- <p>The blend mode.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The animation action.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="existingAction" translate="no">.<a href="#existingAction">existingAction</a><span class="signature">( clip : <span class="param-type"><a href="AnimationClip.html">AnimationClip</a> | string</span>, optionalRoot : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span><span class="type-signature"> : <a href="AnimationAction.html">AnimationAction</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns an existing animation action for the passed clip.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>clip</strong>
- </td>
- <td class="description last">
- <p>An animation clip or alternatively the name of the animation clip.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>optionalRoot</strong>
- </td>
- <td class="description last">
- <p>An alternative root object.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The animation action. Returns <code>null</code> if no action was found.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getRoot" translate="no">.<a href="#getRoot">getRoot</a><span class="signature">()</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns this mixer's root object.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The mixer's root object.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setTime" translate="no">.<a href="#setTime">setTime</a><span class="signature">( time : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="AnimationMixer.html">AnimationMixer</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the global mixer to a specific time and updates the animation accordingly.</p>
- <p>This is useful when you need to jump to an exact time in an animation. The
- input parameter will be scaled by <a href="AnimationMixer.html#timeScale">AnimationMixer#timeScale</a></p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>time</strong>
- </td>
- <td class="description last">
- <p>The time to set in seconds.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this animation mixer.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="stopAllAction" translate="no">.<a href="#stopAllAction">stopAllAction</a><span class="signature">()</span><span class="type-signature"> : <a href="AnimationMixer.html">AnimationMixer</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Deactivates all previously scheduled actions on this mixer.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this animation mixer.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="uncacheAction" translate="no">.<a href="#uncacheAction">uncacheAction</a><span class="signature">( clip : <span class="param-type"><a href="AnimationClip.html">AnimationClip</a> | string</span>, optionalRoot : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Deallocates all memory resources for an action. The action is identified by the
- given clip and an optional root object. Before using this method make
- sure to call <a href="AnimationAction.html#stop">AnimationAction#stop</a> to deactivate the action.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>clip</strong>
- </td>
- <td class="description last">
- <p>An animation clip or alternatively the name of the animation clip.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>optionalRoot</strong>
- </td>
- <td class="description last">
- <p>An alternative root object.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="uncacheClip" translate="no">.<a href="#uncacheClip">uncacheClip</a><span class="signature">( clip : <span class="param-type"><a href="AnimationClip.html">AnimationClip</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Deallocates all memory resources for a clip. Before using this method make
- sure to call <a href="AnimationAction.html#stop">AnimationAction#stop</a> for all related actions.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>clip</strong>
- </td>
- <td class="description last">
- <p>The clip to uncache.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="uncacheRoot" translate="no">.<a href="#uncacheRoot">uncacheRoot</a><span class="signature">( root : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Deallocates all memory resources for a root object. Before using this
- method make sure to call <a href="AnimationAction.html#stop">AnimationAction#stop</a> for all related
- actions or alternatively <a href="AnimationMixer.html#stopAllAction">AnimationMixer#stopAllAction</a> when the
- mixer operates on a single root.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>root</strong>
- </td>
- <td class="description last">
- <p>The root object to uncache.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( deltaTime : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="AnimationMixer.html">AnimationMixer</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Advances the global mixer time and updates the animation.</p>
- <p>This is usually done in the render loop by passing the delta
- time from <a href="Clock.html">Clock</a> or <a href="Timer.html">Timer</a>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>deltaTime</strong>
- </td>
- <td class="description last">
- <p>The delta time in seconds.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this animation mixer.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/animation/AnimationMixer.js" translate="no" target="_blank" rel="noopener">src/animation/AnimationMixer.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|