| 162 | } |
| 163 | |
| 164 | Vector2 Vector2::limit_length(real_t p_len) const { |
| 165 | const real_t l = length(); |
| 166 | Vector2 v = *this; |
| 167 | if (l > 0 && p_len < l) { |
| 168 | v /= l; |
| 169 | v *= p_len; |
| 170 | } |
| 171 | |
| 172 | return v; |
| 173 | } |
| 174 | |
| 175 | Vector2 Vector2::move_toward(const Vector2 &p_to, real_t p_delta) const { |
| 176 | Vector2 v = *this; |
no outgoing calls
no test coverage detected