Fix T46701: Sampled FCurve looks jagged when FModifiers (doing nothing) are present

This was caused by interpolation between samples being performed incorrectly
(i.e. wrong order of arguments) when sampling more than once per frame.
This commit is contained in:
Joshua Leung
2015-11-14 18:08:36 +13:00
parent 4d33c37c9e
commit 9ac08840ae

View File

@@ -2436,11 +2436,11 @@ static float fcurve_eval_samples(FCurve *fcu, FPoint *fpts, float evaltime)
float t = fabsf(evaltime - floorf(evaltime));
/* find the one on the right frame (assume that these are spaced on 1-frame intervals) */
fpt = prevfpt + (int)(evaltime - prevfpt->vec[0]);
fpt = prevfpt + ((int)evaltime - (int)prevfpt->vec[0]);
/* if not exactly on the frame, perform linear interpolation with the next one */
if (t != 0.0f)
cvalue = interpf(fpt->vec[1], (fpt + 1)->vec[1], t);
if ((t != 0.0f) && (t < 1.0f))
cvalue = interpf(fpt->vec[1], (fpt + 1)->vec[1], 1.0f - t);
else
cvalue = fpt->vec[1];
}