summaryrefslogtreecommitdiff
path: root/core/variant
diff options
context:
space:
mode:
authorSilc 'Tokage' Renew <tokage.it.lab@gmail.com>2022-02-11 12:43:21 +0900
committerSilc 'Tokage' Renew <tokage.it.lab@gmail.com>2022-02-12 18:11:17 +0900
commit865da09871b0242471e7426ed54e9815193df5ae (patch)
tree414aa43ae1741a3ed392463c15373192cbc55953 /core/variant
parentdaf9729b925ea13d77312bb3ce18198e158c03a8 (diff)
Implement cubic_interpolate() as MathFunc for refactoring
Diffstat (limited to 'core/variant')
-rw-r--r--core/variant/variant_utility.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp
index 60950099d2..e83c71098d 100644
--- a/core/variant/variant_utility.cpp
+++ b/core/variant/variant_utility.cpp
@@ -231,6 +231,10 @@ struct VariantUtilityFunctions {
return Math::lerp(from, to, weight);
}
+ static inline double cubic_interpolate(double from, double to, double pre, double post, double weight) {
+ return Math::cubic_interpolate(from, to, pre, post, weight);
+ }
+
static inline double lerp_angle(double from, double to, double weight) {
return Math::lerp_angle(from, to, weight);
}
@@ -1204,6 +1208,7 @@ void Variant::_register_variant_utility_functions() {
FUNCBINDR(snapped, sarray("x", "step"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(lerp, sarray("from", "to", "weight"), Variant::UTILITY_FUNC_TYPE_MATH);
+ FUNCBINDR(cubic_interpolate, sarray("from", "to", "pre", "post", "weight"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(lerp_angle, sarray("from", "to", "weight"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(inverse_lerp, sarray("from", "to", "weight"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(range_lerp, sarray("value", "istart", "istop", "ostart", "ostop"), Variant::UTILITY_FUNC_TYPE_MATH);