summaryrefslogtreecommitdiff
path: root/core/variant
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2020-12-28 21:46:43 +0100
committerGitHub <noreply@github.com>2020-12-28 21:46:43 +0100
commit6cebb8c11773b203039c811c2ee50ba25c99e5e1 (patch)
treec08adb794731c9fd9bcd7ed277e85b43e8c7a2c0 /core/variant
parent8886a6a45c0769903050605898fd07a0ac198cdb (diff)
parentb743a2ef3cc48a94d626fccb49217237b7d4497c (diff)
Merge pull request #44586 from madmiraal/rename-stepify
Rename Math::stepify to snapped
Diffstat (limited to 'core/variant')
-rw-r--r--core/variant/variant_call.cpp4
-rw-r--r--core/variant/variant_utility.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp
index 7a79a5ce9c..a2d9112f0f 100644
--- a/core/variant/variant_call.cpp
+++ b/core/variant/variant_call.cpp
@@ -1016,7 +1016,7 @@ static void _register_variant_builtin_methods() {
bind_method(Vector2, cross, sarray("with"), varray());
bind_method(Vector2, abs, sarray(), varray());
bind_method(Vector2, sign, sarray(), varray());
- bind_method(Vector2, snapped, sarray("by"), varray());
+ bind_method(Vector2, snapped, sarray("step"), varray());
bind_method(Vector2, clamped, sarray("length"), varray());
/* Vector2i */
@@ -1070,7 +1070,7 @@ static void _register_variant_builtin_methods() {
bind_method(Vector3, is_normalized, sarray(), varray());
bind_method(Vector3, is_equal_approx, sarray("to"), varray());
bind_method(Vector3, inverse, sarray(), varray());
- bind_method(Vector3, snapped, sarray("by"), varray());
+ bind_method(Vector3, snapped, sarray("step"), varray());
bind_method(Vector3, rotated, sarray("by_axis", "phi"), varray());
bind_method(Vector3, lerp, sarray("to", "weight"), varray());
bind_method(Vector3, slerp, sarray("to", "weight"), varray());
diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp
index 46359b80ce..9a344143b8 100644
--- a/core/variant/variant_utility.cpp
+++ b/core/variant/variant_utility.cpp
@@ -217,8 +217,8 @@ struct VariantUtilityFunctions {
return Math::range_step_decimals(step);
}
- static inline double stepify(double value, double step) {
- return Math::stepify(value, step);
+ static inline double snapped(double value, double step) {
+ return Math::snapped(value, step);
}
static inline double lerp(double from, double to, double weight) {
@@ -1181,7 +1181,7 @@ void Variant::_register_variant_utility_functions() {
FUNCBINDR(ease, sarray("x", "curve"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(step_decimals, sarray("x"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(range_step_decimals, sarray("x"), Variant::UTILITY_FUNC_TYPE_MATH);
- FUNCBINDR(stepify, sarray("x", "step"), Variant::UTILITY_FUNC_TYPE_MATH);
+ FUNCBINDR(snapped, sarray("x", "step"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(lerp, sarray("from", "to", "weight"), Variant::UTILITY_FUNC_TYPE_MATH);
FUNCBINDR(lerp_angle, sarray("from", "to", "weight"), Variant::UTILITY_FUNC_TYPE_MATH);