diff --git a/direct/src/interval/AnimControlInterval.py b/direct/src/interval/AnimControlInterval.py index 9a92e0d589..bd2acc17ff 100755 --- a/direct/src/interval/AnimControlInterval.py +++ b/direct/src/interval/AnimControlInterval.py @@ -153,7 +153,7 @@ class AnimControlInterval(Interval.Interval): else: frame = max(min(absFrame, numFrames - 1), 0) - self.controls.poseAll(int(frame)) + self.controls.poseAll(frame) self.state = CInterval.SStarted self.currT = t @@ -169,9 +169,9 @@ class AnimControlInterval(Interval.Interval): # a hitch in the animation when it plays back-to-back with # the next cycle. if self.reverse: - self.controls.poseAll(int(self.startFrame)) + self.controls.poseAll(self.startFrame) else: - self.controls.poseAll(int(self.endFrame)) + self.controls.poseAll(self.endFrame) else: # Otherwise, the user-specified duration determines which diff --git a/panda/src/chan/animControlCollection.I b/panda/src/chan/animControlCollection.I index 95d21d2f81..4081d04f64 100644 --- a/panda/src/chan/animControlCollection.I +++ b/panda/src/chan/animControlCollection.I @@ -35,7 +35,7 @@ play(const string &anim_name) { // Description: Starts the named animation playing. //////////////////////////////////////////////////////////////////// INLINE bool AnimControlCollection:: -play(const string &anim_name, int from, int to) { +play(const string &anim_name, double from, double to) { AnimControl *control = find_anim(anim_name); if (control == (AnimControl *)NULL) { return false; @@ -67,7 +67,7 @@ loop(const string &anim_name, bool restart) { // Description: Starts the named animation looping. //////////////////////////////////////////////////////////////////// INLINE bool AnimControlCollection:: -loop(const string &anim_name, bool restart, int from, int to) { +loop(const string &anim_name, bool restart, double from, double to) { AnimControl *control = find_anim(anim_name); if (control == (AnimControl *)NULL) { return false; @@ -99,7 +99,7 @@ stop(const string &anim_name) { // Description: Sets to a particular frame in the named animation. //////////////////////////////////////////////////////////////////// INLINE bool AnimControlCollection:: -pose(const string &anim_name, int frame) { +pose(const string &anim_name, double frame) { AnimControl *control = find_anim(anim_name); if (control == (AnimControl *)NULL) { return false; diff --git a/panda/src/chan/animControlCollection.cxx b/panda/src/chan/animControlCollection.cxx index 075e73c0ab..87cb4b026b 100644 --- a/panda/src/chan/animControlCollection.cxx +++ b/panda/src/chan/animControlCollection.cxx @@ -191,7 +191,7 @@ play_all() { // Description: Starts all animations playing. //////////////////////////////////////////////////////////////////// void AnimControlCollection:: -play_all(int from, int to) { +play_all(double from, double to) { Controls::const_iterator ci; for (ci = _controls.begin(); ci != _controls.end(); ++ci) { (*ci)._control->play(from, to); @@ -219,7 +219,7 @@ loop_all(bool restart) { // Description: Starts all animations looping. //////////////////////////////////////////////////////////////////// void AnimControlCollection:: -loop_all(bool restart, int from, int to) { +loop_all(bool restart, double from, double to) { Controls::const_iterator ci; for (ci = _controls.begin(); ci != _controls.end(); ++ci) { (*ci)._control->loop(restart, from, to); @@ -254,7 +254,7 @@ stop_all() { // Description: Sets all animations to the indicated frame. //////////////////////////////////////////////////////////////////// void AnimControlCollection:: -pose_all(int frame) { +pose_all(double frame) { Controls::const_iterator ci; for (ci = _controls.begin(); ci != _controls.end(); ++ci) { (*ci)._control->pose(frame); diff --git a/panda/src/chan/animControlCollection.h b/panda/src/chan/animControlCollection.h index 38be5b9407..7435339660 100644 --- a/panda/src/chan/animControlCollection.h +++ b/panda/src/chan/animControlCollection.h @@ -55,19 +55,19 @@ PUBLISHED: // directly into the AnimControl's functionality by anim name. INLINE bool play(const string &anim_name); - INLINE bool play(const string &anim_name, int from, int to); + INLINE bool play(const string &anim_name, double from, double to); INLINE bool loop(const string &anim_name, bool restart); - INLINE bool loop(const string &anim_name, bool restart, int from, int to); + INLINE bool loop(const string &anim_name, bool restart, double from, double to); INLINE bool stop(const string &anim_name); - INLINE bool pose(const string &anim_name, int frame); + INLINE bool pose(const string &anim_name, double frame); // These functions operate on all anims at once. void play_all(); - void play_all(int from, int to); + void play_all(double from, double to); void loop_all(bool restart); - void loop_all(bool restart, int from, int to); + void loop_all(bool restart, double from, double to); bool stop_all(); - void pose_all(int frame); + void pose_all(double frame); INLINE int get_frame(const string &anim_name) const; INLINE int get_frame() const;