Merge pull request #53819 from TokageItLab/re-implement-ping-pong

Reimplement ping-pong animation and reverse playback
This commit is contained in:
Rémi Verschelde 2021-11-09 22:11:04 +01:00 committed by GitHub
commit 06a33e590f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 1047 additions and 446 deletions

View file

@ -275,6 +275,10 @@ struct VariantUtilityFunctions {
return Math::wrapf(value, min, max);
}
static inline double pingpong(double value, double length) {
return Math::pingpong(value, length);
}
static inline Variant max(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
if (p_argcount < 2) {
r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
@ -1226,6 +1230,7 @@ void Variant::_register_variant_utility_functions() {
FUNCBINDR(clampf, sarray("value", "min", "max"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(nearest_po2, sarray("value"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(pingpong, sarray("value", "length"), Variant::UTILITY_FUNC_TYPE_MATH);
// Random