diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-03-31 15:24:34 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-03-31 15:24:58 +0400 |
commit | ed775edeeb489e4710bb685a5fd47b16102eb87a (patch) | |
tree | e9545cd1af698561cff6a0927b366ae823bf05bf /source/blender/blenkernel | |
parent | 93aa9b3755954d178a9067c1bcc37ebb7e18af42 (diff) |
Fix T39405: Make "amplitude" for elastic easing more intuitive to use
Previously, amplitude was more of an "absolute" value in the sense that whatever value
you set it to became a sort of "maximum bounce" height. However, it turns out that this
approach isn't so nice when dealing with large gaps between the values of two keyframes,
as the elastic easing equations expect that "amplitude > |change|" (where change is the
difference in values from key1 to key2).
Now, the "amplitude" value we pass to the easing functions are "|change| + amplitude".
This is easier to control, as now, as soon as you start changing that value, there are
immediately visible effects.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 7079525e765..6c4162c7b4b 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -2085,7 +2085,7 @@ static float fcurve_eval_keyframes(FCurve *fcu, BezTriple *bezts, float evaltime const float change = bezt->vec[1][1] - prevbezt->vec[1][1]; const float duration = bezt->vec[1][0] - prevbezt->vec[1][0]; const float time = evaltime - prevbezt->vec[1][0]; - const float amplitude = prevbezt->amplitude; + const float amplitude = prevbezt->amplitude + fabsf(change); /* see T39405 */ const float period = prevbezt->period; /* value depends on interpolation mode */ |