Bladeren bron

Fixed issue where effect and audio tracks were looping even if they shouldn't

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10429 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rem..om 12 jaren geleden
bovenliggende
commit
304878c712

+ 2 - 1
engine/src/core/com/jme3/animation/AudioTrack.java

@@ -68,6 +68,7 @@ public class AudioTrack implements ClonableTrack {
     private float length = 0;
     private boolean initialized = false;
     private boolean started = false;
+    private boolean played = false;
 
     //Animation listener to stop the sound when the animation ends or is changed
     private class OnEndListener implements AnimEventListener {
@@ -121,7 +122,7 @@ public class AudioTrack implements ClonableTrack {
      */
     public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
 
-        if (time == length) {
+        if (time >= length) {
             return;
         }
         if (!initialized) {

+ 1 - 1
engine/src/core/com/jme3/animation/EffectTrack.java

@@ -192,7 +192,7 @@ public class EffectTrack implements ClonableTrack {
      */
     public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
 
-        if (time == length) {
+        if (time >= length) {
             return;
         }
         //first time adding the Animation listener to stop the track at the end of the animation