Merge 067368e2e1
into 7211012c4f
This commit is contained in:
commit
a11ba44409
|
@ -2568,11 +2568,19 @@ T Animation::_interpolate(const Vector<TKey<T>> &p_keys, double p_time, Interpol
|
|||
case INTERPOLATION_CUBIC: {
|
||||
int pre = idx - 1;
|
||||
if (pre < 0) {
|
||||
pre = 0;
|
||||
if (p_loop_wrap) {
|
||||
pre = len - 1;
|
||||
} else {
|
||||
pre = 0;
|
||||
}
|
||||
}
|
||||
int post = next + 1;
|
||||
if (post >= len) {
|
||||
post = next;
|
||||
if (p_loop_wrap) {
|
||||
post = 0;
|
||||
} else {
|
||||
post = next;
|
||||
}
|
||||
}
|
||||
|
||||
return _cubic_interpolate(p_keys[pre].value, p_keys[idx].value, p_keys[next].value, p_keys[post].value, c);
|
||||
|
|
Loading…
Reference in a new issue