Browse Source

don't clamp t value in set_t()

David Rose 22 years ago
parent
commit
bfc61341a1
2 changed files with 10 additions and 2 deletions
  1. 5 1
      direct/src/interval/Interval.py
  2. 5 1
      direct/src/interval/cInterval.cxx

+ 5 - 1
direct/src/interval/Interval.py

@@ -58,7 +58,11 @@ class Interval(DirectObject):
                 self.getState() == CInterval.SFinal)
 
     def setT(self, t):
-        t = min(max(t, 0.0), self.getDuration())
+        # There doesn't seem to be any reason to clamp this, and it
+        # breaks looping intervals.  The interval code should properly
+        # handle t values outside the proper range.
+        #t = min(max(t, 0.0), self.getDuration())
+        
         state = self.getState()
         if state == CInterval.SInitial:
             self.privInitialize(t)

+ 5 - 1
direct/src/interval/cInterval.cxx

@@ -66,7 +66,11 @@ CInterval(const string &name, double duration, bool open_ended) :
 ////////////////////////////////////////////////////////////////////
 void CInterval::
 set_t(double t) {
-  t = min(max(t, 0.0), get_duration());
+  // There doesn't seem to be any reason to clamp this, and it
+  // breaks looping intervals.  The interval code should properly
+  // handle t values outside the proper range.
+  //t = min(max(t, 0.0), get_duration());
+
   switch (get_state()) {
   case S_initial:
     priv_initialize(t);