Rename Vector2 clamped to limit_length and add limit_length to Vector3

This commit is contained in:
Aaron Franke
2021-02-01 00:42:00 -05:00
parent f288a79482
commit 94bc0bd919
10 changed files with 75 additions and 35 deletions

View File

@ -128,8 +128,8 @@ Vector2 Vector2::snapped(const Vector2 &p_step) const {
Math::snapped(y, p_step.y));
}
Vector2 Vector2::clamped(real_t p_len) const {
real_t l = length();
Vector2 Vector2::limit_length(const real_t p_len) const {
const real_t l = length();
Vector2 v = *this;
if (l > 0 && p_len < l) {
v /= l;