| 221 | } |
| 222 | |
| 223 | float Vec2::getAngle(const Vec2& other) const |
| 224 | { |
| 225 | Vec2 a2 = getNormalized(); |
| 226 | Vec2 b2 = other.getNormalized(); |
| 227 | float angle = atan2f(a2.cross(b2), a2.dot(b2)); |
| 228 | if (std::abs(angle) < FLT_EPSILON) |
| 229 | return 0.f; |
| 230 | return angle; |
| 231 | } |
| 232 | |
| 233 | Vec2 Vec2::rotateByAngle(const Vec2& pivot, float angle) const |
| 234 | { |
no test coverage detected