Browse Source

Fix is_playing() when playing an animation backwards

rdb 9 years ago
parent
commit
2c651dc96b
2 changed files with 7 additions and 1 deletions
  1. 1 0
      doc/ReleaseNotes
  2. 6 1
      panda/src/putil/animInterface.cxx

+ 1 - 0
doc/ReleaseNotes

@@ -35,6 +35,7 @@ This issue fixes several bugs that were still found in 1.9.2.
 * Add normalized() method to vectors
 * Add normalized() method to vectors
 * asyncFlattenStrong with inPlace=True caused node to disappear
 * asyncFlattenStrong with inPlace=True caused node to disappear
 * Fix asyncFlattenStrong called on nodes without parent
 * Fix asyncFlattenStrong called on nodes without parent
+* Fix is_playing() check when playing an animation backwards
 
 
 ------------------------  RELEASE 1.9.2  ------------------------
 ------------------------  RELEASE 1.9.2  ------------------------
 
 

+ 6 - 1
panda/src/putil/animInterface.cxx

@@ -415,7 +415,12 @@ is_playing() const {
     return false;
     return false;
 
 
   case PM_play:
   case PM_play:
-    return get_f() < _play_frames;
+    if (_effective_frame_rate < 0.0) {
+      // If we're playing backwards, check if we're at the beginning.
+      return get_f() > 0;
+   } else {
+      return get_f() < _play_frames;
+    }
 
 
   case PM_loop:
   case PM_loop:
   case PM_pingpong:
   case PM_pingpong: