lerp with duration 0 is equivalent to set

This commit is contained in:
David Rose 2002-10-03 21:37:31 +00:00
parent e866143a8f
commit 1604ba4bd6
1 changed files with 3 additions and 1 deletions

View File

@ -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);