Browse Source

lerp with duration 0 is equivalent to set

David Rose 23 years ago
parent
commit
1604ba4bd6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      direct/src/interval/cLerpInterval.cxx

+ 3 - 1
direct/src/interval/cLerpInterval.cxx

@@ -55,7 +55,9 @@ double CLerpInterval::
 compute_delta(double t) const {
   double duration = get_duration();
   if (duration == 0.0) {
-    return 0.0;
+    // If duration is 0, the lerp works as a set.  Thus, the delta is
+    // always 1.0, the terminating value.
+    return 1.0;
   }
   t /= duration;
   t = min(max(t, 0.0), 1.0);