Rename Vector2 clamped to limit_length and add limit_length to Vector3
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user