| 329 | // limit xy component vector to a given length. returns true if vector was limited |
| 330 | template <typename T> |
| 331 | bool Vector3<T>::limit_length_xy(T max_length) |
| 332 | { |
| 333 | const T length_xy = norm(x, y); |
| 334 | if ((length_xy > max_length) && is_positive(length_xy)) { |
| 335 | x *= (max_length / length_xy); |
| 336 | y *= (max_length / length_xy); |
| 337 | return true; |
| 338 | } |
| 339 | return false; |
| 340 | } |
| 341 | |
| 342 | template <typename T> |
| 343 | Vector3<T> &Vector3<T>::operator *=(const T num) |