Removed the deprecated clamped() method from vector2. (The new method is limit_length().)

This commit is contained in:
Relintai 2023-01-15 14:05:45 +01:00
parent 61ddf05296
commit 5972b6cc43
3 changed files with 0 additions and 16 deletions

View File

@ -129,18 +129,6 @@ Vector2 Vector2::snapped(const Vector2 &p_by) const {
Math::stepify(y, p_by.y)); Math::stepify(y, p_by.y));
} }
Vector2 Vector2::clamped(real_t p_len) const {
WARN_DEPRECATED_MSG("'Vector2.clamped()' is deprecated because it has been renamed to 'limit_length'.");
real_t l = length();
Vector2 v = *this;
if (l > 0 && p_len < l) {
v /= l;
v *= p_len;
}
return v;
}
Vector2 Vector2::limit_length(const real_t p_len) const { Vector2 Vector2::limit_length(const real_t p_len) const {
const real_t l = length(); const real_t l = length();
Vector2 v = *this; Vector2 v = *this;

View File

@ -111,8 +111,6 @@ struct _NO_DISCARD_CLASS_ Vector2 {
Vector2 plane_project(real_t p_d, const Vector2 &p_vec) const; Vector2 plane_project(real_t p_d, const Vector2 &p_vec) const;
Vector2 clamped(real_t p_len) const;
_FORCE_INLINE_ static Vector2 linear_interpolate(const Vector2 &p_a, const Vector2 &p_b, real_t p_weight); _FORCE_INLINE_ static Vector2 linear_interpolate(const Vector2 &p_a, const Vector2 &p_b, real_t p_weight);
_FORCE_INLINE_ Vector2 linear_interpolate(const Vector2 &p_to, real_t p_weight) const; _FORCE_INLINE_ Vector2 linear_interpolate(const Vector2 &p_to, real_t p_weight) const;
_FORCE_INLINE_ Vector2 slerp(const Vector2 &p_to, real_t p_weight) const; _FORCE_INLINE_ Vector2 slerp(const Vector2 &p_to, real_t p_weight) const;

View File

@ -534,7 +534,6 @@ struct _VariantCall {
VCALL_LOCALMEM1R(Vector2, posmodv); VCALL_LOCALMEM1R(Vector2, posmodv);
VCALL_LOCALMEM1R(Vector2, project); VCALL_LOCALMEM1R(Vector2, project);
VCALL_LOCALMEM2R(Vector2, plane_project); VCALL_LOCALMEM2R(Vector2, plane_project);
VCALL_LOCALMEM1R(Vector2, clamped);
VCALL_LOCALMEM2R(Vector2, linear_interpolate); VCALL_LOCALMEM2R(Vector2, linear_interpolate);
VCALL_LOCALMEM2R(Vector2, slerp); VCALL_LOCALMEM2R(Vector2, slerp);
VCALL_LOCALMEM4R(Vector2, cubic_interpolate); VCALL_LOCALMEM4R(Vector2, cubic_interpolate);
@ -2636,7 +2635,6 @@ void register_variant_methods() {
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmodv, VECTOR2, "modv", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, posmodv, VECTOR2, "modv", varray());
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, project, VECTOR2, "b", varray()); ADDFUNC1R(VECTOR2, VECTOR2, Vector2, project, VECTOR2, "b", varray());
ADDFUNC2R(VECTOR2, VECTOR2, Vector2, plane_project, REAL, "d", VECTOR2, "vec", varray()); ADDFUNC2R(VECTOR2, VECTOR2, Vector2, plane_project, REAL, "d", VECTOR2, "vec", varray());
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, clamped, REAL, "length", varray());
ADDFUNC2R(VECTOR2, VECTOR2, Vector2, linear_interpolate, VECTOR2, "to", REAL, "weight", varray()); ADDFUNC2R(VECTOR2, VECTOR2, Vector2, linear_interpolate, VECTOR2, "to", REAL, "weight", varray());
ADDFUNC2R(VECTOR2, VECTOR2, Vector2, slerp, VECTOR2, "to", REAL, "weight", varray()); ADDFUNC2R(VECTOR2, VECTOR2, Vector2, slerp, VECTOR2, "to", REAL, "weight", varray());
ADDFUNC4R(VECTOR2, VECTOR2, Vector2, cubic_interpolate, VECTOR2, "b", VECTOR2, "pre_a", VECTOR2, "post_b", REAL, "weight", varray()); ADDFUNC4R(VECTOR2, VECTOR2, Vector2, cubic_interpolate, VECTOR2, "b", VECTOR2, "pre_a", VECTOR2, "post_b", REAL, "weight", varray());