From 1604ba4bd66aeb55235cc868e088aedcb382d668 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 3 Oct 2002 21:37:31 +0000 Subject: [PATCH] lerp with duration 0 is equivalent to set --- direct/src/interval/cLerpInterval.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/direct/src/interval/cLerpInterval.cxx b/direct/src/interval/cLerpInterval.cxx index 57166c21ce..e1f9d989a0 100644 --- a/direct/src/interval/cLerpInterval.cxx +++ b/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);