1
0
Fork 0
This commit is contained in:
Silc Lizard (Tokage) Renew 2025-02-28 01:36:23 +01:00 committed by GitHub
commit bad7a7d87e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -2562,11 +2562,13 @@ T Animation::_interpolate(const Vector<TKey<T>> &p_keys, double p_time, Interpol
if (is_start_edge) {
idx = p_backward ? maxi : 0;
}
next = CLAMP(idx + (p_backward ? -1 : 1), 0, maxi);
int len2 = MIN(len, p_keys.size() - 1);
next = CLAMP(idx + (p_backward ? -1 : 1), 0, len2);
if (use_cubic) {
pre = CLAMP(idx + (p_backward ? 1 : -1), 0, maxi);
post = CLAMP(idx + (p_backward ? -2 : 2), 0, maxi);
pre = CLAMP(idx + (p_backward ? 1 : -1), 0, len2);
post = CLAMP(idx + (p_backward ? -2 : 2), 0, len2);
}
is_end_edge = p_backward ? idx == 0 : idx >= len2; // TODO: The process needs to be commonized early on without overriding, but all other branches need to be refactored to prevent to collapse loop_wrap key acquisition.
} else if (loop_mode == LOOP_LINEAR) {
if (is_start_edge) {
idx = p_backward ? 0 : maxi;