diff options
author | ricardolpd <[email protected]> | 2012-11-28 18:14:27 +0000 |
---|---|---|
committer | ricardolpd <[email protected]> | 2012-11-28 18:14:27 +0000 |
commit | 9076ac78e4a2111d43e31ee8fa65e32d245144a7 (patch) | |
tree | 48ec2237ee7bee85a5fa23a70b9bf0b8c4d0f796 /trunk/ardor3d-animation/src | |
parent | a9da660bff567873c2b2242681e60d98b405fbf5 (diff) |
-Updates stop state when setting AnimatioUpdateState.stop in current state.
- Allows a last update to so stop state can be set (in Layers which contains states with ClipSource and layer which contain ManagedTransformSource) also
Diffstat (limited to 'trunk/ardor3d-animation/src')
-rw-r--r-- | trunk/ardor3d-animation/src/main/java/com/ardor3d/extension/animation/skeletal/AnimationManager.java | 22 |
1 files changed, 19 insertions, 3 deletions
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 5ec9bf5..e8678a4 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 @@ -85,6 +85,11 @@ public class AnimationManager { protected AnimationUpdateState _currentAnimationState = AnimationUpdateState.Play; /** + * boolean threshold to allow stop state to be updated one last time... + */ + private boolean _canSetStopState = false; + + /** * Listeners for changes to this manager's AnimationUpdateState. */ protected final List<AnimationUpdateStateListener> _updateStateListeners = Lists.newArrayList(); @@ -207,6 +212,12 @@ public class AnimationManager { } } } + } else { + for (final AnimationClipInstance instance : _clipInstances.values()) { + if (instance.isActive()) { + instance.setStartTime(currentTime); + } + } } final AnimationUpdateState oldState = _currentAnimationState; @@ -327,10 +338,15 @@ public class AnimationManager { public void update() { if (_currentAnimationState != AnimationUpdateState.Play) { - // no animation allowed. Exit. - return; + if (_currentAnimationState == AnimationUpdateState.Stop && !_canSetStopState) { + _canSetStopState = true; + } else { + return; + } + // return; + } else { + _canSetStopState = false; } - // grab current global time final double globalTime = _globalTimer.getTimeInSeconds(); |