|
|
@@ -21,18 +21,25 @@
|
|
|
...</code></pre></div></div>
|
|
|
<div class="paragraph"><p>To reset a Control, call <code>control.clearChannels();</code></p></div></div></div>
|
|
|
<div class="sect1"><h2 id="animation-control-properties">Animation Control Properties</h2><div class="sectionbody"><div class="paragraph"><p>The following information is available for an AnimControl.</p></div>
|
|
|
-<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AnimControl Property</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>createChannel()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Returns a new channel, controlling all bones by default.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getNumChannels()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The number of channels registered to this Control.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getChannel(0)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Gets individual channels by index number. At most <code>getNumChannels()</code>.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>clearChannels()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Clear all channels in this control.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addListener(animEventListener) +removeListener(animEventListener) +clearListeners()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Adds or removes listeners to receive animation related events.</p></div></div></td></tr></tbody></table>
|
|
|
-<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AnimControl Property</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setAnimations(aniHashMap)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Sets the animations that this AnimControl is capable of playing. The animations must be compatible with the skeleton given in the constructor.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addAnim(boneAnim) +removeAnim(boneAnim)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Adds or removes an animation from this Control.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getAnimationNames()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>A String Collection of names of all animations that this Control can play for this model.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getAnim(“anim)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Retrieve an animation from the list of animations.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getAnimationLength(“anim)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Returns the length of the given named animation in seconds</p></div></div></td></tr></tbody></table>
|
|
|
+<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AnimControl Property</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>createChannel()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Returns a new channel, controlling all bones by default.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getNumChannels()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The number of channels registered to this Control.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getChannel(0)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Gets individual channels by index number. At most <code>getNumChannels()</code>.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>clearChannels()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Clear all channels in this control.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addListener(animEventListener)<br>
|
|
|
+removeListener(animEventListener)<br>
|
|
|
+clearListeners()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Adds or removes listeners to receive animation related events.</p></div></div></td></tr></tbody></table>
|
|
|
+<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AnimControl Property</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setAnimations(aniHashMap)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Sets the animations that this AnimControl is capable of playing. The animations must be compatible with the skeleton given in the constructor.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addAnim(boneAnim)<br>
|
|
|
+removeAnim(boneAnim)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Adds or removes an animation from this Control.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getAnimationNames()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>A String Collection of names of all animations that this Control can play for this model.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getAnim(“anim)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Retrieve an animation from the list of animations.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getAnimationLength(“anim)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Returns the length of the given named animation in seconds</p></div></div></td></tr></tbody></table>
|
|
|
<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AnimControl Property</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getSkeleton()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The Skeleton object controlled by this Control.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getTargets()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The Skin objects controlled by this Control, as Mesh array.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getAttachmentsNode(“bone)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Returns the attachment node of a bone. Attach models and effects to this node to make them follow this bone’s motions.</p></div></div></td></tr></tbody></table></div></div>
|
|
|
<div class="sect1"><h2 id="animation-channel-properties">Animation Channel Properties</h2><div class="sectionbody"><div class="paragraph"><p>The following properties are set per AnimChannel.</p></div>
|
|
|
<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AnimChannel Property</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setLoopMode(LoopMode.Loop);</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>From now on, the animation on this channel will repeat from the beginning when it ends.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setLoopMode(LoopMode.DontLoop);</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>From now on, the animation on this channel will play once, and the freeze at the last keyframe.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setLoopMode(LoopMode.Cycle);</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>From now on, the animation on this channel will play forward, then backward, then again forward, and so on.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setSpeed(1f);</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>From now on, play this animation slower (<1f) or faster (>1f), or with default speed (1f).</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setTime(1.3f);</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Fast-forward or rewind to a certain moment in time of this animation.</p></div></div></td></tr></tbody></table>
|
|
|
<div class="paragraph"><p>The following information is available for a channel.</p></div>
|
|
|
<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AnimChannel Property</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getAnimationName()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The name of the animation playing on this channel. Returns <code>null</code> when no animation is playing.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getLoopMode()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The current loop mode on this channel. The returned com.jme3.animation enum can be LoopMode.Loop, LoopMode.DontLoop, or LoopMode.Cycle.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getAnimMaxTime()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The total length of the animation on this channel. Or <code>0f</code> if nothing is playing.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getTime()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>How long the animation on this channel has been playing. It returns <code>0f</code> if the channel has not started playing yet, or a value up to getAnimMaxTime().</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getControl()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The AnimControl that belongs to this AnimChannel.</p></div></div></td></tr></tbody></table>
|
|
|
<div class="paragraph"><p>Use the following methods to add or remove individual bones to an AnimChannel. This is useful when you play two animations in parallel on two channels, and each controls a subset of the bones (e.g. one the arms, and the other the legs).</p></div>
|
|
|
-<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AnimChannel Methods</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addAllBones()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Add all the bones of the model’s skeleton to be influenced by this animation channel. (default)</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addBone(“bone1) +addBone(bone1)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Add a single bone to be influenced by this animation channel.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addToRootBone(“bone1) +addToRootBone(bone1)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Add a series of bones to be influenced by this animation channel: Add all bones, starting from the given bone, to the root bone.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addFromRootBone(“bone1) +addFromRootBone(bone1)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Add a series of bones to be influenced by this animation channel: Add all bones, starting from the given root bone, going towards the children bones.</p></div></div></td></tr></tbody></table></div></div>
|
|
|
+<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AnimChannel Methods</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addAllBones()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Add all the bones of the model’s skeleton to be influenced by this animation channel. (default)</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addBone(“bone1)<br>
|
|
|
+addBone(bone1)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Add a single bone to be influenced by this animation channel.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addToRootBone(“bone1)<br>
|
|
|
+addToRootBone(bone1)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Add a series of bones to be influenced by this animation channel: Add all bones, starting from the given bone, to the root bone.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>addFromRootBone(“bone1)<br>
|
|
|
+addFromRootBone(bone1)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Add a series of bones to be influenced by this animation channel: Add all bones, starting from the given root bone, going towards the children bones.</p></div></div></td></tr></tbody></table></div></div>
|
|
|
<div class="sect2"><h3 id="playing-animations">Playing Animations</h3><div class="paragraph"><p>Animations are played by channel. <strong>Note:</strong> Whether the animation channel plays continuously or only once, depends on the Loop properties you have set.</p></div>
|
|
|
-<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">Channel Method</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>channel_walk.setAnim(“Walk,0.50f);</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Start the animation named “Walk on channel channel_walk. +The float value specifies the time how long the animation should overlap with the previous one on this channel. If set to 0f, then no blending will occur and the new animation will be applied instantly.</p></div></div></td></tr></tbody></table>
|
|
|
-<div class="paragraph"><p><strong>Tip:</strong> Use the AnimEventLister below to react at the end or start of an animation cycle.</p></div>
|
|
|
+<table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">Channel Method</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>channel_walk.setAnim(“Walk,0.50f);</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Start the animation named “Walk on channel channel_walk.<br>
|
|
|
+The float value specifies the time how long the animation should overlap with the previous one on this channel. If set to 0f, then no blending will occur and the new animation will be applied instantly.</p></div></div></td></tr></tbody></table>
|
|
|
+<div class="admonitionblock tip"><table><tr><td class="icon"><i class="fa icon-tip" title="Tip"></i></td><td class="content"><div class="paragraph"><p>Use the AnimEventLister below to react at the end or start of an animation cycle.</p></div></td></tr></table></div>
|
|
|
<div class="sect2"><h3 id="usage-example">Usage Example</h3><div class="paragraph"><p>In this short example, we define the space key to trigger playing the “Walk animation on channel2.</p></div>
|
|
|
<div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java"> <span class="directive">public</span> <span class="type">void</span> simpleInitApp() {
|
|
|
...
|
|
|
@@ -74,7 +81,7 @@
|
|
|
<span class="comment">// respond to the event here, e.g. ...</span>
|
|
|
channel.setAnim(<span class="string"><span class="delimiter">"</span><span class="content">Reset</span><span class="delimiter">"</span></span>, <span class="float">0.50f</span>);
|
|
|
}
|
|
|
- }</code></pre></div></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2017-01-27 16:57:22 UTC</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
|
|
|
+ }</code></pre></div></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2017-01-28 01:05:06 UTC</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
|
|
|
apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
|
|
|
indexName: 'jmonkeyengine',
|
|
|
inputSelector: '#doc-search',
|