diff options
author | ricardolpd <[email protected]> | 2012-12-03 11:07:39 +0000 |
---|---|---|
committer | ricardolpd <[email protected]> | 2012-12-03 11:07:39 +0000 |
commit | 49b723bab080552a013cc3b785eb9ba9eeca2bbd (patch) | |
tree | 0aa7cdbf17d77fdfa61dea18ca7362260823b351 | |
parent | 0ee7564335609c407fc5a564c567a3e3bee561e2 (diff) |
- Adds an AnimationClipInstance parameter to AnimationListener.java to allow to track the ClipInstance Source.
- Made a getMethod in AnimationManager.java to access _clipInstances.
- Updated Examples accordingly.
5 files changed, 18 insertions, 4 deletions
diff --git a/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationListener.java b/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationListener.java index f662371..4259e9a 100644 --- a/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationListener.java +++ b/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationListener.java @@ -10,6 +10,8 @@ package com.ardor3d.extension.animation.skeletal; +import com.ardor3d.extension.animation.skeletal.clip.AnimationClipInstance; + /** * Describes a class interested in receiving notice when an animation has changed state. */ @@ -17,7 +19,10 @@ public interface AnimationListener { /** * Called when an animation reaches the end of its complete play time (maxTime * loops) + * + * @param source + * The animation clip instance that finished. */ - void animationFinished(); + void animationFinished(AnimationClipInstance source); } diff --git a/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationManager.java b/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationManager.java index 30e2e9b..cc523b5 100644 --- a/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationManager.java +++ b/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationManager.java @@ -590,4 +590,11 @@ public class AnimationManager { public LoggingMap<String, Double> getValuesStore() { return _valuesStore; } + + /** + * @return the Map containing the AnimationClips and their respective AnimationClipInstances. + */ + public Map<AnimationClip, AnimationClipInstance> getClipInstancesStore() { + return _clipInstances; + } } diff --git a/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClipInstance.java b/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClipInstance.java index 4d7d542..14f8816 100644 --- a/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClipInstance.java +++ b/trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/clip/AnimationClipInstance.java @@ -141,7 +141,7 @@ public class AnimationClipInstance { } for (final AnimationListener animationListener : animationListeners) { - animationListener.animationFinished(); + animationListener.animationFinished(this); } } } diff --git a/trunk/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/AnimationCopyExample.java b/trunk/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/AnimationCopyExample.java index 8d02f58..6ff67d7 100644 --- a/trunk/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/AnimationCopyExample.java +++ b/trunk/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/AnimationCopyExample.java @@ -25,6 +25,7 @@ import com.ardor3d.extension.animation.skeletal.SkinnedMeshCombineLogic; import com.ardor3d.extension.animation.skeletal.blendtree.ManagedTransformSource; import com.ardor3d.extension.animation.skeletal.blendtree.SimpleAnimationApplier; import com.ardor3d.extension.animation.skeletal.clip.AnimationClip; +import com.ardor3d.extension.animation.skeletal.clip.AnimationClipInstance; import com.ardor3d.extension.animation.skeletal.state.loader.InputStore; import com.ardor3d.extension.animation.skeletal.state.loader.JSLayerImporter; import com.ardor3d.extension.animation.skeletal.util.MissingCallback; @@ -424,7 +425,7 @@ public class AnimationCopyExample extends ExampleBase { // add callback for our UI manager.findClipInstance("skeleton.punch").addAnimationListener(new AnimationListener() { - public void animationFinished() { + public void animationFinished(final AnimationClipInstance source) { punchButton.setEnabled(true); } }); diff --git a/trunk/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/AnimationStateExample.java b/trunk/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/AnimationStateExample.java index ee705bc..ca0ee21 100644 --- a/trunk/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/AnimationStateExample.java +++ b/trunk/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/AnimationStateExample.java @@ -25,6 +25,7 @@ import com.ardor3d.extension.animation.skeletal.SkinnedMesh; import com.ardor3d.extension.animation.skeletal.SkinnedMeshCombineLogic; import com.ardor3d.extension.animation.skeletal.blendtree.SimpleAnimationApplier; import com.ardor3d.extension.animation.skeletal.clip.AnimationClip; +import com.ardor3d.extension.animation.skeletal.clip.AnimationClipInstance; import com.ardor3d.extension.animation.skeletal.state.loader.InputStore; import com.ardor3d.extension.animation.skeletal.state.loader.JSLayerImporter; import com.ardor3d.extension.animation.skeletal.util.MissingCallback; @@ -421,7 +422,7 @@ public class AnimationStateExample extends ExampleBase { // add callback for our UI manager.findClipInstance("skeleton.punch").addAnimationListener(new AnimationListener() { - public void animationFinished() { + public void animationFinished(final AnimationClipInstance source) { punchButton.setEnabled(true); } }); |