implement ping-pong loop in animation

Co-authored-by: Chaosus <chaosus89@gmail.com>
This commit is contained in:
Tokage
2021-04-25 05:47:03 +09:00
committed by Silc 'Tokage' Renew
parent e8c89b2b91
commit 372ba76663
29 changed files with 852 additions and 362 deletions
+5
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