Performs vector normalization (scales vector up to unit length).
| 239 | /// Performs vector normalization (scales vector up to unit length). |
| 240 | /// </summary> |
| 241 | void Normalize() |
| 242 | { |
| 243 | const T length = Math::Sqrt(X * X + Y * Y); |
| 244 | if (length >= ZeroTolerance) |
| 245 | { |
| 246 | const T invLength = (T)1.0f / length; |
| 247 | X *= invLength; |
| 248 | Y *= invLength; |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | public: |
| 253 | Vector2Base operator+(const Vector2Base& b) const |
no test coverage detected