summaryrefslogtreecommitdiff
path: root/core/variant/variant_utility.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-24 10:51:07 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-24 10:51:07 +0100
commitf16c5b564b569497d04deb965a4fd63b3ea2ab2f (patch)
tree1a32664ee30ef467cc4d9f12ee0dc3ff3ceeb6cf /core/variant/variant_utility.cpp
parentf319123af9bac7279edcaa1c17e8f84a615c5aa2 (diff)
parentf9fa182abc5209671cb4fbadc2dc173157d6f939 (diff)
Merge pull request #69043 from xiongyaohua/path3d_bake_refactor_fix
`Curve3D` bake refactor continue
Diffstat (limited to 'core/variant/variant_utility.cpp')
-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 f274b80729..bf4f761f2b 100644
--- a/core/variant/variant_utility.cpp
+++ b/core/variant/variant_utility.cpp
@@ -392,6 +392,10 @@ struct VariantUtilityFunctions {
return Math::bezier_interpolate(p_start, p_control_1, p_control_2, p_end, p_t);
}
+ static inline double bezier_derivative(double p_start, double p_control_1, double p_control_2, double p_end, double p_t) {
+ return Math::bezier_derivative(p_start, p_control_1, p_control_2, p_end, p_t);
+ }
+
static inline double lerp_angle(double from, double to, double weight) {
return Math::lerp_angle(from, to, weight);
}
@@ -1440,6 +1444,7 @@ void Variant::_register_variant_utility_functions() {
FUNCBINDR(cubic_interpolate_in_time, sarray("from", "to", "pre", "post", "weight", "to_t", "pre_t", "post_t"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(cubic_interpolate_angle_in_time, sarray("from", "to", "pre", "post", "weight", "to_t", "pre_t", "post_t"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(bezier_interpolate, sarray("start", "control_1", "control_2", "end", "t"), Variant::UTILITY_FUNC_TYPE_MATH);
+ FUNCBINDR(bezier_derivative, sarray("start", "control_1", "control_2", "end", "t"), 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(remap, sarray("value", "istart", "istop", "ostart", "ostop"), Variant::UTILITY_FUNC_TYPE_MATH);